0022819: Redesign of OpenGl driver
[occt.git] / src / OpenGl / OpenGl_ExtFBO.hxx
1 // File:      OpenGl_ExtVBO.hxx
2 // Created:   26 January 2012
3 // Author:    Kirill GAVRILOV
4 // Copyright: OPEN CASCADE 2012
5
6 #ifndef _OpenGl_ExtFBO_H__
7 #define _OpenGl_ExtFBO_H__
8
9 #if (defined(_WIN32) || defined(__WIN32__))
10   #include <windows.h>
11 #endif
12 #include <GL/gl.h>
13
14 //! FBO is part of OpenGL since 2.0
15 struct OpenGl_ExtFBO
16 {
17   #ifndef GL_FRAMEBUFFER_EXT
18     #define GL_FRAMEBUFFER_EXT 0x8D40
19   #endif
20   #ifndef GL_COLOR_ATTACHMENT0_EXT
21     #define GL_COLOR_ATTACHMENT0_EXT 0x8CE0
22   #endif
23   #ifndef GL_FRAMEBUFFER_COMPLETE_EXT
24     #define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5
25   #endif
26   #ifndef GL_RENDERBUFFER_EXT
27     #define GL_RENDERBUFFER_EXT 0x8D41
28   #endif
29   #ifndef GL_DEPTH_ATTACHMENT_EXT
30     #define GL_DEPTH_ATTACHMENT_EXT 0x8D00
31   #endif
32
33 public:
34
35   typedef void (APIENTRY *glGenFramebuffersEXT_t) (GLsizei n, GLuint* ids);
36   typedef void (APIENTRY *glDeleteFramebuffersEXT_t) (GLsizei n, GLuint* ids);
37   typedef void (APIENTRY *glBindFramebufferEXT_t) (GLenum target, GLuint id);
38   typedef void (APIENTRY *glFramebufferTexture2DEXT_t) (GLenum target, GLenum attachmentPoint,
39                                                         GLenum textureTarget, GLuint textureId,
40                                                         GLint level);
41   typedef GLenum (APIENTRY *glCheckFramebufferStatusEXT_t) (GLenum target);
42   typedef void (APIENTRY *glGenRenderbuffersEXT_t) (GLsizei n, GLuint* ids);
43   typedef void (APIENTRY *glDeleteRenderbuffersEXT_t) (GLsizei n, GLuint* ids);
44   typedef void (APIENTRY *glBindRenderbufferEXT_t) (GLenum target, GLuint id);
45   typedef void (APIENTRY *glRenderbufferStorageEXT_t) (GLenum target, GLenum internalFormat,
46                                                        GLsizei width, GLsizei height);
47
48   typedef void (APIENTRY *glFramebufferRenderbufferEXT_t) (GLenum target,
49                                                            GLenum attachmentPoint,
50                                                            GLenum renderbufferTarget,
51                                                            GLuint renderbufferId);
52
53 public:
54
55   glGenFramebuffersEXT_t         glGenFramebuffersEXT;
56   glDeleteFramebuffersEXT_t      glDeleteFramebuffersEXT;
57   glBindFramebufferEXT_t         glBindFramebufferEXT;
58   glFramebufferTexture2DEXT_t    glFramebufferTexture2DEXT;
59   glCheckFramebufferStatusEXT_t  glCheckFramebufferStatusEXT;
60   glGenRenderbuffersEXT_t        glGenRenderbuffersEXT;
61   glDeleteRenderbuffersEXT_t     glDeleteRenderbuffersEXT;
62   glBindRenderbufferEXT_t        glBindRenderbufferEXT;
63   glRenderbufferStorageEXT_t     glRenderbufferStorageEXT;
64   glFramebufferRenderbufferEXT_t glFramebufferRenderbufferEXT;
65
66 };
67
68 #endif // _OpenGl_ExtFBO_H__