From c13c49df034b292652017e35b3bf4fa6b9fe6af7 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Wed, 3 Feb 2010 16:28:26 -0500 Subject: Minor warnings clean up. Signed-off-by: Matt Turner --- glpong3d.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'glpong3d.c') diff --git a/glpong3d.c b/glpong3d.c index 13eb677..60d720b 100644 --- a/glpong3d.c +++ b/glpong3d.c @@ -71,7 +71,6 @@ int main(int argc, char * argv[]) { static int GLPong_Init(GLPong_t * GLPong) { - SDL_Surface * Surface = NULL; SDL_Surface * temp = NULL; GLuint texture; @@ -111,7 +110,10 @@ GLPong_Init(GLPong_t * GLPong) { } atexit(SDLNet_Quit); - Surface = SDL_SetVideoMode(GLPONG_WIDTH, GLPONG_HEIGHT, 32, SDL_OPENGL); + if (SDL_SetVideoMode(GLPONG_WIDTH, GLPONG_HEIGHT, 32, SDL_OPENGL) == NULL) { + fprintf(stderr, "SDL_SetVideoMode failed: %s\n", SDL_GetError()); + return -1; + } glViewport(0, 0, GLPONG_WIDTH, GLPONG_HEIGHT); glMatrixMode(GL_PROJECTION); @@ -124,14 +126,14 @@ GLPong_Init(GLPong_t * GLPong) { glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glShadeModel(GL_SMOOTH); glEnable(GL_BLEND); -/* glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);*/ /* disabled since it causes drawing corruption, but necessary to enable transparency */ + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glDepthFunc(GL_LEQUAL); glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); - printf("OpenGL Vendor: %s\n", glGetString(GL_VENDOR)); - printf("OpenGL Renderer: %s\n", glGetString(GL_RENDERER)); - printf("OpenGL Version: %s\n", glGetString(GL_VERSION)); - printf("OpenGL Extensions: %s\n", glGetString(GL_EXTENSIONS)); + printf("OpenGL Vendor: %s\n", (char *)glGetString(GL_VENDOR)); + printf("OpenGL Renderer: %s\n", (char *)glGetString(GL_RENDERER)); + printf("OpenGL Version: %s\n", (char *)glGetString(GL_VERSION)); + printf("OpenGL Extensions: %s\n", (char *)glGetString(GL_EXTENSIONS)); /*temp = IMG_Load("ball.png");*/ /* disabled since it's already loaded for the icon */ texture = SDL_GL_SurfaceToTexture(temp); -- cgit v1.2.3