libgoatvr

annotate src/opengl.c @ 15:27fcd4c2969d

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