![]() -> Click here to learn how to get live help <- |
SDL_GL_SetAttributeIndexNAMESDL_GL_SetAttribute- Set a special SDL/OpenGL attributeSYNOPSISfB#include "SDL&.h" fBint fBSDL_GL_SetAttributefPfR(fBSDL_GLattr attr, int valuefR); DESCRIPTIONSets the OpenGL fIattributefR fBattrfR to fBvaluefR&. The attributes you set don&'t take effect until after a call to fIfBSDL_SetVideoModefPfR&. You should use fIfBSDL_GL_GetAttributefPfR to check the values after a fBSDL_SetVideoModefP call&. RETURN VALUEReturns fB0fR on success, or fB-1fR on error&. EXAMPLE
f(CWSDL_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; }fR
SEE ALSOfIfBSDL_GL_GetAttributefPfR, fIGL AttributesfR
Index |