diff src/video/bwindow/SDL_sysvideo.cc @ 3878:678576473849 SDL-1.2

Fixed bug #286 Date: Thu, 9 Feb 2006 17:06:51 +0300 From: "Oleg K [BeSman]" Subject: BeOS SDL patches Hello all. My name is Oleg K. [BeSman], Im a BeOS user from Russia.This mail contain a BeOs-specific patches to SDL (implementation of InputGrabbing and mouse_relative mode). See the source in attached file for details.
author Sam Lantinga <slouken@libsdl.org>
date Sun, 24 Sep 2006 15:31:42 +0000
parents 3a8920cc822b
children 4e29535b821b
line wrap: on
line diff
--- a/src/video/bwindow/SDL_sysvideo.cc	Sun Sep 24 01:27:40 2006 +0000
+++ b/src/video/bwindow/SDL_sysvideo.cc	Sun Sep 24 15:31:42 2006 +0000
@@ -135,7 +135,7 @@
 	device->SetCaption = BE_SetWMCaption;
 	device->SetIcon = NULL;
 	device->IconifyWindow = BE_IconifyWindow;
-	device->GrabInput = NULL;
+	device->GrabInput = BE_GrabInput;
 	device->GetWMInfo = BE_GetWMInfo;
 	/* Cursor manager functions */
 	device->FreeWMCursor = BE_FreeWMCursor;
@@ -143,7 +143,7 @@
 	device->ShowWMCursor = BE_ShowWMCursor;
 	device->WarpWMCursor = BE_WarpWMCursor;
 	device->MoveWMCursor = NULL;
-	device->CheckMouseMode = NULL;
+	device->CheckMouseMode = BE_CheckMouseMode;
 	/* Event manager functions */
 	device->InitOSKeymap = BE_InitOSKeymap;
 	device->PumpEvents = BE_PumpEvents;
@@ -365,8 +365,11 @@
 	if ( ! modes[i] || (modes[i]->w < width) || (modes[i]->h < width) ) {
 		--i;	/* We went too far */
 	}
-	width = modes[i]->w;
-	height = modes[i]->h;      
+
+/*  BeSman::We dont want to use a Desktop resolution */
+//	width = modes[i]->w;
+//	height = modes[i]->h;      
+
 	bscreen.GetModeList(&dmodes, &nmodes);
 	for ( i = 0; i < nmodes; ++i ) {
 		if ( (bpp == ColorSpaceToBitsPerPixel(dmodes[i].space)) &&
@@ -433,7 +436,7 @@
 	}
 
 	if ( SDL_Win->Lock() ) {
-		int xoff, yoff;
+		int cx, cy;
 		if ( SDL_Win->Shown() ) {
 			needs_unlock = 1;
 			SDL_Win->Hide();
@@ -449,19 +452,12 @@
 		/* Calculate offsets - used either to center window
 		 * (windowed mode) or to set drawing offsets (fullscreen mode)
 		 */
-		xoff = (bounds.IntegerWidth() - width)/2;
-		yoff = (bounds.IntegerHeight() - height)/2;
-		if ( fullscreen ) {
-			/* Set offset for drawing */
-			SDL_Win->SetXYOffset(xoff, yoff);
-		} else {
-			/* Center window and reset the drawing offset */
-			SDL_Win->SetXYOffset(0, 0);
-		}
+		cx = (bounds.IntegerWidth() - width)/2;
+		cy = (bounds.IntegerHeight() - height)/2;
+
 		if ( ! needs_unlock || was_fullscreen ) {
 			/* Center the window the first time */
-			SDL_Win->MoveTo(xoff > 0 ? (float)xoff : 0.0f,
-					yoff > 0 ? (float)yoff : 0.0f);
+			SDL_Win->MoveTo(cx, cy);
 		}
 		SDL_Win->Show();