summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2011-11-02 13:36:55 (GMT)
committerJosé Fonseca <jfonseca@vmware.com>2011-11-02 13:36:55 (GMT)
commit39014eea0e892a3fd62474469fda638e724b890b (patch)
treeda06a15efa41954e8d0ecf81124c6cc0565d6416
parente38396b2c19ee65a6cd0e8f44fb7d051d7851a3a (diff)
wglcontext: Several fixes that were forgotten when commiting.
-rw-r--r--src/wgl/wglcontext.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/wgl/wglcontext.c b/src/wgl/wglcontext.c
index 957689b..92df7cc 100644
--- a/src/wgl/wglcontext.c
+++ b/src/wgl/wglcontext.c
@@ -22,9 +22,8 @@
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
-#include <GL/gl.h>
-#include <GL/glext.h>
-#include <GL/wglext.h>
+#include <GL/glew.h>
+#include <GL/wglew.h>
static LRESULT CALLBACK
WndProc(HWND hWnd,
@@ -43,7 +42,7 @@ WndProc(HWND hWnd,
return 0;
}
-static char *
+static const char *
context_error_to_string(DWORD error)
{
switch (error) {
@@ -72,17 +71,17 @@ profile_mask_to_string(GLint profileMask)
}
static void
-print_context_infos()
+print_context_infos(void)
{
GLint majorVersion;
GLint minorVersion;
GLint profileMask;
- const GLubyte *version;
+ const char *version;
fprintf(stdout, "Context Informations\n");
- version = glGetString(GL_VERSION);
- fprintf(stdout, "GL_VERSION: %s\n", glGetString(GL_VERSION));
+ version = (const char *)glGetString(GL_VERSION);
+ fprintf(stdout, "GL_VERSION: %s\n", version);
// Request informations with the new 3.x features.
if (sscanf(version, "%d.%d", &majorVersion, &minorVersion) != 2)
@@ -153,9 +152,9 @@ create_context(int majorVersion, int minorVersion, int profileMask, int contextF
}
memset(&pfd, 0, sizeof(pfd));
- pfd.nVersion = 1;
pfd.nSize = sizeof(pfd);
- pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL;
+ pfd.nVersion = 1;
+ pfd.dwFlags = PFD_DOUBLEBUFFER | PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL;
pfd.iPixelType = PFD_TYPE_RGBA;
pfd.cColorBits = 24;
pfd.cDepthBits = 24;
@@ -199,7 +198,7 @@ create_context(int majorVersion, int minorVersion, int profileMask, int contextF
ctx = wglCreateContextAttribsARB(hdc, 0, attribsList);
if (!ctx) {
DWORD error = GetLastError();
- fprintf(stderr, "wglCreateContextAttribsARB failed(): %s (0x%x)\n",
+ fprintf(stderr, "wglCreateContextAttribsARB failed(): %s (0x%lx)\n",
context_error_to_string(error), error);
return;
}
@@ -212,7 +211,7 @@ create_context(int majorVersion, int minorVersion, int profileMask, int contextF
return;
}
- print_context_infos(majorVersion);
+ print_context_infos();
}
static void