From ba602e2e5c0ee369ca7fb4f39de03b6eb794bb44 Mon Sep 17 00:00:00 2001 From: espes Date: Thu, 18 Apr 2013 14:43:24 +1000 Subject: [PATCH] Don't see the point of exporting glo_init for now --- gl/gloffscreen.h | 9 --------- gl/gloffscreen_cgl.c | 41 ----------------------------------------- gl/gloffscreen_wgl.c | 8 ++------ 3 files changed, 2 insertions(+), 56 deletions(-) diff --git a/gl/gloffscreen.h b/gl/gloffscreen.h index 78c2402290..aab40babab 100644 --- a/gl/gloffscreen.h +++ b/gl/gloffscreen.h @@ -60,18 +60,9 @@ typedef struct _GloContext GloContext; /* The only currently supported format */ #define GLO_FF_DEFAULT (GLO_FF_BITS_24|GLO_FF_DEPTH_24) -/* Has gloffscreen been previously initialised? */ -extern int glo_initialised(void); - -/* Initialise gloffscreen */ -extern void glo_init(void); - /* Change current context */ extern void glo_set_current(GloContext *context); -/* Uninitialise gloffscreen */ -extern void glo_kill(void); - /* Check GL Extensions */ extern GLboolean glo_check_extension( const GLubyte *extName, const GLubyte *extString); diff --git a/gl/gloffscreen_cgl.c b/gl/gloffscreen_cgl.c index 3e49ee2cfd..02c3a5e10b 100644 --- a/gl/gloffscreen_cgl.c +++ b/gl/gloffscreen_cgl.c @@ -33,48 +33,10 @@ #include "gloffscreen.h" -/* In Windows, you must create a window *before* you can create a pbuffer or - * get a context. So we create a hidden Window on startup(see glo_init/GloMain). - * - * Also, you can't share contexts that have different pixel formats, so we can't - * just create a new context from the window. We must create a whole new PBuffer - * just for a context :( - */ - -struct GloMain { - int init; - /* Not needed for CGL? */ -}; - -struct GloMain glo; -int glo_inited = 0; - struct _GloContext { CGLContextObj cglContext; }; -int glo_initialised(void) { - return glo_inited; -} - -/* Initialise gloffscreen */ -void glo_init(void) { - /* TODO: CGL Implementation. - * Initialization needed for CGL? */ - - if (glo_inited) { - printf( "gloffscreen already inited\n" ); - exit( EXIT_FAILURE ); - } - - glo_inited = 1; -} - -/* Uninitialise gloffscreen */ -void glo_kill(void) { - glo_inited = 0; -} - /* Create an OpenGL context for a certain pixel format. formatflags are from * the GLO_ constants */ GloContext *glo_context_create(int formatFlags) @@ -96,9 +58,6 @@ GloContext *glo_context_create(int formatFlags) CGLCreateContext(pix, NULL, &context->cglContext); CGLDestroyPixelFormat(pix); - if (!glo_inited) - glo_init(); - glo_set_current(context); return context; diff --git a/gl/gloffscreen_wgl.c b/gl/gloffscreen_wgl.c index f1c8251bf7..cae32a0f67 100644 --- a/gl/gloffscreen_wgl.c +++ b/gl/gloffscreen_wgl.c @@ -78,12 +78,8 @@ PFNWGLRELEASEPBUFFERDCARBPROC wglReleasePbufferDCARB; PFNWGLCREATEPBUFFERARBPROC wglCreatePbufferARB; PFNWGLDESTROYPBUFFERARBPROC wglDestroyPbufferARB; -int glo_initialised(void) { - return glo_inited; -} - /* Initialise gloffscreen */ -void glo_init(void) { +static void glo_init(void) { WNDCLASSEX wcx; PIXELFORMATDESCRIPTOR pfd; @@ -172,7 +168,7 @@ void glo_init(void) { } /* Uninitialise gloffscreen */ -void glo_kill(void) { +static void glo_kill(void) { if (glo.hContext) { wglMakeCurrent(NULL, NULL); wglDeleteContext(glo.hContext);