VIZ++ Class: OpenGLFrameBuffer
|
Source code
/*
* OpenGLFrameBuffer.h
* Copyright (c) 2015 Antillia.com TOSHIYUKI ARAI. ALL RIGHTS RESERVED.
*/
#pragma once
#ifdef GL_ARB_framebuffer_object
#include <viz++/openglarb/OpenGLFrameBuffers.h>
namespace VIZ {
class OpenGLFrameBuffer :public OpenGLFrameBuffers {
private:
GLenum target;
public:
OpenGLFrameBuffer(GLenum target=GL_FRAMEBUFFER)
:OpenGLFrameBuffers(1),
target(target)
{
}
~OpenGLFrameBuffer()
{
}
operator GLuint()
{
return getNth(0);
}
void bind()
{
OpenGLFrameBuffers::bindNth(this->target, 0);
}
void unbind()
{
OpenGLFrameBuffers::bind(this->target, 0);
}
GLenum check()
{
return OpenGLFrameBuffers::check(this->target);
}
void attachRenderbuffer(GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
{
OpenGLFrameBuffers::attachRenderbuffer(this->target, attachment, renderbuffertarget, renderbuffer);
}
void detachRenderbuffer(GLenum attachment, GLenum renderbuffertarget)
{
OpenGLFrameBuffers::detachRenderbuffer(this->target, attachment, renderbuffertarget);
}
void texture1D(GLenum attachment, GLenum textarget, GLuint texture, GLint level)
{
OpenGLFrameBuffers::texture1D(this->target, attachment, textarget, texture, level);
}
void texture2D(GLenum attachment, GLenum textarget, GLuint texture, GLint level)
{
OpenGLFrameBuffers::texture2D(this->target, attachment, textarget, texture, level);
}
void texture3D(GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset)
{
OpenGLFrameBuffers::texture3D(this->target, attachment, textarget, texture, level, zoffset);
}
void getAttachmentParameteriv(GLenum attachment, GLenum pname, GLint* params)
{
OpenGLFrameBuffers::getAttachmentParameteriv(this->target, attachment, pname, params);
}
};
}
#endif
Last modified: 10 Feb 2017
Copyright (c) 2009-2017 Antillia.com ALL RIGHTS RESERVED.