summaryrefslogtreecommitdiff
path: root/src/PowderToy.cpp
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-04-22 16:13:43 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-04-22 16:13:43 (GMT)
commite38fd405af5f07667203c6f584a5cdb00ed20ca2 (patch)
treef5630c0e43cb848bb36a29c0d20599dcc324161c /src/PowderToy.cpp
parent553cf6552070aae93e1db031b57afdc8c9ba19e0 (diff)
downloadpowder-e38fd405af5f07667203c6f584a5cdb00ed20ca2.zip
powder-e38fd405af5f07667203c6f584a5cdb00ed20ca2.tar.gz
Correct quirks with drawrect and fillrect, change UI components accordingly, shorten save name in save button
Diffstat (limited to 'src/PowderToy.cpp')
-rw-r--r--src/PowderToy.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/PowderToy.cpp b/src/PowderToy.cpp
index cd647e8..0e43231 100644
--- a/src/PowderToy.cpp
+++ b/src/PowderToy.cpp
@@ -35,6 +35,7 @@ extern "C" IMAGE_DOS_HEADER __ImageBase;
SDL_Surface * SDLOpen()
{
+ SDL_Surface * surface;
#if defined(WIN32) && defined(WINCONSOLE)
FILE * console = fopen("CON", "w" );
#endif
@@ -75,10 +76,21 @@ SDL_Surface * SDLOpen()
//SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
atexit(SDL_Quit);
#ifndef OGLR
- return SDL_SetVideoMode(XRES + BARSIZE, YRES + MENUSIZE, 32, SDL_SWSURFACE);
+ surface = SDL_SetVideoMode(XRES + BARSIZE, YRES + MENUSIZE, 32, SDL_SWSURFACE);
#else
- return SDL_SetVideoMode(XRES + BARSIZE, YRES + MENUSIZE, 32, SDL_OPENGL);
+ surface = SDL_SetVideoMode(XRES + BARSIZE, YRES + MENUSIZE, 32, SDL_OPENGL);
#endif
+
+#if defined(WIN32) && defined(OGLR)
+ int status = glewInit();
+ if(status != GLEW_OK)
+ {
+ fprintf(stderr, "Initializing Glew: %d\n", status);
+ exit(-1);
+ }
+#endif
+
+return surface;
}
/*int SDLPoll(SDL_Event * event)