]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Porting to Windows
authorouv <ouv@opencascade.com>
Thu, 11 Feb 2010 14:20:51 +0000 (14:20 +0000)
committerouv <ouv@opencascade.com>
Thu, 11 Feb 2010 14:20:51 +0000 (14:20 +0000)
src/OpenGLUtils/OpenGLUtils_FrameBuffer.cxx
src/OpenGLUtils/OpenGLUtils_FrameBuffer.h

index 164003661c8712b988f1a29d3ba0965f430beca3..87357ec47a36cc88d89949efbaee36390271fbb5 100755 (executable)
@@ -24,9 +24,6 @@
 //
 #include "OpenGLUtils_FrameBuffer.h"
 
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glext.h>
-
 #ifndef WNT
 # ifndef GLX_GLXEXT_LEGACY
 #  define GLX_GLXEXT_LEGACY
 # include <wingdi.h>
 #endif
 
-PFNGLGENFRAMEBUFFERSEXTPROC vglGenFramebuffersEXT = NULL;
-PFNGLBINDFRAMEBUFFEREXTPROC vglBindFramebufferEXT = NULL;
-PFNGLFRAMEBUFFERTEXTURE2DEXTPROC vglFramebufferTexture2DEXT = NULL;
-PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC vglCheckFramebufferStatusEXT = NULL;
-PFNGLDELETEFRAMEBUFFERSEXTPROC vglDeleteFramebuffersEXT = NULL;
-PFNGLGENRENDERBUFFERSEXTPROC vglGenRenderbuffersEXT = NULL;
-PFNGLBINDRENDERBUFFEREXTPROC vglBindRenderbufferEXT = NULL;
-PFNGLRENDERBUFFERSTORAGEEXTPROC vglRenderbufferStorageEXT = NULL;
-PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC vglFramebufferRenderbufferEXT = NULL;
-PFNGLDELETEFRAMEBUFFERSEXTPROC vglDeleteRenderbuffersEXT = NULL;
+#ifndef APIENTRY
+#define APIENTRY
+#endif
+#ifndef APIENTRYP
+#define APIENTRYP APIENTRY *
+#endif
+
+#ifndef GL_FRAMEBUFFER_EXT
+#define GL_FRAMEBUFFER_EXT                0x8D40
+#endif
+
+#ifndef GL_RENDERBUFFER_EXT
+#define GL_RENDERBUFFER_EXT               0x8D41
+#endif
+
+#ifndef GL_COLOR_ATTACHMENT0_EXT
+#define GL_COLOR_ATTACHMENT0_EXT          0x8CE0
+#endif
+
+#ifndef GL_DEPTH_ATTACHMENT_EXT
+#define GL_DEPTH_ATTACHMENT_EXT           0x8D00
+#endif
+
+#ifndef GL_FRAMEBUFFER_COMPLETE_EXT
+#define GL_FRAMEBUFFER_COMPLETE_EXT       0x8CD5
+#endif
+
+typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint *framebuffers);
+typedef void (APIENTRYP PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint *framebuffers);
+typedef void (APIENTRYP PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint *renderbuffers);
+typedef void (APIENTRYP PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer);
+typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint *renderbuffers);
+
+static PFNGLGENFRAMEBUFFERSEXTPROC vglGenFramebuffersEXT = NULL;
+static PFNGLBINDFRAMEBUFFEREXTPROC vglBindFramebufferEXT = NULL;
+static PFNGLFRAMEBUFFERTEXTURE2DEXTPROC vglFramebufferTexture2DEXT = NULL;
+static PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC vglCheckFramebufferStatusEXT = NULL;
+static PFNGLDELETEFRAMEBUFFERSEXTPROC vglDeleteFramebuffersEXT = NULL;
+static PFNGLGENRENDERBUFFERSEXTPROC vglGenRenderbuffersEXT = NULL;
+static PFNGLBINDRENDERBUFFEREXTPROC vglBindRenderbufferEXT = NULL;
+static PFNGLRENDERBUFFERSTORAGEEXTPROC vglRenderbufferStorageEXT = NULL;
+static PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC vglFramebufferRenderbufferEXT = NULL;
+static PFNGLDELETERENDERBUFFERSEXTPROC vglDeleteRenderbuffersEXT = NULL;
 
 #ifndef WNT
 #define GL_GetProcAddress( x ) glXGetProcAddressARB( (const GLubyte*)x )
index b45e4bf1c0765abbfbd3ab4cc7a6f0f557dafb76..3f0d2688fd9d0cdf1ee35a64104bb6e9ee2d6add 100755 (executable)
 
 #include "OpenGLUtils.h"
 
+#ifdef WIN32
+#include <windows.h>
+#endif
+
 #include <GL/gl.h>
 
 class OPENGLUTILS_EXPORT OpenGLUtils_FrameBuffer