VIZ++ Class: OpenGLRenderBuffer

 VIZ++ Class Library  VIZ++ Samples  VIZ++ ClassTree 

Source code

/*
 * OpenGLRenderBuffer.h 
 * Copyright (c) 2015 Antillia.com TOSHIYUKI ARAI. ALL RIGHTS RESERVED. 
 */


#pragma once

#ifdef GL_ARB_framebuffer_object

#include <viz++/openglarb/OpenGLRenderBuffers.h>

namespace VIZ {

class OpenGLRenderBuffer :public OpenGLRenderBuffers {

private:
  GLenum target;
 
public:
  OpenGLRenderBuffer(GLenum target=GL_RENDERBUFFER)
  :OpenGLRenderBuffers(1),
  target(target)
  {
  }
  

  ~OpenGLRenderBuffer()
  {
  }
  
  operator GLuint()
  {
    return getNth(0);
  }
  
  void bind()
  {
     OpenGLRenderBuffers::bindNth(this->target, 0);
  }
  
  void unbind()
  {
     OpenGLRenderBuffers::bind(this->target, 0);
  }
  
  void getParameteriv(GLenum pname, GLint* params)
  {
    OpenGLRenderBuffers::getParameteriv(this->target, pname, params);
  }

  GLboolean isRenderbuffer()
  {
    GLuint buffer = getNth(0);
    return OpenGLRenderBuffers::isRenderbuffer(buffer);
  }

  void storage(GLenum internalformat, GLsizei width, GLsizei height)
  {
    OpenGLRenderBuffers::storage(this->target, internalformat, width, height);
  }
  
};

}
#endif
  
  

Last modified: 10 Feb 2017

Copyright (c) 2009-2017 Antillia.com ALL RIGHTS RESERVED.