gKitGL
|
00001 00002 #ifndef _GKFRAMEBUFFER_MANAGER_H 00003 #define _GKFRAMEBUFFER_MANAGER_H 00004 00005 #include "GLResource.h" 00006 #include "GL/GLPlatform.h" 00007 #include "GL/TPFramebuffer.h" 00008 00009 00010 namespace gk { 00011 00012 //! \ingroup openGL 00013 //@{ 00014 00015 //! gestion 'auto' des rendertargets. 00016 inline 00017 GLRendertarget *createRendertarget( const GLenum target ) 00018 { 00019 return GLManager<GLRendertarget>::manager().insert( 00020 new GLRendertarget(target) ); 00021 } 00022 00023 //! gestion 'auto' des rendertargets. 00024 inline 00025 GLRendertarget *createRendertarget( const unsigned int state, const int w, const int h, const unsigned int buffer_bits, 00026 const TextureFormat& color_format= TextureRGBA, const TextureFormat& depth_format= TextureDepth ) 00027 { 00028 return GLManager<GLRendertarget>::manager().insert( 00029 new GLRendertarget(state, w, h, buffer_bits, color_format, depth_format) ); 00030 } 00031 00032 //! gestion 'auto' des (draw) framebuffers. 00033 inline 00034 GLFramebuffer *createFramebuffer( ) 00035 { 00036 return GLManager<GLFramebuffer>::manager().insert( 00037 new GLFramebuffer() ); 00038 } 00039 00040 //! gestion 'auto' des (draw) framebuffers. 00041 inline 00042 GLFramebuffer *createFramebuffer( const int w, const int h, const unsigned int buffer_bits, 00043 const TextureFormat& color_format= TextureRGBA, const TextureFormat& depth_format= TextureDepth ) 00044 { 00045 return GLManager<GLFramebuffer>::manager().insert( 00046 new GLFramebuffer(w, h, buffer_bits, color_format, depth_format) ); 00047 } 00048 00049 //! gestion 'auto' des (read) framebuffers. 00050 inline 00051 GLFramebuffer *createReadFramebuffer( ) 00052 { 00053 return GLManager<GLFramebuffer>::manager().insert( 00054 new GLFramebuffer() ); 00055 } 00056 00057 //! gestion 'auto' des (read) framebuffers. 00058 inline 00059 GLReadFramebuffer *createReadFramebuffer( const int w, const int h, const unsigned int buffer_bits, 00060 const TextureFormat& color_format= TextureRGBA, const TextureFormat& depth_format= TextureDepth ) 00061 { 00062 return GLManager<GLReadFramebuffer>::manager().insert( 00063 new GLReadFramebuffer(w, h, buffer_bits, color_format, depth_format) ); 00064 } 00065 00066 //@} 00067 00068 } 00069 00070 #endif