Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Latest commit

 

History

History
40 lines (40 loc) · 1.38 KB

SDL_GL_SetAttribute.3

File metadata and controls

40 lines (40 loc) · 1.38 KB
 
Sep 14, 2001
Sep 14, 2001
1
.TH "SDL_GL_SetAttribute" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
Apr 26, 2001
Apr 26, 2001
2
.SH "NAME"
Dec 29, 2007
Dec 29, 2007
3
SDL_GL_SetAttribute \- Set a special SDL/OpenGL attribute
Apr 26, 2001
Apr 26, 2001
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
.SH "SYNOPSIS"
.PP
\fB#include "SDL\&.h"
.sp
\fBint \fBSDL_GL_SetAttribute\fP\fR(\fBSDL_GLattr attr, int value\fR);
.SH "DESCRIPTION"
.PP
Sets the OpenGL \fIattribute\fR \fBattr\fR to \fBvalue\fR\&. The attributes you set don\&'t take effect until after a call to \fI\fBSDL_SetVideoMode\fP\fR\&. You should use \fI\fBSDL_GL_GetAttribute\fP\fR to check the values after a \fBSDL_SetVideoMode\fP call\&.
.SH "RETURN VALUE"
.PP
Returns \fB0\fR on success, or \fB-1\fR on error\&.
.SH "EXAMPLE"
.PP
.nf
\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
.fi
.PP
.PP
.RS
\fBNote:
.PP
The \fBSDL_DOUBLEBUF\fP 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\&.
.RE
.SH "SEE ALSO"
.PP
\fI\fBSDL_GL_GetAttribute\fP\fR, \fIGL Attributes\fR
Sep 14, 2001
Sep 14, 2001
40
...\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01