VIZ++ Class: OpenGLFrameBufferExt

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

Source code

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



#pragma once

#ifdef GL_EXT_framebuffer_object

#include <viz++/openglext/OpenGLFrameBuffersEXT.h>

namespace VIZ {

class OpenGLFrameBufferEXT :public OpenGLFrameBuffersEXT {

private:
  GLenum target;

public:
  OpenGLFrameBufferEXT(GLenum target=GL_FRAMEBUFFER_EXT)
  :OpenGLFrameBuffersEXT(1),
  target(target)
  {
  }
  
  ~OpenGLFrameBufferEXT()
  {
  }
  
  operator GLuint()
  {
    return getNth(0);
  }
  
  GLenum check()
  {
    OpenGLFrameBuffersEXT::check(this->target);
  }
  
  void bind()
  {
    GLuint buffer = getNth(0);
    OpenGLFrameBuffersEXT::bind(this->target, buffer);
  }
  
  void unbind()
  {
    OpenGLFrameBuffersEXT::bind(this->target, 0);
  }
  
  void attachRenderbuffer(GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
  {
    OpenGLFrameBuffersEXT::attachRenderbuffer(this->target, attachment, renderbuffertarget, renderbuffer);
  }
  
  void texture1D(GLenum attachment, GLenum textarget, GLuint texture, GLint level)
  {
    OpenGLFrameBuffersEXT::texture1D(this->target, attachment, textarget, texture, level);
  }

  void texture2D(GLenum attachment, GLenum textarget, GLuint texture, GLint level)
  {
    OpenGLFrameBuffersEXT::texture2D(this->target, attachment, textarget, texture, level);
  }
    
  void texture3D(GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset)
  {
    OpenGLFrameBuffersEXT::texture3D(this->target, attachment, textarget, texture, level, zoffset);
  }
    
  void getAttachmentParameterivEXT(GLenum target, GLenum attachment, GLenum pname, GLint* params)
  {
    OpenGLFrameBuffersEXT::getAttachmentParameterivEXT(this->target, attachment, pname, params);
  }
    
  GLboolean isFramebuffer()
  {
    GLuint buffer = getNth(0);
    return OpenGLFrameBuffersEXT::isFramebuffer(buffer);
  }
};

}

#endif
  
  

Last modified: 10 Feb 2017

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