From b0458bd5fa6903628cb663a0b789b2869ab3bad9 Mon Sep 17 00:00:00 2001 From: Simon Robertshaw Date: Tue, 1 Nov 2011 19:29:13 +0000 Subject: [PATCH] OpenGL on Windows --- src/graphics.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/graphics.c b/src/graphics.c index 0ed664d70..20c6dd7d4 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -6,6 +6,10 @@ #ifdef MACOSX #include #include +#elif defined(WIN32) +#include +#include +#include #else #include #include @@ -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();