static int api_gl_version;
static void
-_clean_overrides()
+_clean_overrides(GLboolean init_egl, GLboolean init_gl)
{
#define _COREGL_START_API(version) api_gl_version = version;
#define _COREGL_END_API(version) api_gl_version = COREGL_GLAPI_2;
COREGL_OVERRIDE_API(ovr_, f, _sym_)
#define _COREGL_SYMBOL(RET_TYPE, FUNC_NAME, PARAM_LIST) OVERRIDE(FUNC_NAME);
-# include "headers/sym_egl.h"
+ if(init_egl == GL_TRUE) {
+ # include "headers/sym_egl.h"
+ }
#undef _COREGL_SYMBOL
#undef OVERRIDE
#define OVERRIDE(f) \
if(api_gl_version<=driver_gl_version) COREGL_OVERRIDE_API(ovr_, f, _sym_)
#define _COREGL_SYMBOL(RET_TYPE, FUNC_NAME, PARAM_LIST) OVERRIDE(FUNC_NAME);
-if(driver_gl_version == COREGL_GLAPI_1) {
- #include "headers/sym_gl1.h"
- #include "headers/sym_gl_common.h"
-}
-else if(driver_gl_version >= COREGL_GLAPI_2) {
- #include "headers/sym_gl2.h"
- #include "headers/sym_gl_common.h"
-}
+ if(init_gl == GL_TRUE) {
+ #include "headers/sym_gl1.h"
+ #include "headers/sym_gl2.h"
+ #include "headers/sym_gl_common.h"
+ }
#undef _COREGL_SYMBOL
-
#undef OVERRIDE
+
#undef _COREGL_START_API
#undef _COREGL_END_API
}
void
-init_export()
+init_export(GLboolean init_egl, GLboolean init_gl)
{
- _clean_overrides();
+ _clean_overrides(init_egl, init_gl);
}
extern int export_initialized;
extern int driver_gl_version;
+extern int current_gl_api_version;
-extern void init_export();
+extern void init_export(GLboolean init_egl, GLboolean init_gl);
extern void clean_overrides();
#endif // COREGL_EXPORT_H
General_Trace_List *glue_ctx_trace_list = NULL;
General_Trace_List *context_state_trace_list = NULL;
+int current_gl_api_version = 0;
static void
_dump_context_info(const char *ment, int force_output)
goto finish;
}
+ current_gl_api_version = ((EGL_packed_option *)gctx->real_ctx_option)->attrib_list.context_major_version;
+ if(current_gl_api_version == COREGL_GLAPI_1)
+ init_export(GL_FALSE, GL_TRUE);
+
// Update references only when the contexts are different
if (tstate->cstate != gctx->cstate) {
if (tstate->cstate != NULL && tstate->cstate->data != NULL)