libgoatvr

view src/opengl.c @ 19:437fe32ac633

ops... wasn't handling the stereo eye separation correctly. also fixed a bug in vr_libovr.c causing an assertion inside LibOVR when ovrHmd_GetEyePose was called as a result of calls to view_rotation or view_translation outside of vr_begin/vr_end
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 04 Oct 2014 03:39:14 +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__ */