comparison src/video/ataricommon/SDL_atarigl.c @ 2033:b657f0bc72c2

More work for 1.3
author Patrice Mandin <patmandin@gmail.com>
date Wed, 20 Sep 2006 21:29:44 +0000
parents c121d94672cb
children adf732f1f016
comparison
equal deleted inserted replaced
2032:ddf89133aebc 2033:b657f0bc72c2
78 int 78 int
79 SDL_AtariGL_Init(_THIS, SDL_Surface * current) 79 SDL_AtariGL_Init(_THIS, SDL_Surface * current)
80 { 80 {
81 #if SDL_VIDEO_OPENGL 81 #if SDL_VIDEO_OPENGL
82 if (gl_oldmesa) { 82 if (gl_oldmesa) {
83 gl_active = InitOld(this, current); 83 gl_active = InitOld(_this, current);
84 } else { 84 } else {
85 gl_active = InitNew(this, current); 85 gl_active = InitNew(_this, current);
86 } 86 }
87 #endif 87 #endif
88 88
89 return (gl_active); 89 return (gl_active);
90 } 90 }
93 SDL_AtariGL_Quit(_THIS, SDL_bool unload) 93 SDL_AtariGL_Quit(_THIS, SDL_bool unload)
94 { 94 {
95 #if SDL_VIDEO_OPENGL 95 #if SDL_VIDEO_OPENGL
96 if (gl_oldmesa) { 96 if (gl_oldmesa) {
97 /* Old mesa implementations */ 97 /* Old mesa implementations */
98 if (this->gl_data->OSMesaDestroyLDG) { 98 if (_this->gl_data->OSMesaDestroyLDG) {
99 this->gl_data->OSMesaDestroyLDG(); 99 _this->gl_data->OSMesaDestroyLDG();
100 } 100 }
101 if (gl_shadow) { 101 if (gl_shadow) {
102 Mfree(gl_shadow); 102 Mfree(gl_shadow);
103 gl_shadow = NULL; 103 gl_shadow = NULL;
104 } 104 }
105 } else { 105 } else {
106 /* New mesa implementation */ 106 /* New mesa implementation */
107 if (gl_ctx) { 107 if (gl_ctx) {
108 if (this->gl_data->OSMesaDestroyContext) { 108 if (_this->gl_data->OSMesaDestroyContext) {
109 this->gl_data->OSMesaDestroyContext(gl_ctx); 109 _this->gl_data->OSMesaDestroyContext(gl_ctx);
110 } 110 }
111 gl_ctx = NULL; 111 gl_ctx = NULL;
112 } 112 }
113 } 113 }
114 114
115 if (unload) { 115 if (unload) {
116 SDL_AtariGL_UnloadLibrary(this); 116 SDL_AtariGL_UnloadLibrary(_this);
117 } 117 }
118 #endif /* SDL_VIDEO_OPENGL */ 118 #endif /* SDL_VIDEO_OPENGL */
119 gl_active = 0; 119 gl_active = 0;
120 } 120 }
121 121
132 SDL_SetError("OpenGL context already created"); 132 SDL_SetError("OpenGL context already created");
133 return -1; 133 return -1;
134 } 134 }
135 135
136 /* Unload previous driver */ 136 /* Unload previous driver */
137 SDL_AtariGL_UnloadLibrary(this); 137 SDL_AtariGL_UnloadLibrary(_this);
138 138
139 /* Load library given by path */ 139 /* Load library given by path */
140 handle = SDL_LoadObject(path); 140 handle = SDL_LoadObject(path);
141 if (handle == NULL) { 141 if (handle == NULL) {
142 /* Try to load another one */ 142 /* Try to load another one */
165 if (handle == NULL) { 165 if (handle == NULL) {
166 SDL_SetError("Could not load OpenGL library"); 166 SDL_SetError("Could not load OpenGL library");
167 return -1; 167 return -1;
168 } 168 }
169 169
170 this->gl_data->glGetIntegerv = SDL_LoadFunction(handle, "glGetIntegerv"); 170 _this->gl_data->glGetIntegerv = SDL_LoadFunction(handle, "glGetIntegerv");
171 this->gl_data->glFinish = SDL_LoadFunction(handle, "glFinish"); 171 _this->gl_data->glFinish = SDL_LoadFunction(handle, "glFinish");
172 this->gl_data->glFlush = SDL_LoadFunction(handle, "glFlush"); 172 _this->gl_data->glFlush = SDL_LoadFunction(handle, "glFlush");
173 173
174 cancel_load = SDL_FALSE; 174 cancel_load = SDL_FALSE;
175 if (this->gl_data->glGetIntegerv == NULL) { 175 if (_this->gl_data->glGetIntegerv == NULL) {
176 cancel_load = SDL_TRUE; 176 cancel_load = SDL_TRUE;
177 } else { 177 } else {
178 /* We need either glFinish (OSMesa) or glFlush (TinyGL) */ 178 /* We need either glFinish (OSMesa) or glFlush (TinyGL) */
179 if ((this->gl_data->glFinish == NULL) && 179 if ((_this->gl_data->glFinish == NULL) &&
180 (this->gl_data->glFlush == NULL)) { 180 (_this->gl_data->glFlush == NULL)) {
181 cancel_load = SDL_TRUE; 181 cancel_load = SDL_TRUE;
182 } 182 }
183 } 183 }
184 if (cancel_load) { 184 if (cancel_load) {
185 SDL_SetError("Could not retrieve OpenGL functions"); 185 SDL_SetError("Could not retrieve OpenGL functions");
188 SDL_AtariGL_InitPointers(this); 188 SDL_AtariGL_InitPointers(this);
189 return -1; 189 return -1;
190 } 190 }
191 191
192 /* Load functions pointers (osmesa.ldg) */ 192 /* Load functions pointers (osmesa.ldg) */
193 this->gl_data->OSMesaCreateContextExt = 193 _this->gl_data->OSMesaCreateContextExt =
194 SDL_LoadFunction(handle, "OSMesaCreateContextExt"); 194 SDL_LoadFunction(handle, "OSMesaCreateContextExt");
195 this->gl_data->OSMesaDestroyContext = 195 _this->gl_data->OSMesaDestroyContext =
196 SDL_LoadFunction(handle, "OSMesaDestroyContext"); 196 SDL_LoadFunction(handle, "OSMesaDestroyContext");
197 this->gl_data->OSMesaMakeCurrent = 197 _this->gl_data->OSMesaMakeCurrent =
198 SDL_LoadFunction(handle, "OSMesaMakeCurrent"); 198 SDL_LoadFunction(handle, "OSMesaMakeCurrent");
199 this->gl_data->OSMesaPixelStore = 199 _this->gl_data->OSMesaPixelStore =
200 SDL_LoadFunction(handle, "OSMesaPixelStore"); 200 SDL_LoadFunction(handle, "OSMesaPixelStore");
201 this->gl_data->OSMesaGetProcAddress = 201 _this->gl_data->OSMesaGetProcAddress =
202 SDL_LoadFunction(handle, "OSMesaGetProcAddress"); 202 SDL_LoadFunction(handle, "OSMesaGetProcAddress");
203 203
204 /* Load old functions pointers (mesa_gl.ldg, tiny_gl.ldg) */ 204 /* Load old functions pointers (mesa_gl.ldg, tiny_gl.ldg) */
205 this->gl_data->OSMesaCreateLDG = 205 _this->gl_data->OSMesaCreateLDG =
206 SDL_LoadFunction(handle, "OSMesaCreateLDG"); 206 SDL_LoadFunction(handle, "OSMesaCreateLDG");
207 this->gl_data->OSMesaDestroyLDG = 207 _this->gl_data->OSMesaDestroyLDG =
208 SDL_LoadFunction(handle, "OSMesaDestroyLDG"); 208 SDL_LoadFunction(handle, "OSMesaDestroyLDG");
209 209
210 gl_oldmesa = 0; 210 gl_oldmesa = 0;
211 211
212 if ((this->gl_data->OSMesaCreateContextExt == NULL) || 212 if ((_this->gl_data->OSMesaCreateContextExt == NULL) ||
213 (this->gl_data->OSMesaDestroyContext == NULL) || 213 (_this->gl_data->OSMesaDestroyContext == NULL) ||
214 (this->gl_data->OSMesaMakeCurrent == NULL) || 214 (_this->gl_data->OSMesaMakeCurrent == NULL) ||
215 (this->gl_data->OSMesaPixelStore == NULL) || 215 (_this->gl_data->OSMesaPixelStore == NULL) ||
216 (this->gl_data->OSMesaGetProcAddress == NULL)) { 216 (_this->gl_data->OSMesaGetProcAddress == NULL)) {
217 /* Hum, maybe old library ? */ 217 /* Hum, maybe old library ? */
218 if ((this->gl_data->OSMesaCreateLDG == NULL) || 218 if ((_this->gl_data->OSMesaCreateLDG == NULL) ||
219 (this->gl_data->OSMesaDestroyLDG == NULL)) { 219 (_this->gl_data->OSMesaDestroyLDG == NULL)) {
220 SDL_SetError("Could not retrieve OSMesa functions"); 220 SDL_SetError("Could not retrieve OSMesa functions");
221 SDL_UnloadObject(handle); 221 SDL_UnloadObject(handle);
222 /* Restore pointers to static library */ 222 /* Restore pointers to static library */
223 SDL_AtariGL_InitPointers(this); 223 SDL_AtariGL_InitPointers(_this);
224 return -1; 224 return -1;
225 } else { 225 } else {
226 gl_oldmesa = 1; 226 gl_oldmesa = 1;
227 } 227 }
228 } 228 }
229 229
230 this->gl_config.dll_handle = handle; 230 _this->gl_config.dll_handle = handle;
231 if (path) { 231 if (path) {
232 SDL_strlcpy(this->gl_config.driver_path, path, 232 SDL_strlcpy(_this->gl_config.driver_path, path,
233 SDL_arraysize(this->gl_config.driver_path)); 233 SDL_arraysize(_this->gl_config.driver_path));
234 } else { 234 } else {
235 *this->gl_config.driver_path = '\0'; 235 *this->gl_config.driver_path = '\0';
236 } 236 }
237 237
238 #endif 238 #endif
239 this->gl_config.driver_loaded = 1; 239 _this->gl_config.driver_loaded = 1;
240 240
241 return 0; 241 return 0;
242 #else 242 #else
243 return -1; 243 return -1;
244 #endif 244 #endif
248 SDL_AtariGL_GetProcAddress(_THIS, const char *proc) 248 SDL_AtariGL_GetProcAddress(_THIS, const char *proc)
249 { 249 {
250 void *func = NULL; 250 void *func = NULL;
251 #if SDL_VIDEO_OPENGL 251 #if SDL_VIDEO_OPENGL
252 252
253 if (this->gl_config.dll_handle) { 253 if (_this->gl_config.dll_handle) {
254 func = SDL_LoadFunction(this->gl_config.dll_handle, (void *) proc); 254 func = SDL_LoadFunction(this->gl_config.dll_handle, (void *) proc);
255 } else if (this->gl_data->OSMesaGetProcAddress) { 255 } else if (_this->gl_data->OSMesaGetProcAddress) {
256 func = this->gl_data->OSMesaGetProcAddress(proc); 256 func = _this->gl_data->OSMesaGetProcAddress(proc);
257 } 257 }
258 #endif 258 #endif
259 return func; 259 return func;
260 } 260 }
261 261
282 break; 282 break;
283 case SDL_GL_ALPHA_SIZE: 283 case SDL_GL_ALPHA_SIZE:
284 mesa_attrib = GL_ALPHA_BITS; 284 mesa_attrib = GL_ALPHA_BITS;
285 break; 285 break;
286 case SDL_GL_DOUBLEBUFFER: 286 case SDL_GL_DOUBLEBUFFER:
287 surface = this->screen; 287 surface = _this->screen;
288 *value = ((surface->flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF); 288 *value = ((surface->flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF);
289 return 0; 289 return 0;
290 case SDL_GL_DEPTH_SIZE: 290 case SDL_GL_DEPTH_SIZE:
291 mesa_attrib = GL_DEPTH_BITS; 291 mesa_attrib = GL_DEPTH_BITS;
292 break; 292 break;
307 break; 307 break;
308 default: 308 default:
309 return -1; 309 return -1;
310 } 310 }
311 311
312 this->gl_data->glGetIntegerv(mesa_attrib, value); 312 _this->gl_data->glGetIntegerv(mesa_attrib, value);
313 return 0; 313 return 0;
314 #else 314 #else
315 return -1; 315 return -1;
316 #endif 316 #endif
317 } 317 }
325 325
326 if (gl_oldmesa && gl_active) { 326 if (gl_oldmesa && gl_active) {
327 return 0; 327 return 0;
328 } 328 }
329 329
330 if (this->gl_config.dll_handle) { 330 if (_this->gl_config.dll_handle) {
331 if ((this->gl_data->OSMesaMakeCurrent == NULL) || 331 if ((_this->gl_data->OSMesaMakeCurrent == NULL) ||
332 (this->gl_data->OSMesaPixelStore == NULL)) { 332 (_this->gl_data->OSMesaPixelStore == NULL)) {
333 return -1; 333 return -1;
334 } 334 }
335 } 335 }
336 336
337 if (!gl_active) { 337 if (!gl_active) {
338 SDL_SetError("Invalid OpenGL context"); 338 SDL_SetError("Invalid OpenGL context");
339 return -1; 339 return -1;
340 } 340 }
341 341
342 surface = this->screen; 342 surface = _this->screen;
343 343
344 if ((surface->format->BitsPerPixel == 15) 344 if ((surface->format->BitsPerPixel == 15)
345 || (surface->format->BitsPerPixel == 16)) { 345 || (surface->format->BitsPerPixel == 16)) {
346 type = GL_UNSIGNED_SHORT_5_6_5; 346 type = GL_UNSIGNED_SHORT_5_6_5;
347 } else { 347 } else {
348 type = GL_UNSIGNED_BYTE; 348 type = GL_UNSIGNED_BYTE;
349 } 349 }
350 350
351 if (! 351 if (!
352 (this->gl_data-> 352 (_this->gl_data->
353 OSMesaMakeCurrent(gl_ctx, surface->pixels, type, surface->w, 353 OSMesaMakeCurrent(gl_ctx, surface->pixels, type, surface->w,
354 surface->h))) { 354 surface->h))) {
355 SDL_SetError("Can not make OpenGL context current"); 355 SDL_SetError("Can not make OpenGL context current");
356 return -1; 356 return -1;
357 } 357 }
358 358
359 /* OSMesa draws upside down */ 359 /* OSMesa draws upside down */
360 this->gl_data->OSMesaPixelStore(OSMESA_Y_UP, 0); 360 _this->gl_data->OSMesaPixelStore(OSMESA_Y_UP, 0);
361 361
362 return 0; 362 return 0;
363 #else 363 #else
364 return -1; 364 return -1;
365 #endif 365 #endif
368 void 368 void
369 SDL_AtariGL_SwapBuffers(_THIS) 369 SDL_AtariGL_SwapBuffers(_THIS)
370 { 370 {
371 #if SDL_VIDEO_OPENGL 371 #if SDL_VIDEO_OPENGL
372 if (gl_active) { 372 if (gl_active) {
373 if (this->gl_config.dll_handle) { 373 if (_this->gl_config.dll_handle) {
374 if (this->gl_data->glFinish) { 374 if (_this->gl_data->glFinish) {
375 this->gl_data->glFinish(); 375 _this->gl_data->glFinish();
376 } else if (this->gl_data->glFlush) { 376 } else if (_this->gl_data->glFlush) {
377 this->gl_data->glFlush(); 377 _this->gl_data->glFlush();
378 } 378 }
379 } else { 379 } else {
380 this->gl_data->glFinish(); 380 _this->gl_data->glFinish();
381 } 381 }
382 gl_copyshadow(this, this->screen); 382 gl_copyshadow(_this, _this->screen);
383 gl_convert(this, this->screen); 383 gl_convert(_this, _this->screen);
384 } 384 }
385 #endif 385 #endif
386 } 386 }
387 387
388 void 388 void
389 SDL_AtariGL_InitPointers(_THIS) 389 SDL_AtariGL_InitPointers(_THIS)
390 { 390 {
391 #if SDL_VIDEO_OPENGL 391 #if SDL_VIDEO_OPENGL
392 this->gl_data->OSMesaCreateContextExt = OSMesaCreateContextExt; 392 _this->gl_data->OSMesaCreateContextExt = OSMesaCreateContextExt;
393 this->gl_data->OSMesaDestroyContext = OSMesaDestroyContext; 393 _this->gl_data->OSMesaDestroyContext = OSMesaDestroyContext;
394 this->gl_data->OSMesaMakeCurrent = OSMesaMakeCurrent; 394 _this->gl_data->OSMesaMakeCurrent = OSMesaMakeCurrent;
395 this->gl_data->OSMesaPixelStore = OSMesaPixelStore; 395 _this->gl_data->OSMesaPixelStore = OSMesaPixelStore;
396 this->gl_data->OSMesaGetProcAddress = OSMesaGetProcAddress; 396 _this->gl_data->OSMesaGetProcAddress = OSMesaGetProcAddress;
397 397
398 this->gl_data->glGetIntegerv = glGetIntegerv; 398 _this->gl_data->glGetIntegerv = glGetIntegerv;
399 this->gl_data->glFinish = glFinish; 399 _this->gl_data->glFinish = glFinish;
400 this->gl_data->glFlush = glFlush; 400 _this->gl_data->glFlush = glFlush;
401 401
402 this->gl_data->OSMesaCreateLDG = NULL; 402 _this->gl_data->OSMesaCreateLDG = NULL;
403 this->gl_data->OSMesaDestroyLDG = NULL; 403 _this->gl_data->OSMesaDestroyLDG = NULL;
404 #endif 404 #endif
405 } 405 }
406 406
407 /*--- Private functions ---*/ 407 /*--- Private functions ---*/
408 408
409 static void 409 static void
410 SDL_AtariGL_UnloadLibrary(_THIS) 410 SDL_AtariGL_UnloadLibrary(_THIS)
411 { 411 {
412 #if SDL_VIDEO_OPENGL 412 #if SDL_VIDEO_OPENGL
413 if (this->gl_config.dll_handle) { 413 if (_this->gl_config.dll_handle) {
414 SDL_UnloadObject(this->gl_config.dll_handle); 414 SDL_UnloadObject(_this->gl_config.dll_handle);
415 this->gl_config.dll_handle = NULL; 415 _this->gl_config.dll_handle = NULL;
416 416
417 /* Restore pointers to static library */ 417 /* Restore pointers to static library */
418 SDL_AtariGL_InitPointers(this); 418 SDL_AtariGL_InitPointers(_this);
419 } 419 }
420 #endif 420 #endif
421 } 421 }
422 422
423 /*--- Creation of an OpenGL context using new/old functions ---*/ 423 /*--- Creation of an OpenGL context using new/old functions ---*/
430 SDL_PixelFormat *pixel_format; 430 SDL_PixelFormat *pixel_format;
431 Uint32 redmask; 431 Uint32 redmask;
432 int recreatecontext; 432 int recreatecontext;
433 GLint newaccumsize; 433 GLint newaccumsize;
434 434
435 if (this->gl_config.dll_handle) { 435 if (_this->gl_config.dll_handle) {
436 if (this->gl_data->OSMesaCreateContextExt == NULL) { 436 if (_this->gl_data->OSMesaCreateContextExt == NULL) {
437 return 0; 437 return 0;
438 } 438 }
439 } 439 }
440 440
441 /* Init OpenGL context using OSMesa */ 441 /* Init OpenGL context using OSMesa */
494 break; 494 break;
495 } 495 }
496 496
497 /* Try to keep current context if possible */ 497 /* Try to keep current context if possible */
498 newaccumsize = 498 newaccumsize =
499 this->gl_config.accum_red_size + 499 _this->gl_config.accum_red_size +
500 this->gl_config.accum_green_size + 500 _this->gl_config.accum_green_size +
501 this->gl_config.accum_blue_size + this->gl_config.accum_alpha_size; 501 _this->gl_config.accum_blue_size + _this->gl_config.accum_alpha_size;
502 recreatecontext = 1; 502 recreatecontext = 1;
503 if (gl_ctx && 503 if (gl_ctx &&
504 (gl_curformat == osmesa_format) && 504 (gl_curformat == osmesa_format) &&
505 (gl_curdepth == this->gl_config.depth_size) && 505 (gl_curdepth == _this->gl_config.depth_size) &&
506 (gl_curstencil == this->gl_config.stencil_size) && 506 (gl_curstencil == _this->gl_config.stencil_size) &&
507 (gl_curaccum == newaccumsize)) { 507 (gl_curaccum == newaccumsize)) {
508 recreatecontext = 0; 508 recreatecontext = 0;
509 } 509 }
510 if (recreatecontext) { 510 if (recreatecontext) {
511 SDL_AtariGL_Quit(this, SDL_FALSE); 511 SDL_AtariGL_Quit(this, SDL_FALSE);
512 512
513 gl_ctx = 513 gl_ctx =
514 this->gl_data->OSMesaCreateContextExt(osmesa_format, 514 _this->gl_data->OSMesaCreateContextExt(osmesa_format,
515 this->gl_config. 515 _this->gl_config.
516 depth_size, 516 depth_size,
517 this->gl_config. 517 _this->gl_config.
518 stencil_size, 518 stencil_size,
519 newaccumsize, NULL); 519 newaccumsize, NULL);
520 520
521 if (gl_ctx) { 521 if (gl_ctx) {
522 gl_curformat = osmesa_format; 522 gl_curformat = osmesa_format;
523 gl_curdepth = this->gl_config.depth_size; 523 gl_curdepth = _this->gl_config.depth_size;
524 gl_curstencil = this->gl_config.stencil_size; 524 gl_curstencil = _this->gl_config.stencil_size;
525 gl_curaccum = newaccumsize; 525 gl_curaccum = newaccumsize;
526 } else { 526 } else {
527 gl_curformat = 0; 527 gl_curformat = 0;
528 gl_curdepth = 0; 528 gl_curdepth = 0;
529 gl_curstencil = 0; 529 gl_curstencil = 0;
541 GLenum osmesa_format; 541 GLenum osmesa_format;
542 SDL_PixelFormat *pixel_format; 542 SDL_PixelFormat *pixel_format;
543 Uint32 redmask; 543 Uint32 redmask;
544 int recreatecontext, tinygl_present; 544 int recreatecontext, tinygl_present;
545 545
546 if (this->gl_config.dll_handle) { 546 if (_this->gl_config.dll_handle) {
547 if (this->gl_data->OSMesaCreateLDG == NULL) { 547 if (_this->gl_data->OSMesaCreateLDG == NULL) {
548 return 0; 548 return 0;
549 } 549 }
550 } 550 }
551 551
552 /* TinyGL only supports VDI_RGB (OSMESA_RGB) */ 552 /* TinyGL only supports VDI_RGB (OSMESA_RGB) */
553 tinygl_present = 0; 553 tinygl_present = 0;
554 if (this->gl_config.dll_handle) { 554 if (_this->gl_config.dll_handle) {
555 if (this->gl_data->glFinish == NULL) { 555 if (_this->gl_data->glFinish == NULL) {
556 tinygl_present = 1; 556 tinygl_present = 1;
557 } 557 }
558 } 558 }
559 559
560 /* Init OpenGL context using OSMesa */ 560 /* Init OpenGL context using OSMesa */
656 } 656 }
657 } 657 }
658 break; 658 break;
659 default: 659 default:
660 if (tinygl_present) { 660 if (tinygl_present) {
661 SDL_AtariGL_Quit(this, SDL_FALSE); 661 SDL_AtariGL_Quit(_this, SDL_FALSE);
662 return 0; 662 return 0;
663 } 663 }
664 gl_pixelsize = 1; 664 gl_pixelsize = 1;
665 gl_copyshadow = CopyShadowDirect; 665 gl_copyshadow = CopyShadowDirect;
666 osmesa_format = OSMESA_COLOR_INDEX; 666 osmesa_format = OSMESA_COLOR_INDEX;
673 (gl_curformat == osmesa_format) && 673 (gl_curformat == osmesa_format) &&
674 (gl_curwidth == current->w) && (gl_curheight == current->h)) { 674 (gl_curwidth == current->w) && (gl_curheight == current->h)) {
675 recreatecontext = 0; 675 recreatecontext = 0;
676 } 676 }
677 if (recreatecontext) { 677 if (recreatecontext) {
678 SDL_AtariGL_Quit(this, SDL_FALSE); 678 SDL_AtariGL_Quit(_this, SDL_FALSE);
679 679
680 gl_shadow = 680 gl_shadow =
681 this->gl_data->OSMesaCreateLDG(osmesa_format, GL_UNSIGNED_BYTE, 681 _this->gl_data->OSMesaCreateLDG(osmesa_format, GL_UNSIGNED_BYTE,
682 current->w, current->h); 682 current->w, current->h);
683 683
684 if (gl_shadow) { 684 if (gl_shadow) {
685 gl_curformat = osmesa_format; 685 gl_curformat = osmesa_format;
686 gl_curwidth = current->w; 686 gl_curwidth = current->w;