diff options
-rwxr-xr-x | glut/mingw32 | 2 | ||||
-rw-r--r-- | sdl/mingw32 | 2 | ||||
-rw-r--r-- | sdl/pyramid.c | 14 |
3 files changed, 12 insertions, 6 deletions
diff --git a/glut/mingw32 b/glut/mingw32 index 3abba2c..808146e 100755 --- a/glut/mingw32 +++ b/glut/mingw32 @@ -21,4 +21,4 @@ math3d.o: math3d.c math3d.h .PHONY: clean clean: - rm -f *.o ./$(PROG) + rm -f *.o ./$(PROG).exe diff --git a/sdl/mingw32 b/sdl/mingw32 index a43c1ef..ff7555e 100644 --- a/sdl/mingw32 +++ b/sdl/mingw32 @@ -30,4 +30,4 @@ shader.o: shader.c shader.h math3d.h .PHONY: clean clean: - rm -f *.o ./$(PROG) + rm -f *.o ./$(PROG).exe diff --git a/sdl/pyramid.c b/sdl/pyramid.c index e08b426..265ffcd 100644 --- a/sdl/pyramid.c +++ b/sdl/pyramid.c @@ -1,6 +1,6 @@ /* pyramid.c * - * @2010 Kamil Kaminski + * @2011 Kamil Kaminski * * notes: since lighting is enabled, we need to specify normals for * each polygon face so the OpenGL can calculate e.g. how light reflects @@ -63,7 +63,7 @@ static void resize(int w, int h) glLoadIdentity(); /* this needs to be ran again, glut does it for you I suppose */ - SDL_SetVideoMode(w, h, 32, SDL_OPENGL | SDL_GL_DOUBLEBUFFER | SDL_RESIZABLE); + SDL_SetVideoMode(w, h, 32, SDL_OPENGL | SDL_RESIZABLE); } static void setup_opengl(void) @@ -302,8 +302,14 @@ int main(int argc, char **argv) atexit(SDL_Quit); SDL_WM_SetCaption("Textured Pyramid", NULL); - if ((screen = SDL_SetVideoMode(640, 480, 32, SDL_OPENGL | SDL_GL_DOUBLEBUFFER - | SDL_RESIZABLE)) == NULL) + SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8); + SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8); + SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8); + SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 8); + SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); + SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16); + + if ((screen = SDL_SetVideoMode(640, 480, 32, SDL_OPENGL | SDL_RESIZABLE)) == NULL) { fprintf(stderr, "unable to set video mode: %s\n", SDL_GetError()); exit(-1); |