changeset 13:e30a8ce27c22

Fixed double-mouse event bug on Windows using OpenGL
author Sam Lantinga <slouken@lokigames.com>
date Sun, 29 Apr 2001 23:00:03 +0000
parents 34d956b20f75
children c3e9d4a623c1
files docs.html src/video/wincommon/SDL_lowvideo.h src/video/wincommon/SDL_sysevents.c src/video/wincommon/SDL_sysmouse.c
diffstat 4 files changed, 14 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/docs.html	Sun Apr 29 22:59:47 2001 +0000
+++ b/docs.html	Sun Apr 29 23:00:03 2001 +0000
@@ -16,6 +16,7 @@
 Major changes since SDL 1.0.0:
 </H2>
 <UL>
+	<LI> 1.2.1: Fixed double-mouse event bug on Windows using OpenGL
 	<LI> 1.2.1: Fixed 320x200 video mode on framebuffer console
 	<LI> 1.2.1: Improved robustness for the ELO touchpad (thanks Alex!)
 	<LI> 1.2.1: Added support for building under Cygwin on Windows
--- a/src/video/wincommon/SDL_lowvideo.h	Sun Apr 29 22:59:47 2001 +0000
+++ b/src/video/wincommon/SDL_lowvideo.h	Sun Apr 29 23:00:03 2001 +0000
@@ -35,13 +35,19 @@
 /* Hidden "this" pointer for the video functions */
 #define _THIS	SDL_VideoDevice *this
 
-#define DIRECTX_FULLSCREEN() 						\
+#define DDRAW_FULLSCREEN() 						\
 (									\
 	((SDL_VideoSurface->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN) && \
 	((SDL_VideoSurface->flags & SDL_OPENGL    ) != SDL_OPENGL    ) && \
 	(strcmp(this->name, "directx") == 0)				\
 )
 
+#define DINPUT_FULLSCREEN() 						\
+(									\
+	((SDL_VideoSurface->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN) && \
+	(strcmp(this->name, "directx") == 0)				\
+)
+
 /* The main window -- and a function to set it for the audio */
 extern const char *SDL_Appname;
 extern HINSTANCE SDL_Instance;
--- a/src/video/wincommon/SDL_sysevents.c	Sun Apr 29 22:59:47 2001 +0000
+++ b/src/video/wincommon/SDL_sysevents.c	Sun Apr 29 23:00:03 2001 +0000
@@ -200,7 +200,7 @@
 		case WM_MOUSEMOVE: {
 			
 			/* Mouse is handled by DirectInput when fullscreen */
-			if ( SDL_VideoSurface && ! DIRECTX_FULLSCREEN() ) {
+			if ( SDL_VideoSurface && ! DINPUT_FULLSCREEN() ) {
 				Sint16 x, y;
 
 				/* mouse has entered the window */
@@ -243,7 +243,7 @@
 		case WM_MOUSELEAVE: {
 
 			/* Mouse is handled by DirectInput when fullscreen */
-			if ( SDL_VideoSurface && ! DIRECTX_FULLSCREEN() ) {
+			if ( SDL_VideoSurface && ! DINPUT_FULLSCREEN() ) {
 				/* mouse has left the window */
 				/* or */
 				/* Elvis has left the building! */
@@ -261,7 +261,7 @@
 		case WM_RBUTTONDOWN:
 		case WM_RBUTTONUP: {
 			/* Mouse is handled by DirectInput when fullscreen */
-			if ( SDL_VideoSurface && ! DIRECTX_FULLSCREEN() ) {
+			if ( SDL_VideoSurface && ! DINPUT_FULLSCREEN() ) {
 				Sint16 x, y;
 				Uint8 button, state;
 
--- a/src/video/wincommon/SDL_sysmouse.c	Sun Apr 29 22:59:47 2001 +0000
+++ b/src/video/wincommon/SDL_sysmouse.c	Sun Apr 29 23:00:03 2001 +0000
@@ -192,7 +192,7 @@
 	POINT mouse_pos;
 
 	/* The fullscreen cursor must be done in software with DirectInput */
-	if ( !this->screen || DIRECTX_FULLSCREEN() ) {
+	if ( !this->screen || DDRAW_FULLSCREEN() ) {
 		return(0);
 	}
 
@@ -213,7 +213,7 @@
 {
 	POINT pt;
 
-	if ( DIRECTX_FULLSCREEN() ) {
+	if ( DDRAW_FULLSCREEN() ) {
 		x += (this->screen->offset % this->screen->pitch) /
 		      this->screen->format->BytesPerPixel;
 		y += (this->screen->offset / this->screen->pitch);
@@ -237,7 +237,7 @@
 	RECT rect;
 	POINT pt;
 
-	if ( ! DIRECTX_FULLSCREEN() ) {
+	if ( ! DDRAW_FULLSCREEN() ) {
 		GetClientRect(SDL_Window, &rect);
 		GetCursorPos(&pt);
 		MapWindowPoints(NULL, SDL_Window, &pt, 1);