SDL  2.0
testnativex11.c
Go to the documentation of this file.
1 /*
2  Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
3 
4  This software is provided 'as-is', without any express or implied
5  warranty. In no event will the authors be held liable for any damages
6  arising from the use of this software.
7 
8  Permission is granted to anyone to use this software for any purpose,
9  including commercial applications, and to alter it and redistribute it
10  freely.
11 */
12 
13 #include "testnative.h"
14 
15 #ifdef TEST_NATIVE_X11
16 
17 static void *CreateWindowX11(int w, int h);
18 static void DestroyWindowX11(void *window);
19 
20 NativeWindowFactory X11WindowFactory = {
21  "x11",
22  CreateWindowX11,
23  DestroyWindowX11
24 };
25 
26 static Display *dpy;
27 
28 static void *
29 CreateWindowX11(int w, int h)
30 {
31  Window window = 0;
32 
34  if (dpy) {
35  window =
36  XCreateSimpleWindow(dpy, DefaultRootWindow(dpy), 0, 0, w, h, 0, 0,
37  0);
38  XMapRaised(dpy, window);
39  XSync(dpy, False);
40  }
41  return (void *) window;
42 }
43 
44 static void
45 DestroyWindowX11(void *window)
46 {
47  if (dpy) {
48  XDestroyWindow(dpy, (Window) window);
50  }
51 }
52 
53 #endif
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display dpy)
Definition: SDL_x11sym.h:44
GLfloat GLfloat GLfloat GLfloat h
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer retur XCloseDisplay)
Definition: SDL_x11sym.h:42
GLubyte GLubyte GLubyte GLubyte w
#define NULL
Definition: begin_code.h:164
EGLSurface EGLNativeWindowType * window
Definition: eglext.h:1025
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int int int return Display Window Cursor retur XDestroyWindow)
Definition: SDL_x11sym.h:54
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int int int return Display Window Cursor return Display Window return Display Drawable GC int int unsigned int unsigned int return Display Drawable GC int int _Xconst char int return Display Drawable GC int int unsigned int unsigned int return Display return Display Cursor return Display GC return XModifierKeymap return char Display Window int return Display return Display Atom return Display Window XWindowAttributes return Display Window return Display XEvent Bool(*) XPointer return Display Window Bool unsigned int int int Window Cursor Time return Display Window int return KeySym return Display _Xconst char Bool return Display _Xconst char return XKeyEvent char int KeySym XComposeStatus return Display int int int XVisualInfo return Display Window int int retur XOpenDisplay)
Definition: SDL_x11sym.h:100