summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2011-11-01 19:29:13 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2011-11-01 19:29:13 (GMT)
commitb0458bd5fa6903628cb663a0b789b2869ab3bad9 (patch)
tree7932118c21fc8d75ece0704fae66d0baf19d25e4 /src
parent4f74cfa35dbc40be0cb6426a06d2eeb13b0df6c7 (diff)
downloadpowder-b0458bd5fa6903628cb663a0b789b2869ab3bad9.zip
powder-b0458bd5fa6903628cb663a0b789b2869ab3bad9.tar.gz
OpenGL on Windows
Diffstat (limited to 'src')
-rw-r--r--src/graphics.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/graphics.c b/src/graphics.c
index 0ed664d..20c6dd7 100644
--- a/src/graphics.c
+++ b/src/graphics.c
@@ -6,6 +6,10 @@
#ifdef MACOSX
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
+#elif defined(WIN32)
+#include <GL/glew.h>
+#include <GL/gl.h>
+#include <GL/glu.h>
#else
#include <GL/gl.h>
#include <GL/glu.h>
@@ -3706,6 +3710,7 @@ void render_cursor(pixel *vid, int x, int y, int t, int rx, int ry)
int sdl_opened = 0;
int sdl_open(void)
{
+ int status;
if (SDL_Init(SDL_INIT_VIDEO)<0)
{
fprintf(stderr, "Initializing SDL: %s\n", SDL_GetError());
@@ -3728,6 +3733,14 @@ int sdl_open(void)
}
else
{
+#ifdef WIN32
+ status = glewInit();
+ if(status != GLEW_OK)
+ {
+ fprintf(stderr, "Initializing Glew: %d\n", status);
+ return 0;
+ }
+#endif
glMatrixMode(GL_PROJECTION);
glLoadIdentity();