Avoid mixing declarations and code
Mixing declarations and code causes problems for MSVC as it is a C99 feature so we should try to avoid it.
This commit is contained in:
parent
66680d22f8
commit
371e6bd47c
@ -290,12 +290,14 @@ void
|
||||
_cogl_gl_use_program_wrapper (CoglHandle program_handle)
|
||||
{
|
||||
#ifdef COGL_MATERIAL_BACKEND_GLSL
|
||||
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
||||
|
||||
#ifndef HAVE_COGL_GLES2
|
||||
|
||||
CoglProgram *program = (CoglProgram *)program_handle;
|
||||
GLuint gl_program;
|
||||
|
||||
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
||||
|
||||
if (program_handle != COGL_INVALID_HANDLE)
|
||||
gl_program = program->gl_handle;
|
||||
else
|
||||
@ -322,9 +324,14 @@ _cogl_gl_use_program_wrapper (CoglHandle program_handle)
|
||||
GE (glUseProgram (0));
|
||||
|
||||
ctx->current_gl_program = gl_program;
|
||||
|
||||
#else /* HAVE_COGL_GLES2 */
|
||||
|
||||
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
||||
|
||||
ctx->drv.gles2.settings.user_program = program_handle;
|
||||
ctx->drv.gles2.settings_dirty = TRUE;
|
||||
|
||||
#endif /* HAVE_COGL_GLES2 */
|
||||
|
||||
#endif
|
||||
|
@ -5578,8 +5578,10 @@ dump_material_cb (CoglMaterialNode *node, void *user_data)
|
||||
|
||||
if (material->differences & COGL_MATERIAL_STATE_BLEND)
|
||||
{
|
||||
changes = TRUE;
|
||||
const char *blend_enable_name;
|
||||
|
||||
changes = TRUE;
|
||||
|
||||
switch (material->blend_enable)
|
||||
{
|
||||
case COGL_MATERIAL_BLEND_ENABLE_AUTOMATIC:
|
||||
|
Loading…
Reference in New Issue
Block a user