Mercurial > sdl-ios-xcode
comparison src/video/x11/SDL_x11gl.c @ 450:8a43e0cbf02f
Added SDL_GL_STEREO for stereoscopic OpenGL contexts
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Mon, 19 Aug 2002 17:58:08 +0000 |
parents | f6ffac90895c |
children | d6e7d7006062 |
comparison
equal
deleted
inserted
replaced
449:8a687496061f | 450:8a43e0cbf02f |
---|---|
65 VisualScreenMask|VisualIDMask, &vi_in, &out_count); | 65 VisualScreenMask|VisualIDMask, &vi_in, &out_count); |
66 return glx_visualinfo; | 66 return glx_visualinfo; |
67 } | 67 } |
68 | 68 |
69 /* Setup our GLX attributes according to the gl_config. */ | 69 /* Setup our GLX attributes according to the gl_config. */ |
70 i = 0; | 70 i = 0; |
71 attribs[i++] = GLX_RGBA; | 71 attribs[i++] = GLX_RGBA; |
72 attribs[i++] = GLX_RED_SIZE; | 72 attribs[i++] = GLX_RED_SIZE; |
73 attribs[i++] = this->gl_config.red_size; | 73 attribs[i++] = this->gl_config.red_size; |
74 attribs[i++] = GLX_GREEN_SIZE; | 74 attribs[i++] = GLX_GREEN_SIZE; |
75 attribs[i++] = this->gl_config.green_size; | 75 attribs[i++] = this->gl_config.green_size; |
76 attribs[i++] = GLX_BLUE_SIZE; | 76 attribs[i++] = GLX_BLUE_SIZE; |
80 attribs[i++] = GLX_ALPHA_SIZE; | 80 attribs[i++] = GLX_ALPHA_SIZE; |
81 attribs[i++] = this->gl_config.alpha_size; | 81 attribs[i++] = this->gl_config.alpha_size; |
82 } | 82 } |
83 | 83 |
84 if( this->gl_config.buffer_size ) { | 84 if( this->gl_config.buffer_size ) { |
85 attribs[i++] = GLX_BUFFER_SIZE; | 85 attribs[i++] = GLX_BUFFER_SIZE; |
86 attribs[i++] = this->gl_config.buffer_size; | 86 attribs[i++] = this->gl_config.buffer_size; |
87 } | 87 } |
88 | 88 |
89 if( this->gl_config.double_buffer ) { | 89 if( this->gl_config.double_buffer ) { |
90 attribs[i++] = GLX_DOUBLEBUFFER; | 90 attribs[i++] = GLX_DOUBLEBUFFER; |
91 } | 91 } |
97 attribs[i++] = GLX_STENCIL_SIZE; | 97 attribs[i++] = GLX_STENCIL_SIZE; |
98 attribs[i++] = this->gl_config.stencil_size; | 98 attribs[i++] = this->gl_config.stencil_size; |
99 } | 99 } |
100 | 100 |
101 if( this->gl_config.accum_red_size ) { | 101 if( this->gl_config.accum_red_size ) { |
102 attribs[i++] = GLX_ACCUM_RED_SIZE; | 102 attribs[i++] = GLX_ACCUM_RED_SIZE; |
103 attribs[i++] = this->gl_config.accum_red_size; | 103 attribs[i++] = this->gl_config.accum_red_size; |
104 } | 104 } |
105 | 105 |
106 if( this->gl_config.accum_green_size ) { | 106 if( this->gl_config.accum_green_size ) { |
107 attribs[i++] = GLX_ACCUM_GREEN_SIZE; | 107 attribs[i++] = GLX_ACCUM_GREEN_SIZE; |
108 attribs[i++] = this->gl_config.accum_green_size; | 108 attribs[i++] = this->gl_config.accum_green_size; |
109 } | 109 } |
110 | 110 |
111 if( this->gl_config.accum_blue_size ) { | 111 if( this->gl_config.accum_blue_size ) { |
112 attribs[i++] = GLX_ACCUM_BLUE_SIZE; | 112 attribs[i++] = GLX_ACCUM_BLUE_SIZE; |
113 attribs[i++] = this->gl_config.accum_blue_size; | 113 attribs[i++] = this->gl_config.accum_blue_size; |
114 } | 114 } |
115 | 115 |
116 if( this->gl_config.accum_alpha_size ) { | 116 if( this->gl_config.accum_alpha_size ) { |
117 attribs[i++] = GLX_ACCUM_ALPHA_SIZE; | 117 attribs[i++] = GLX_ACCUM_ALPHA_SIZE; |
118 attribs[i++] = this->gl_config.accum_alpha_size; | 118 attribs[i++] = this->gl_config.accum_alpha_size; |
119 } | |
120 | |
121 if( this->gl_config.stereo ) { | |
122 attribs[i++] = GLX_STEREO; | |
123 attribs[i++] = this->gl_config.stereo; | |
119 } | 124 } |
120 | 125 |
121 #ifdef GLX_DIRECT_COLOR /* Try for a DirectColor visual for gamma support */ | 126 #ifdef GLX_DIRECT_COLOR /* Try for a DirectColor visual for gamma support */ |
122 attribs[i++] = GLX_X_VISUAL_TYPE; | 127 attribs[i++] = GLX_X_VISUAL_TYPE; |
123 attribs[i++] = GLX_DIRECT_COLOR; | 128 attribs[i++] = GLX_DIRECT_COLOR; |
285 case SDL_GL_ACCUM_BLUE_SIZE: | 290 case SDL_GL_ACCUM_BLUE_SIZE: |
286 glx_attrib = GLX_ACCUM_BLUE_SIZE; | 291 glx_attrib = GLX_ACCUM_BLUE_SIZE; |
287 break; | 292 break; |
288 case SDL_GL_ACCUM_ALPHA_SIZE: | 293 case SDL_GL_ACCUM_ALPHA_SIZE: |
289 glx_attrib = GLX_ACCUM_ALPHA_SIZE; | 294 glx_attrib = GLX_ACCUM_ALPHA_SIZE; |
295 break; | |
296 case SDL_GL_STEREO: | |
297 glx_attrib = GLX_STEREO; | |
290 break; | 298 break; |
291 default: | 299 default: |
292 return(-1); | 300 return(-1); |
293 } | 301 } |
294 | 302 |