comparison src/video/gem/SDL_gemvideo.c @ 991:12b13601a544

Final touches to OSMesa OpenGL support on Atari, using loadable libraries. Hope SDL 1.2.8 is out soon.
author Patrice Mandin <patmandin@gmail.com>
date Fri, 26 Nov 2004 16:16:50 +0000
parents 475166d13b44
children 0324ce32b2d9
comparison
equal deleted inserted replaced
990:8e20c48a9c13 991:12b13601a544
311 /* Read version and features */ 311 /* Read version and features */
312 GEM_version = aes_global[0]; 312 GEM_version = aes_global[0];
313 if (GEM_version >= 0x0410) { 313 if (GEM_version >= 0x0410) {
314 short ap_gout[4], errorcode; 314 short ap_gout[4], errorcode;
315 315
316 #ifdef DEBUG_VIDEO_GEM
317 printf("sdl:video:gem: AES %02x.%02x\n", (GEM_version>>8) & 0xff, GEM_version & 0xff);
318 #endif
319
320 GEM_wfeatures=0; 316 GEM_wfeatures=0;
321 errorcode=appl_getinfo(AES_WINDOW, &ap_gout[0], &ap_gout[1], &ap_gout[2], &ap_gout[3]); 317 errorcode=appl_getinfo(AES_WINDOW, &ap_gout[0], &ap_gout[1], &ap_gout[2], &ap_gout[3]);
322 #ifdef DEBUG_VIDEO_GEM
323 printf("sdl:video:gem: appl_getinfo() returned 0x%04x\n", errorcode);
324 #endif
325 318
326 if (errorcode==0) { 319 if (errorcode==0) {
327 GEM_wfeatures=ap_gout[0]; 320 GEM_wfeatures=ap_gout[0];
328
329 #ifdef DEBUG_VIDEO_GEM
330 printf("sdl:video:gem: AES wind_*() modes: 0x%04x\n", GEM_wfeatures);
331 printf("sdl:video:gem: AES window behaviours: 0x%04x\n", ap_gout[3]);
332 } else {
333 printf("sdl:video:gem: apgout[]={0x%04x,0x%04x,0x%04x,0x%04x}\n",
334 ap_gout[0], ap_gout[1], ap_gout[1], ap_gout[3]
335 );
336 #endif
337 } 321 }
338 } 322 }
339 323
340 /* Ask VDI physical workstation handle opened by AES */ 324 /* Ask VDI physical workstation handle opened by AES */
341 VDI_handle = graf_handle(&dummy, &dummy, &dummy, &dummy); 325 VDI_handle = graf_handle(&dummy, &dummy, &dummy, &dummy);
466 SDL_modelist[0]->w = VDI_w; 450 SDL_modelist[0]->w = VDI_w;
467 SDL_modelist[0]->h = VDI_h; 451 SDL_modelist[0]->h = VDI_h;
468 452
469 SDL_modelist[1] = NULL; 453 SDL_modelist[1] = NULL;
470 454
471 #ifdef DEBUG_VIDEO_GEM 455 #ifdef HAVE_OPENGL
472 printf("sdl:video:gem: VideoInit(): done\n"); 456 SDL_AtariGL_InitPointers(this);
473 #endif 457 #endif
474 458
475 /* We're done! */ 459 /* We're done! */
476 return(0); 460 return(0);
477 } 461 }
490 } 474 }
491 475
492 static void GEM_FreeBuffers(_THIS) 476 static void GEM_FreeBuffers(_THIS)
493 { 477 {
494 #ifdef HAVE_OPENGL 478 #ifdef HAVE_OPENGL
495 SDL_AtariGL_Quit(this); 479 if (gl_active) {
480 SDL_AtariGL_Quit(this);
481 }
496 #endif 482 #endif
497 483
498 /* Release buffer */ 484 /* Release buffer */
499 if ( GEM_buffer2 ) { 485 if ( GEM_buffer2 ) {
500 free( GEM_buffer2 ); 486 free( GEM_buffer2 );
1288 1274
1289 #ifdef HAVE_OPENGL 1275 #ifdef HAVE_OPENGL
1290 1276
1291 static void GEM_GL_SwapBuffers(_THIS) 1277 static void GEM_GL_SwapBuffers(_THIS)
1292 { 1278 {
1293 if (gl_ctx == NULL) { 1279 if (gl_active) {
1294 return; 1280 gl_copyshadow(this, this->screen);
1295 } 1281 gl_convert(this, this->screen);
1296 1282 GEM_FlipHWSurface(this, this->screen);
1297 gl_convert(this->screen); 1283 }
1298 GEM_FlipHWSurface(this, this->screen); 1284 }
1299 } 1285
1300 1286 #endif
1301 #endif