/[pcsx2_0.9.7]/trunk/3rdparty/SDL-1.3.0-5387/test/testnativex11.c
ViewVC logotype

Contents of /trunk/3rdparty/SDL-1.3.0-5387/test/testnativex11.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 401 - (show annotations) (download)
Fri Feb 25 17:31:09 2011 UTC (9 years, 9 months ago) by william
File MIME type: text/plain
File size: 753 byte(s)
Auto Commited Import of: pcsx2-0.9.7-DEBUG (upstream: v0.9.7.4358 local: v0.9.7.313-latest) in ./trunk
1
2 #include "testnative.h"
3
4 #ifdef TEST_NATIVE_X11
5
6 static void *CreateWindowX11(int w, int h);
7 static void DestroyWindowX11(void *window);
8
9 NativeWindowFactory X11WindowFactory = {
10 "x11",
11 CreateWindowX11,
12 DestroyWindowX11
13 };
14
15 static Display *dpy;
16
17 static void *
18 CreateWindowX11(int w, int h)
19 {
20 Window window = 0;
21
22 dpy = XOpenDisplay(NULL);
23 if (dpy) {
24 window =
25 XCreateSimpleWindow(dpy, DefaultRootWindow(dpy), 0, 0, w, h, 0, 0,
26 0);
27 XMapRaised(dpy, window);
28 XSync(dpy, False);
29 }
30 return (void *) window;
31 }
32
33 static void
34 DestroyWindowX11(void *window)
35 {
36 if (dpy) {
37 XDestroyWindow(dpy, (Window) window);
38 XCloseDisplay(dpy);
39 }
40 }
41
42 #endif

  ViewVC Help
Powered by ViewVC 1.1.22