Update GLSM

This commit is contained in:
twinaphex 2018-10-06 15:40:48 +02:00
parent 22424fce0f
commit f1e7e0c5f7
2 changed files with 10 additions and 10 deletions

View File

@ -2800,10 +2800,8 @@ static bool glsm_state_ctx_destroy(void *data)
return true; return true;
} }
static bool glsm_state_ctx_init(void *data) static bool glsm_state_ctx_init(glsm_ctx_params_t *params)
{ {
glsm_ctx_params_t *params = (glsm_ctx_params_t*)data;
if (!params || !params->environ_cb) if (!params || !params->environ_cb)
return false; return false;
@ -2817,15 +2815,16 @@ static bool glsm_state_ctx_init(void *data)
#else #else
hw_render.context_type = RETRO_HW_CONTEXT_OPENGLES2; hw_render.context_type = RETRO_HW_CONTEXT_OPENGLES2;
#endif #endif
#else
#ifdef CORE
hw_render.context_type = RETRO_HW_CONTEXT_OPENGL_CORE;
hw_render.version_major = 3;
hw_render.version_minor = 3;
#else #else
hw_render.context_type = RETRO_HW_CONTEXT_OPENGL; hw_render.context_type = RETRO_HW_CONTEXT_OPENGL;
if (params->context_type != RETRO_HW_CONTEXT_NONE)
hw_render.context_type = params->context_type;
if (params->major != 0)
hw_render.version_major = params->major;
if (params->minor != 0)
hw_render.version_minor = params->minor;
#endif #endif
#endif
hw_render.context_reset = params->context_reset; hw_render.context_reset = params->context_reset;
hw_render.context_destroy = params->context_destroy; hw_render.context_destroy = params->context_destroy;
hw_render.stencil = params->stencil; hw_render.stencil = params->stencil;
@ -2873,7 +2872,7 @@ bool glsm_ctl(enum glsm_state_ctl state, void *data)
glsm_state_ctx_destroy(data); glsm_state_ctx_destroy(data);
break; break;
case GLSM_CTL_STATE_CONTEXT_INIT: case GLSM_CTL_STATE_CONTEXT_INIT:
return glsm_state_ctx_init(data); return glsm_state_ctx_init((glsm_ctx_params_t*)data);
case GLSM_CTL_STATE_SETUP: case GLSM_CTL_STATE_SETUP:
glsm_state_setup(); glsm_state_setup();
break; break;

View File

@ -146,6 +146,7 @@ typedef struct glsm_ctx_params
bool stencil; bool stencil;
unsigned major; unsigned major;
unsigned minor; unsigned minor;
enum retro_hw_context_type context_type;
} glsm_ctx_params_t; } glsm_ctx_params_t;
GLuint glsm_get_current_framebuffer(void); GLuint glsm_get_current_framebuffer(void);