libgoatvr

view src/opengl.c @ 9:d12592558809

build on macosx
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 20 Sep 2014 16:52:42 +0300
parents 3d9ec6fe97d7
children 61feb3661397
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 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__ */