mirror of https://github.com/xemu-project/xemu.git
Don't see the point of exporting glo_init for now
This commit is contained in:
parent
deaab6228f
commit
ba602e2e5c
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue