Copyright (C) 2000-2012 |
Manpages SDL_GL_SetAttributeSection: SDL API Reference (3)Updated: Tue 11 Sep 2001, 23:01 Index Return to Main Contents NAMESDL_GL_SetAttribute- Set a special SDL/OpenGL attributeSYNOPSIS#include "SDL.h" int SDL_GL_SetAttribute(SDL_GLattr attr, int value); DESCRIPTIONSets the OpenGL attribute attr to value. The attributes you set don't take effect until after a call to SDL_SetVideoMode. You should use SDL_GL_GetAttribute to check the values after a SDL_SetVideoMode call. RETURN VALUEReturns 0 on success, or -1 on error. EXAMPLE
SDL_GL_SetAttribute( SDL_GL_RED_SIZE, 5 ); SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, 5 ); SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, 5 ); SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 16 ); SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 ); if ( (screen=SDL_SetVideoMode( 640, 480, 16, SDL_OPENGL )) == NULL ) { fprintf(stderr, "Couldn't set GL mode: %s ", SDL_GetError()); SDL_Quit(); return; }
SEE ALSOSDL_GL_GetAttribute, GL Attributes
IndexThis document was created by man2html, using the manual pages. Time: 03:49:45 GMT, April 19, 2024 |