libgoatvr

view src/opengl.c @ 28:5136dfcea7b1

ported to OVR 0.5.0.1
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 06 Apr 2015 05:17:11 +0300
parents d12592558809
children 1a8343ea54ce
line source
1 #include "opengl.h"
3 #ifdef __unix__
4 void vrimp_swap_buffers(void)
5 {
6 Display *dpy = glXGetCurrentDisplay();
7 Drawable win = glXGetCurrentDrawable();
8 glXSwapBuffers(dpy, win);
9 }
11 void (*vrimp_glfunc(const char *name))()
12 {
13 return glXGetProcAddress((const unsigned char*)name);
14 }
15 #endif /* __unix__ */
17 #ifdef WIN32
18 void vrimp_swap_buffers(void)
19 {
20 HDC dc = wglGetCurrentDC();
21 SwapBuffers(dc);
22 }
24 void (*vrimp_glfunc(const char *name))()
25 {
26 return (void (*)())wglGetProcAddress(name);
27 }
28 #endif /* WIN32 */
30 #ifdef __APPLE__
31 void vrimp_swap_buffers(void)
32 {
33 /* TODO: I don't think this can even be done without obj-c and a pointer
34 * to a GLView class or whatever the fuck it's called... investigate further
35 */
36 }
39 void (*vrimp_glfunc(const char *name))()
40 {
41 /* TODO: whatever */
42 return 0;
43 }
44 #endif /* __APPLE__ */