diff options
author | Matt Turner <mattst88@gmail.com> | 2010-02-03 16:28:26 -0500 |
---|---|---|
committer | Matt Turner <mattst88@gmail.com> | 2011-04-04 17:14:36 -0400 |
commit | c13c49df034b292652017e35b3bf4fa6b9fe6af7 (patch) | |
tree | 1ba158c2afbbe3d019e615d469f27aa9c749aaf2 /glpong3d.c | |
parent | 2afaf90c1111cf64b90dedc25a795aff66f9dc9b (diff) |
Minor warnings clean up.
Signed-off-by: Matt Turner <mattst88@gmail.com>
Diffstat (limited to 'glpong3d.c')
-rw-r--r-- | glpong3d.c | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -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); |