glx_link_call_srcs = \
$(dir)/glx-link-call.c \
- $(dir)/util.c
+ $(dir)/util-x11.c
glx_link_call_modules = $(glx_link_call_srcs:.c=.o)
glx_link_gpa_srcs = \
$(dir)/glx-link-gpa.c \
- $(dir)/util.c
+ $(dir)/util-x11.c
glx_link_gpa_modules = $(glx_link_gpa_srcs:.c=.o)
glx_link_gpaa_srcs = \
$(dir)/glx-link-gpaa.c \
- $(dir)/util.c
+ $(dir)/util-x11.c
glx_link_gpaa_modules = $(glx_link_gpaa_srcs:.c=.o)
glx_dlopen_dlsym_srcs = \
$(dir)/glx-dlopen-dlsym.c \
- $(dir)/util.c
+ $(dir)/util-x11.c
glx_dlopen_dlsym_modules = $(glx_dlopen_dlsym_srcs:.c=.o)
glx_dlopen_gpa_srcs = \
$(dir)/glx-dlopen-gpa.c \
- $(dir)/util.c
+ $(dir)/util-x11.c
glx_dlopen_gpa_modules = $(glx_dlopen_gpa_srcs:.c=.o)
glx_dlopen_gpaa_srcs = \
$(dir)/glx-dlopen-gpaa.c \
- $(dir)/util.c
+ $(dir)/util-x11.c
glx_dlopen_gpaa_modules = $(glx_dlopen_gpaa_srcs:.c=.o)
#include <stdlib.h>
#include <dlfcn.h>
-#include "util.h"
+#include "util-x11.h"
void (*my_glClear) (GLbitfield);
void (*my_glClearColor) (GLclampf, GLclampf, GLclampf, GLclampf);
Display *dpy;
Window window;
- util_init_display_window (&dpy, &window);
+ util_x11_init_display (&dpy);
+
+ util_x11_init_window (dpy, &window);
resolve_symbols ();
handle_events (dpy, window);
- util_fini_display_window (dpy, window);
+ util_x11_fini_window (dpy, window);
+
+ util_x11_fini_display (dpy);
return 0;
}
#include <stdlib.h>
#include <dlfcn.h>
-#include "util.h"
+#include "util-x11.h"
void* (*my_glXGetProcAddress) (char *);
void (*my_glClear) (GLbitfield);
Display *dpy;
Window window;
- util_init_display_window (&dpy, &window);
+ util_x11_init_display (&dpy);
+
+ util_x11_init_window (dpy, &window);
resolve_symbols ();
handle_events (dpy, window);
- util_fini_display_window (dpy, window);
+ util_x11_fini_window (dpy, window);
+
+ util_x11_fini_display (dpy);
return 0;
}
#include <stdlib.h>
#include <dlfcn.h>
-#include "util.h"
+#include "util-x11.h"
void* (*my_glXGetProcAddressARB) (char *);
void (*my_glClear) (GLbitfield);
Display *dpy;
Window window;
- util_init_display_window (&dpy, &window);
+ util_x11_init_display (&dpy);
+
+ util_x11_init_window (dpy, &window);
resolve_symbols ();
handle_events (dpy, window);
- util_fini_display_window (dpy, window);
+ util_x11_fini_window (dpy, window);
+
+ util_x11_fini_display (dpy);
return 0;
}
#include <GL/gl.h>
#include <GL/glx.h>
-#include "util.h"
+#include "util-x11.h"
#define HANDLE_EVENTS_GL_PREFIX
#include "handle-events.c"
Display *dpy;
Window window;
- util_init_display_window (&dpy, &window);
+ util_x11_init_display (&dpy);
+
+ util_x11_init_window (dpy, &window);
handle_events (dpy, window);
- util_fini_display_window (dpy, window);
+ util_x11_fini_window (dpy, window);
+
+ util_x11_fini_display (dpy);
return 0;
}
#include <stdio.h>
#include <stdlib.h>
-#include "util.h"
+#include "util-x11.h"
/* The OpenGL header files give typedefs for the types of all
* functions provided by etensisons. Here, though, we're using
Display *dpy;
Window window;
- util_init_display_window (&dpy, &window);
+ util_x11_init_display (&dpy);
+
+ util_x11_init_window (dpy, &window);
resolve_symbols ();
handle_events (dpy, window);
- util_fini_display_window (dpy, window);
+ util_x11_fini_window (dpy, window);
+
+ util_x11_fini_display (dpy);
return 0;
}
#include <stdio.h>
#include <stdlib.h>
-#include "util.h"
+#include "util-x11.h"
/* The OpenGL header files give typedefs for the types of all
* functions provided by etensisons. Here, though, we're using
Display *dpy;
Window window;
- util_init_display_window (&dpy, &window);
+ util_x11_init_display (&dpy);
+
+ util_x11_init_window (dpy, &window);
resolve_symbols ();
handle_events (dpy, window);
- util_fini_display_window (dpy, window);
+ util_x11_fini_window (dpy, window);
+
+ util_x11_fini_display (dpy);
return 0;
}
--- /dev/null
+/* Copyright © 2013, Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "util-x11.h"
+
+void
+util_x11_init_display (Display **dpy)
+{
+ *dpy = XOpenDisplay (NULL);
+
+ if (*dpy == NULL) {
+ fprintf(stderr, "Failed to open display %s\n",
+ XDisplayName(NULL));
+ exit (1);
+ }
+}
+
+void
+util_x11_fini_display (Display *dpy)
+{
+ XCloseDisplay (dpy);
+}
+
+void
+util_x11_init_window (Display *dpy, Window *window)
+{
+ int width = 64;
+ int height = 64;
+
+
+
+ *window = XCreateSimpleWindow(dpy, DefaultRootWindow (dpy),
+ 0, 0, width, height, 0,
+ BlackPixel (dpy, DefaultScreen (dpy)),
+ BlackPixel (dpy, DefaultScreen (dpy)));
+
+ XSelectInput(dpy, *window,
+ KeyPressMask | StructureNotifyMask | ExposureMask);
+
+ XMapWindow (dpy, *window);
+
+}
+
+void
+util_x11_fini_window (Display *dpy, Window window)
+{
+ XDestroyWindow (dpy, window);
+}
--- /dev/null
+/* Copyright © 2013, Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#ifndef UTIL_X11_H
+#define UTIL_X11_H
+
+#include <X11/Xlib.h>
+
+void
+util_x11_init_display (Display **dpy);
+
+void
+util_x11_fini_display (Display *dpy);
+
+void
+util_x11_init_window (Display *dpy, Window *window);
+
+void
+util_x11_fini_window (Display *dpy, Window window);
+
+#endif /* UTIL_X11_H */
+
+
+
+++ /dev/null
-/* Copyright © 2013, Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "util.h"
-
-void
-util_init_display_window (Display **dpy, Window *window)
-{
- int width = 64;
- int height = 64;
-
- *dpy = XOpenDisplay (NULL);
-
- if (*dpy == NULL) {
- fprintf(stderr, "Failed to open display %s\n",
- XDisplayName(NULL));
- exit (1);
- }
-
- *window = XCreateSimpleWindow(*dpy, DefaultRootWindow (*dpy),
- 0, 0, width, height, 0,
- BlackPixel (*dpy, DefaultScreen (*dpy)),
- BlackPixel (*dpy, DefaultScreen (*dpy)));
-
- XSelectInput(*dpy, *window,
- KeyPressMask | StructureNotifyMask | ExposureMask);
-
- XMapWindow (*dpy, *window);
-
-}
-
-void
-util_fini_display_window (Display *dpy, Window window)
-{
- XDestroyWindow (dpy, window);
- XCloseDisplay (dpy);
-}
+++ /dev/null
-/* Copyright © 2013, Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-#ifndef UTIL_H
-#define UTIL_H
-
-#include <X11/Xlib.h>
-
-void
-util_init_display_window (Display **dpy, Window *window);
-
-void
-util_fini_display_window (Display *dpy, Window window);
-
-#endif /* UTIL_H */
-
-
-