GLProgramming.com

home :: about :: development guides :: irc :: forums :: search :: paste :: links :: contribute :: code dump

-> Click here to learn how to get live help <-


Manpage of SDL_GL_SetAttribute

SDL_GL_SetAttribute

Index
 

NAME

SDL_GL_SetAttribute- Set a special SDL/OpenGL attribute  

SYNOPSIS

fB#include "SDL&.h"

fBint fBSDL_GL_SetAttributefPfR(fBSDL_GLattr attr, int valuefR);  

DESCRIPTION

Sets 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 VALUE

Returns 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

fBNote:

The fBSDL_DOUBLEBUFfP flag is not required to enable double buffering when setting an OpenGL video mode&. Double buffering is enabled or disabled using the SDL_GL_DOUBLEBUFFER attribute&.

 

SEE ALSO

fIfBSDL_GL_GetAttributefPfR, fIGL AttributesfR


 

Index

NAME
SYNOPSIS
DESCRIPTION
RETURN VALUE
EXAMPLE
SEE ALSO