comparison src/video/photon/SDL_ph_video.c @ 283:3d8b6b9f1e18

Date: Mon, 18 Feb 2002 16:46:59 +1200 From: Julian Kinraid <jkinraid@clear.net.nz> Subject: Patches for photon port of SDL Hi, A couple more patches for photon and the nto audio. Adds mouse grabbing support, fixed cursor images, unicode keyboard events (though no unicode data on kye release, is that a problem?), hopefully fixing some audio lag problems, and a few other fixes. Thanks, Julian Kinraid
author Sam Lantinga <slouken@libsdl.org>
date Wed, 20 Feb 2002 01:05:51 +0000
parents 04351f59b051
children 68a8a8237c09
comparison
equal deleted inserted replaced
282:b42d80e73896 283:3d8b6b9f1e18
109 device->FlipHWSurface = ph_FlipHWSurface; 109 device->FlipHWSurface = ph_FlipHWSurface;
110 device->FreeHWSurface = ph_FreeHWSurface; 110 device->FreeHWSurface = ph_FreeHWSurface;
111 device->SetCaption = ph_SetCaption; 111 device->SetCaption = ph_SetCaption;
112 device->SetIcon = NULL; 112 device->SetIcon = NULL;
113 device->IconifyWindow = ph_IconifyWindow; 113 device->IconifyWindow = ph_IconifyWindow;
114 device->GrabInput = NULL; 114 device->GrabInput = ph_GrabInput;
115 device->GetWMInfo = NULL; 115 device->GetWMInfo = NULL;
116 device->FreeWMCursor = ph_FreeWMCursor; 116 device->FreeWMCursor = ph_FreeWMCursor;
117 device->CreateWMCursor = ph_CreateWMCursor; 117 device->CreateWMCursor = ph_CreateWMCursor;
118 device->ShowWMCursor = ph_ShowWMCursor; 118 device->ShowWMCursor = ph_ShowWMCursor;
119 device->WarpWMCursor = ph_WarpWMCursor; 119 device->WarpWMCursor = ph_WarpWMCursor;
327 fprintf(stderr,"error: PgSetVideoMode failed\n"); 327 fprintf(stderr,"error: PgSetVideoMode failed\n");
328 } 328 }
329 329
330 /* Get the true height and width */ 330 /* Get the true height and width */
331 331
332 current->flags = (flags|(~SDL_RESIZABLE)); /* no resize for Direct Context */ 332 current->flags = (flags & (~SDL_RESIZABLE)); /* no resize for Direct Context */
333 333
334 /* Begin direct mode */ 334 /* Begin direct mode */
335 ph_EnterFullScreen(this); 335 ph_EnterFullScreen(this);
336 336
337 337
340 else 340 else
341 { 341 {
342 if (flags & SDL_HWSURFACE) /* Use offscreen memory iff SDL_HWSURFACE flag is set */ 342 if (flags & SDL_HWSURFACE) /* Use offscreen memory iff SDL_HWSURFACE flag is set */
343 { 343 {
344 /* Hardware surface is Offsceen Context. ph_ResizeImage handles the switch */ 344 /* Hardware surface is Offsceen Context. ph_ResizeImage handles the switch */
345 current->flags = (flags|(~SDL_RESIZABLE)); /* no stretch blit in offscreen context */ 345 current->flags = (flags & (~SDL_RESIZABLE)); /* no stretch blit in offscreen context */
346 } 346 }
347 else /* must be SDL_SWSURFACE */ 347 else /* must be SDL_SWSURFACE */
348 { 348 {
349 current->flags = (flags|SDL_RESIZABLE); /* yes we can resize as this is a software surface */ 349 current->flags = (flags | SDL_RESIZABLE); /* yes we can resize as this is a software surface */
350 } 350 }
351 351
352 #ifdef HAVE_OPENGL 352 #ifdef HAVE_OPENGL
353 if (flags & SDL_OPENGL) /* for now support OpenGL in window mode only */ 353 if (flags & SDL_OPENGL) /* for now support OpenGL in window mode only */
354 { 354 {
413 return(current); 413 return(current);
414 } 414 }
415 415
416 static void ph_VideoQuit(_THIS) 416 static void ph_VideoQuit(_THIS)
417 { 417 {
418 if (SDL_Image != NULL) 418 ph_DestroyImage(this, SDL_VideoSurface);
419 {
420 ph_DestroyImage(this, SDL_VideoSurface);
421 }
422 419
423 if (currently_fullscreen) 420 if (currently_fullscreen)
424 { 421 {
425 PdDirectStop( directContext ); 422 PdDirectStop( directContext );
426 PdReleaseDirectContext( directContext ); 423 PdReleaseDirectContext( directContext );