SDL  2.0
testnativex11.c
Go to the documentation of this file.
1 /*
2  Copyright (C) 1997-2020 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 
33  dpy = XOpenDisplay(NULL);
34  if (dpy) {
35  window =
36  XCreateSimpleWindow(dpy, DefaultRootWindow(dpy), 0, 0, w, h, 0, 0,
37  0);
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
XMapRaised
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 int int int return Display long XVisualInfo int return Display Window Atom long long Bool Atom Atom int unsigned long unsigned long unsigned char return Display Window XSizeHints long return Display Window Bool int int Time return Display return Display KeySym return Display Colormap return Display int return XKeyEvent int retur XMapRaised)
Definition: SDL_x11sym.h:96
NULL
#define NULL
Definition: begin_code.h:167
dpy
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display dpy)
Definition: SDL_x11sym.h:44
h
GLfloat GLfloat GLfloat GLfloat h
Definition: SDL_opengl_glext.h:1949
XDestroyWindow
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
XSync
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 int int int return Display long XVisualInfo int return Display Window Atom long long Bool Atom Atom int unsigned long unsigned long unsigned char return Display Window XSizeHints long return Display Window Bool int int Time return Display return Display KeySym return Display Colormap return Display int return XKeyEvent int return Display Window return Display _Xconst char return Display XEvent return return Display return Display char return Display Window return Display return Display Window long return XErrorHandler return XIOErrorHandler return Display Atom Window Time return Display Window XTextProperty Atom Display Window XTextProperty XTextProperty char int XSizeHints XWMHints XClassHint Display Window Atom int return Display Window _Xconst char retur XSync)
Definition: SDL_x11sym.h:128
window
EGLSurface EGLNativeWindowType * window
Definition: eglext.h:1025
XCloseDisplay
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer retur XCloseDisplay)
Definition: SDL_x11sym.h:42
testnative.h
w
GLubyte GLubyte GLubyte GLubyte w
Definition: SDL_opengl_glext.h:734
NativeWindowFactory
Definition: testnative.h:23