| VRS - The Virtual Rendering System |
| version 3.3 |
00001 /****************************************************************************** 00002 * VRS - The Virtual Rendering System 00003 * Copyright (C) 2000-2005 Computer Graphics Systems Group at the 00004 * Hasso-Plattner-Institute (HPI), Potsdam, Germany. 00005 * 00006 * This library is free software; you can redistribute it and/or modify it 00007 * under the terms of the GNU Lesser General Public License as published by 00008 * the Free Software Foundation; either version 2.1 of the License, or (at 00009 * your option) any later version. This library is distributed in the hope 00010 * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied 00011 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU Lesser General Public License for more details. You should have received 00013 * a copy of the GNU Lesser+ General Public License along with this library; if 00014 * not, write to the FreeSoftware Foundation, Inc., 59 Temple Place, Suite 330, 00015 * Boston, MA, 02111-1307, USA. 00016 ******************************************************************************/ 00017 00018 // $Id: renderbuffergl.h 6014 2007-08-09 07:51:16Z Konstantin_Baumann $ 00019 // 00020 // $Log$ 00021 // Revision 1.1 2005/07/19 09:32:00 nienhaus 00022 // initial check-in 00023 // 00024 00025 #ifndef VRS_RENDERBUFFERGL_H 00026 #define VRS_RENDERBUFFERGL_H 00027 00028 #include <vrs/opengl/fbo/rendertargetgl.h> 00029 #include <vrs/opengl/openglconfig.h> 00030 00031 namespace VRS { 00032 00034 class VRS_CORE_API RenderBufferGL : public RenderTargetGL { 00037 public: 00038 RenderBufferGL(GLenum internalFormat, unsigned int width, unsigned int height); 00044 virtual GLenum renderTarget() const { return GL_RENDERBUFFER_EXT; }; 00047 virtual unsigned int width() const; 00048 virtual unsigned int height() const; 00051 GLenum getInternalFormat() const; 00058 void setWidth(unsigned int width); 00059 void setHeight(unsigned int height); 00064 VRS_TYPEINFO(RenderBufferGL, RenderTargetGL); 00065 VRS_SERIALIZABLE(RenderBufferGL); 00066 00067 protected: 00068 RenderBufferGL() { } // for serialization only 00069 00070 private: 00071 GLenum internalFormat_; 00072 unsigned int width_; 00073 unsigned int height_; 00074 }; 00075 00076 // virtual functions implementations 00077 inline GLenum RenderBufferGL::getInternalFormat() const { return internalFormat_; } 00078 inline unsigned int RenderBufferGL::width() const { return width_; } 00079 inline unsigned int RenderBufferGL::height() const { return height_; } 00080 00081 // inlines 00082 inline void RenderBufferGL::setWidth(unsigned int w) { 00083 if(w!=width_) { 00084 width_=w; 00085 00086 modified(); 00087 } 00088 } 00089 inline void RenderBufferGL::setHeight(unsigned int h) { 00090 if(h!=height_) { 00091 height_=h; 00092 00093 modified(); 00094 } 00095 } 00096 } // namespace VRS 00097 00098 #endif // VRS_RENDERBUFFERGL_H