We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 278 - SDL_syswm struct under X11 does not give access to GFX_Display
Summary: SDL_syswm struct under X11 does not give access to GFX_Display
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: 1.2.11
Hardware: x86 Linux
: P2 enhancement
Assignee: Eric
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-12 01:48 UTC by Eric
Modified: 2006-09-23 20:07 UTC (History)
0 users

See Also:


Attachments
Adds GFX_Display to SysWMinfo structure (1.79 KB, patch)
2006-07-12 01:51 UTC, Eric
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric 2006-07-12 01:48:56 UTC
The struct only gives access the X connection for events. But it is useful to have access to the rendering connection so that opengl applications can do multithreaded rendering.
Comment 1 Eric 2006-07-12 01:51:51 UTC
Created attachment 146 [details]
Adds GFX_Display to SysWMinfo structure

Added a patch that exposes GFX_Display in the SysWMinfo structure
Comment 2 Eric 2006-07-12 01:54:45 UTC
Comment on attachment 146 [details]
Adds GFX_Display to SysWMinfo structure

Index: SDL-1.2/src/video/x11/SDL_x11wm.c
===================================================================
--- SDL-1.2/src/video/x11/SDL_x11wm.c	(revision 2615)
+++ SDL-1.2/src/video/x11/SDL_x11wm.c	(working copy)
@@ -398,6 +398,7 @@
 	XSync(SDL_Display, False);
 	SDL_Unlock_EventThread();
 }
+
 int X11_GetWMInfo(_THIS, SDL_SysWMinfo *info)
 {
 	if ( info->version.major <= SDL_MAJOR_VERSION ) {
@@ -410,6 +411,14 @@
 			info->info.x11.fswindow = FSwindow;
 			info->info.x11.wmwindow = WMwindow;
 		}
+
+
+		if ( SDL_VERSIONNUM(info->version.major,
+		                    info->version.minor,
+		                    info->version.patch) >= 1212 ) {
+			info->info.x11.gfxdisplay = GFX_Display;
+		}
+
 		info->info.x11.lock_func = lock_display;
 		info->info.x11.unlock_func = unlock_display;
 		return(1);
Index: SDL-1.2/include/SDL_syswm.h
===================================================================
--- SDL-1.2/include/SDL_syswm.h	(revision 2615)
+++ SDL-1.2/include/SDL_syswm.h	(working copy)
@@ -86,7 +86,8 @@
 	    	Display *display;	/* The X11 display */
 	    	Window window;		/* The X11 display window */
 		/* These locking functions should be called around
-                   any X11 functions using the display variable.
+                   any X11 functions using the display variable, 
+                   but not the gfxdisplay variable.
                    They lock the event thread, so should not be
 		   called around event functions or from event filters.
 		 */
@@ -96,6 +97,9 @@
 		/* Introduced in SDL 1.0.2 */
 	    	Window fswindow;	/* The X11 fullscreen window */
 	    	Window wmwindow;	/* The X11 managed input window */
+
+		/* Introduced in SDL 1.2.11 */
+		Display *gfxdisplay; /*The X11 display to which rendering is done */
 	    } x11;
 	} info;
 } SDL_SysWMinfo;
Comment 3 Sam Lantinga 2006-09-23 20:07:54 UTC
this is in subversion, thanks!