cogl-gles2: Prefix internal GLES 2 wrapper symbols with _

Some internal symbols used for the GLES 2 wrapper were accidentally
being exported. This prepends an underscore to them so they won't
appear in the shared library.
This commit is contained in:
Neil Roberts 2010-06-11 14:36:38 +01:00
parent 0bbf50f905
commit 9343cb849a
6 changed files with 213 additions and 212 deletions

View File

@ -40,7 +40,7 @@ _cogl_create_context_driver (CoglContext *_context)
/* Init the GLES2 wrapper */
#ifdef HAVE_COGL_GLES2
cogl_gles2_wrapper_init (&_context->drv.gles2);
_cogl_gles2_wrapper_init (&_context->drv.gles2);
#endif
}

View File

@ -1,20 +1,20 @@
/*** cogl_fixed_fragment_shader_variables_start ***/
/*** _cogl_fixed_fragment_shader_variables_start ***/
/* There is no default precision for floats in fragment shaders in
GLES 2 so we need to define one */
precision highp float;
/*** cogl_fixed_fragment_shader_inputs ***/
/*** _cogl_fixed_fragment_shader_inputs ***/
/* Inputs from the vertex shader */
varying vec4 frag_color;
varying float fog_amount;
/*** cogl_fixed_fragment_shader_texturing_options ***/
/*** _cogl_fixed_fragment_shader_texturing_options ***/
/* Texturing options */
/*** cogl_fixed_fragment_shader_fogging_options ***/
/*** _cogl_fixed_fragment_shader_fogging_options ***/
/* Fogging options */
uniform vec4 fog_color;
@ -22,41 +22,41 @@ uniform vec4 fog_color;
/* Alpha test options */
uniform float alpha_test_ref;
/*** cogl_fixed_fragment_shader_main_declare ***/
/*** _cogl_fixed_fragment_shader_main_declare ***/
void
main (void)
{
/*** cogl_fixed_fragment_shader_main_start ***/
/*** _cogl_fixed_fragment_shader_main_start ***/
/*** cogl_fixed_fragment_shader_fog ***/
/*** _cogl_fixed_fragment_shader_fog ***/
/* Mix the calculated color with the fog color */
gl_FragColor.rgb = mix (fog_color.rgb, gl_FragColor.rgb, fog_amount);
/* Alpha testing */
/*** cogl_fixed_fragment_shader_alpha_never ***/
/*** _cogl_fixed_fragment_shader_alpha_never ***/
discard;
/*** cogl_fixed_fragment_shader_alpha_less ***/
/*** _cogl_fixed_fragment_shader_alpha_less ***/
if (gl_FragColor.a >= alpha_test_ref)
discard;
/*** cogl_fixed_fragment_shader_alpha_equal ***/
/*** _cogl_fixed_fragment_shader_alpha_equal ***/
if (gl_FragColor.a != alpha_test_ref)
discard;
/*** cogl_fixed_fragment_shader_alpha_lequal ***/
/*** _cogl_fixed_fragment_shader_alpha_lequal ***/
if (gl_FragColor.a > alpha_test_ref)
discard;
/*** cogl_fixed_fragment_shader_alpha_greater ***/
/*** _cogl_fixed_fragment_shader_alpha_greater ***/
if (gl_FragColor.a <= alpha_test_ref)
discard;
/*** cogl_fixed_fragment_shader_alpha_notequal ***/
/*** _cogl_fixed_fragment_shader_alpha_notequal ***/
if (gl_FragColor.a == alpha_test_ref)
discard;
/*** cogl_fixed_fragment_shader_alpha_gequal ***/
/*** _cogl_fixed_fragment_shader_alpha_gequal ***/
if (gl_FragColor.a < alpha_test_ref)
discard;
/*** cogl_fixed_fragment_shader_end ***/
/*** _cogl_fixed_fragment_shader_end ***/
}

View File

@ -1,29 +1,29 @@
/*** cogl_fixed_vertex_shader_per_vertex_attribs ***/
/*** _cogl_fixed_vertex_shader_per_vertex_attribs ***/
/* Per vertex attributes */
attribute vec4 vertex_attrib;
attribute vec4 color_attrib;
/*** cogl_fixed_vertex_shader_transform_matrices ***/
/*** _cogl_fixed_vertex_shader_transform_matrices ***/
/* Transformation matrices */
uniform mat4 modelview_matrix;
uniform mat4 mvp_matrix; /* combined modelview and projection matrix */
/*** cogl_fixed_vertex_shader_output_variables ***/
/*** _cogl_fixed_vertex_shader_output_variables ***/
/* Outputs to the fragment shader */
varying vec4 frag_color;
varying float fog_amount;
/*** cogl_fixed_vertex_shader_fogging_options ***/
/*** _cogl_fixed_vertex_shader_fogging_options ***/
/* Fogging options */
uniform float fog_density;
uniform float fog_start;
uniform float fog_end;
/*** cogl_fixed_vertex_shader_main_start ***/
/*** _cogl_fixed_vertex_shader_main_start ***/
void
main (void)
@ -35,12 +35,12 @@ main (void)
/* Calculate the transformed texture coordinate */
/*** cogl_fixed_vertex_shader_frag_color_start ***/
/*** _cogl_fixed_vertex_shader_frag_color_start ***/
/* Pass the interpolated vertex color on to the fragment shader */
frag_color = color_attrib;
/*** cogl_fixed_vertex_shader_fog_start ***/
/*** _cogl_fixed_vertex_shader_fog_start ***/
/* Estimate the distance from the eye using just the z-coordinate to
use as the fog coord */
@ -50,16 +50,16 @@ main (void)
/* Calculate the fog amount per-vertex and interpolate it for the
fragment shader */
/*** cogl_fixed_vertex_shader_fog_exp ***/
/*** _cogl_fixed_vertex_shader_fog_exp ***/
fog_amount = exp (-fog_density * fog_coord);
/*** cogl_fixed_vertex_shader_fog_exp2 ***/
/*** _cogl_fixed_vertex_shader_fog_exp2 ***/
fog_amount = exp (-fog_density * fog_coord
* fog_density * fog_coord);
/*** cogl_fixed_vertex_shader_fog_linear ***/
/*** _cogl_fixed_vertex_shader_fog_linear ***/
fog_amount = (fog_end - fog_coord) / (fog_end - fog_start);
/*** cogl_fixed_vertex_shader_fog_end ***/
/*** _cogl_fixed_vertex_shader_fog_end ***/
fog_amount = clamp (fog_amount, 0.0, 1.0);
/*** cogl_fixed_vertex_shader_end ***/
/*** _cogl_fixed_vertex_shader_end ***/
}

View File

@ -118,7 +118,7 @@ initialize_texture_units (CoglGles2Wrapper *w)
/* We will need to set the matrix mode to GL_TEXTURE to
* initialise any new texture units, so we save the current
* mode for restoring afterwards */
GE( cogl_wrap_glGetIntegerv (GL_MATRIX_MODE, &prev_mode));
GE( _cogl_wrap_glGetIntegerv (GL_MATRIX_MODE, &prev_mode));
for (i = 0; i < COGL_GLES2_MAX_TEXTURE_UNITS; i++)
{
@ -128,36 +128,36 @@ initialize_texture_units (CoglGles2Wrapper *w)
memset (new_unit, 0, sizeof (CoglGles2WrapperTextureUnit));
w->active_texture_unit = i;
GE( cogl_wrap_glMatrixMode (GL_TEXTURE));
GE( cogl_wrap_glLoadIdentity ());
GE( _cogl_wrap_glMatrixMode (GL_TEXTURE));
GE( _cogl_wrap_glLoadIdentity ());
/* The real GL default is GL_MODULATE but the shader only
supports GL_COMBINE so let's default to that instead */
GE( cogl_wrap_glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE,
GL_COMBINE) );
GE( cogl_wrap_glTexEnvi (GL_TEXTURE_ENV, GL_COMBINE_RGB,
GL_MODULATE) );
GE( cogl_wrap_glTexEnvi (GL_TEXTURE_ENV, GL_SRC0_RGB,
GL_PREVIOUS) );
GE( cogl_wrap_glTexEnvi (GL_TEXTURE_ENV, GL_SRC1_RGB,
GL_TEXTURE) );
GE( cogl_wrap_glTexEnvi (GL_TEXTURE_ENV, GL_OPERAND0_RGB,
GL_SRC_COLOR) );
GE( cogl_wrap_glTexEnvi (GL_TEXTURE_ENV, GL_OPERAND1_RGB,
GL_SRC_COLOR) );
GE( cogl_wrap_glTexEnvi (GL_TEXTURE_ENV, GL_COMBINE_ALPHA,
GL_MODULATE) );
GE( cogl_wrap_glTexEnvi (GL_TEXTURE_ENV, GL_SRC0_ALPHA,
GL_PREVIOUS) );
GE( cogl_wrap_glTexEnvi (GL_TEXTURE_ENV, GL_SRC1_ALPHA,
GL_TEXTURE) );
GE( cogl_wrap_glTexEnvi (GL_TEXTURE_ENV, GL_OPERAND0_ALPHA,
GL_SRC_COLOR) );
GE( cogl_wrap_glTexEnvi (GL_TEXTURE_ENV, GL_OPERAND1_ALPHA,
GL_SRC_COLOR) );
GE( _cogl_wrap_glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE,
GL_COMBINE) );
GE( _cogl_wrap_glTexEnvi (GL_TEXTURE_ENV, GL_COMBINE_RGB,
GL_MODULATE) );
GE( _cogl_wrap_glTexEnvi (GL_TEXTURE_ENV, GL_SRC0_RGB,
GL_PREVIOUS) );
GE( _cogl_wrap_glTexEnvi (GL_TEXTURE_ENV, GL_SRC1_RGB,
GL_TEXTURE) );
GE( _cogl_wrap_glTexEnvi (GL_TEXTURE_ENV, GL_OPERAND0_RGB,
GL_SRC_COLOR) );
GE( _cogl_wrap_glTexEnvi (GL_TEXTURE_ENV, GL_OPERAND1_RGB,
GL_SRC_COLOR) );
GE( _cogl_wrap_glTexEnvi (GL_TEXTURE_ENV, GL_COMBINE_ALPHA,
GL_MODULATE) );
GE( _cogl_wrap_glTexEnvi (GL_TEXTURE_ENV, GL_SRC0_ALPHA,
GL_PREVIOUS) );
GE( _cogl_wrap_glTexEnvi (GL_TEXTURE_ENV, GL_SRC1_ALPHA,
GL_TEXTURE) );
GE( _cogl_wrap_glTexEnvi (GL_TEXTURE_ENV, GL_OPERAND0_ALPHA,
GL_SRC_COLOR) );
GE( _cogl_wrap_glTexEnvi (GL_TEXTURE_ENV, GL_OPERAND1_ALPHA,
GL_SRC_COLOR) );
}
GE( cogl_wrap_glMatrixMode ((GLenum) prev_mode));
GE( _cogl_wrap_glMatrixMode ((GLenum) prev_mode));
w->settings.texture_units = 0;
@ -165,34 +165,34 @@ initialize_texture_units (CoglGles2Wrapper *w)
}
void
cogl_gles2_wrapper_init (CoglGles2Wrapper *wrapper)
_cogl_gles2_wrapper_init (CoglGles2Wrapper *wrapper)
{
GLfloat default_fog_color[4] = { 0, 0, 0, 0 };
memset (wrapper, 0, sizeof (CoglGles2Wrapper));
/* Initialize the stacks */
cogl_wrap_glMatrixMode (GL_PROJECTION);
cogl_wrap_glLoadIdentity ();
cogl_wrap_glMatrixMode (GL_MODELVIEW);
cogl_wrap_glLoadIdentity ();
_cogl_wrap_glMatrixMode (GL_PROJECTION);
_cogl_wrap_glLoadIdentity ();
_cogl_wrap_glMatrixMode (GL_MODELVIEW);
_cogl_wrap_glLoadIdentity ();
/* The gl*ActiveTexture wrappers will initialise the texture
* stack for the texture unit when it's first activated */
cogl_wrap_glActiveTexture (GL_TEXTURE0);
cogl_wrap_glClientActiveTexture (GL_TEXTURE0);
_cogl_wrap_glActiveTexture (GL_TEXTURE0);
_cogl_wrap_glClientActiveTexture (GL_TEXTURE0);
/* Initialize the fogging options */
cogl_wrap_glDisable (GL_FOG);
cogl_wrap_glFogf (GL_FOG_MODE, GL_LINEAR);
cogl_wrap_glFogf (GL_FOG_DENSITY, 1.0);
cogl_wrap_glFogf (GL_FOG_START, 0);
cogl_wrap_glFogf (GL_FOG_END, 1);
cogl_wrap_glFogfv (GL_FOG_COLOR, default_fog_color);
_cogl_wrap_glDisable (GL_FOG);
_cogl_wrap_glFogf (GL_FOG_MODE, GL_LINEAR);
_cogl_wrap_glFogf (GL_FOG_DENSITY, 1.0);
_cogl_wrap_glFogf (GL_FOG_START, 0);
_cogl_wrap_glFogf (GL_FOG_END, 1);
_cogl_wrap_glFogfv (GL_FOG_COLOR, default_fog_color);
/* Initialize alpha testing */
cogl_wrap_glDisable (GL_ALPHA_TEST);
cogl_wrap_glAlphaFunc (GL_ALWAYS, 0.0f);
_cogl_wrap_glDisable (GL_ALPHA_TEST);
_cogl_wrap_glAlphaFunc (GL_ALWAYS, 0.0f);
initialize_texture_units (wrapper);
}
@ -295,7 +295,7 @@ cogl_gles2_get_vertex_shader (const CoglGles2WrapperSettings *settings)
return (CoglGles2WrapperShader *) node->data;
/* Otherwise create a new shader */
shader_source = g_string_new (cogl_fixed_vertex_shader_per_vertex_attribs);
shader_source = g_string_new (_cogl_fixed_vertex_shader_per_vertex_attribs);
for (i = 0; i < COGL_GLES2_MAX_TEXTURE_UNITS; i++)
if (COGL_GLES2_TEXTURE_UNIT_IS_ENABLED (settings->texture_units, i))
@ -308,8 +308,8 @@ cogl_gles2_get_vertex_shader (const CoglGles2WrapperSettings *settings)
if (COGL_GLES2_TEXTURE_UNIT_IS_ENABLED (settings->texture_units, i))
n_texture_units = i + 1;
g_string_append (shader_source, cogl_fixed_vertex_shader_transform_matrices);
g_string_append (shader_source, cogl_fixed_vertex_shader_output_variables);
g_string_append (shader_source, _cogl_fixed_vertex_shader_transform_matrices);
g_string_append (shader_source, _cogl_fixed_vertex_shader_output_variables);
if (n_texture_units > 0)
{
@ -322,8 +322,8 @@ cogl_gles2_get_vertex_shader (const CoglGles2WrapperSettings *settings)
n_texture_units);
}
g_string_append (shader_source, cogl_fixed_vertex_shader_fogging_options);
g_string_append (shader_source, cogl_fixed_vertex_shader_main_start);
g_string_append (shader_source, _cogl_fixed_vertex_shader_fogging_options);
g_string_append (shader_source, _cogl_fixed_vertex_shader_main_start);
for (i = 0; i < COGL_GLES2_MAX_TEXTURE_UNITS; i++)
if (COGL_GLES2_TEXTURE_UNIT_IS_ENABLED (settings->texture_units, i))
@ -339,31 +339,31 @@ cogl_gles2_get_vertex_shader (const CoglGles2WrapperSettings *settings)
i);
}
g_string_append (shader_source, cogl_fixed_vertex_shader_frag_color_start);
g_string_append (shader_source, _cogl_fixed_vertex_shader_frag_color_start);
if (settings->fog_enabled)
{
g_string_append (shader_source, cogl_fixed_vertex_shader_fog_start);
g_string_append (shader_source, _cogl_fixed_vertex_shader_fog_start);
switch (settings->fog_mode)
{
case GL_EXP:
g_string_append (shader_source, cogl_fixed_vertex_shader_fog_exp);
g_string_append (shader_source, _cogl_fixed_vertex_shader_fog_exp);
break;
case GL_EXP2:
g_string_append (shader_source, cogl_fixed_vertex_shader_fog_exp2);
g_string_append (shader_source, _cogl_fixed_vertex_shader_fog_exp2);
break;
default:
g_string_append (shader_source, cogl_fixed_vertex_shader_fog_linear);
g_string_append (shader_source, _cogl_fixed_vertex_shader_fog_linear);
break;
}
g_string_append (shader_source, cogl_fixed_vertex_shader_fog_end);
g_string_append (shader_source, _cogl_fixed_vertex_shader_fog_end);
}
g_string_append (shader_source, cogl_fixed_vertex_shader_end);
g_string_append (shader_source, _cogl_fixed_vertex_shader_end);
shader_obj = cogl_gles2_wrapper_create_shader (GL_VERTEX_SHADER,
shader_source->str);
@ -585,14 +585,14 @@ cogl_gles2_get_fragment_shader (const CoglGles2WrapperSettings *settings)
return (CoglGles2WrapperShader *) node->data;
/* Otherwise create a new shader */
shader_source = g_string_new (cogl_fixed_fragment_shader_variables_start);
shader_source = g_string_new (_cogl_fixed_fragment_shader_variables_start);
/* Find the biggest enabled texture unit index */
for (i = 0; i < COGL_GLES2_MAX_TEXTURE_UNITS; i++)
if (COGL_GLES2_TEXTURE_UNIT_IS_ENABLED (settings->texture_units, i))
n_texture_units = i + 1;
g_string_append (shader_source, cogl_fixed_fragment_shader_inputs);
g_string_append (shader_source, _cogl_fixed_fragment_shader_inputs);
if (n_texture_units > 0)
{
@ -600,17 +600,18 @@ cogl_gles2_get_fragment_shader (const CoglGles2WrapperSettings *settings)
"varying vec2 tex_coord[%d];\n",
n_texture_units);
g_string_append (shader_source, cogl_fixed_fragment_shader_texturing_options);
g_string_append (shader_source,
_cogl_fixed_fragment_shader_texturing_options);
g_string_append_printf (shader_source,
"uniform sampler2D texture_unit[%d];\n",
n_texture_units);
}
g_string_append (shader_source, cogl_fixed_fragment_shader_fogging_options);
g_string_append (shader_source, _cogl_fixed_fragment_shader_fogging_options);
g_string_append (shader_source, cogl_fixed_fragment_shader_main_declare);
g_string_append (shader_source, _cogl_fixed_fragment_shader_main_declare);
g_string_append (shader_source, cogl_fixed_fragment_shader_main_start);
g_string_append (shader_source, _cogl_fixed_fragment_shader_main_start);
/* This pointless extra variable is needed to work around an
apparent bug in the PowerVR drivers. Without it the alpha
@ -667,41 +668,41 @@ cogl_gles2_get_fragment_shader (const CoglGles2WrapperSettings *settings)
}
if (settings->fog_enabled)
g_string_append (shader_source, cogl_fixed_fragment_shader_fog);
g_string_append (shader_source, _cogl_fixed_fragment_shader_fog);
if (settings->alpha_test_enabled)
switch (settings->alpha_test_func)
{
case GL_NEVER:
g_string_append (shader_source,
cogl_fixed_fragment_shader_alpha_never);
_cogl_fixed_fragment_shader_alpha_never);
break;
case GL_LESS:
g_string_append (shader_source,
cogl_fixed_fragment_shader_alpha_less);
_cogl_fixed_fragment_shader_alpha_less);
break;
case GL_EQUAL:
g_string_append (shader_source,
cogl_fixed_fragment_shader_alpha_equal);
_cogl_fixed_fragment_shader_alpha_equal);
break;
case GL_LEQUAL:
g_string_append (shader_source,
cogl_fixed_fragment_shader_alpha_lequal);
_cogl_fixed_fragment_shader_alpha_lequal);
break;
case GL_GREATER:
g_string_append (shader_source,
cogl_fixed_fragment_shader_alpha_greater);
_cogl_fixed_fragment_shader_alpha_greater);
break;
case GL_NOTEQUAL:
g_string_append (shader_source,
cogl_fixed_fragment_shader_alpha_notequal);
_cogl_fixed_fragment_shader_alpha_notequal);
break;
case GL_GEQUAL:
g_string_append (shader_source,
cogl_fixed_fragment_shader_alpha_gequal);
_cogl_fixed_fragment_shader_alpha_gequal);
}
g_string_append (shader_source, cogl_fixed_fragment_shader_end);
g_string_append (shader_source, _cogl_fixed_fragment_shader_end);
shader_obj = cogl_gles2_wrapper_create_shader (GL_FRAGMENT_SHADER,
shader_source->str);
@ -896,7 +897,7 @@ cogl_gles2_wrapper_get_program (const CoglGles2WrapperSettings *settings)
}
void
cogl_gles2_wrapper_deinit (CoglGles2Wrapper *wrapper)
_cogl_gles2_wrapper_deinit (CoglGles2Wrapper *wrapper)
{
GSList *node, *next;
int i;
@ -959,7 +960,7 @@ cogl_gles2_wrapper_notify_matrix_changed (CoglGles2Wrapper *wrapper,
}
void
cogl_wrap_glMatrixMode (GLenum mode)
_cogl_wrap_glMatrixMode (GLenum mode)
{
_COGL_GET_GLES2_WRAPPER (w, NO_RETVAL);
@ -991,7 +992,7 @@ cogl_gles2_get_current_matrix (CoglGles2Wrapper *wrapper)
}
void
cogl_wrap_glLoadIdentity (void)
_cogl_wrap_glLoadIdentity (void)
{
CoglMatrix *matrix;
@ -1005,7 +1006,7 @@ cogl_wrap_glLoadIdentity (void)
}
void
cogl_wrap_glLoadMatrixf (const GLfloat *m)
_cogl_wrap_glLoadMatrixf (const GLfloat *m)
{
CoglMatrix *matrix;
@ -1019,7 +1020,7 @@ cogl_wrap_glLoadMatrixf (const GLfloat *m)
}
void
cogl_wrap_glVertexPointer (GLint size, GLenum type, GLsizei stride,
_cogl_wrap_glVertexPointer (GLint size, GLenum type, GLsizei stride,
const GLvoid *pointer)
{
glVertexAttribPointer (COGL_GLES2_WRAPPER_VERTEX_ATTRIB, size, type,
@ -1027,7 +1028,7 @@ cogl_wrap_glVertexPointer (GLint size, GLenum type, GLsizei stride,
}
void
cogl_wrap_glTexCoordPointer (GLint size, GLenum type, GLsizei stride,
_cogl_wrap_glTexCoordPointer (GLint size, GLenum type, GLsizei stride,
const GLvoid *pointer)
{
int active_unit;
@ -1047,15 +1048,15 @@ cogl_wrap_glTexCoordPointer (GLint size, GLenum type, GLsizei stride,
}
void
cogl_wrap_glColorPointer (GLint size, GLenum type, GLsizei stride,
const GLvoid *pointer)
_cogl_wrap_glColorPointer (GLint size, GLenum type, GLsizei stride,
const GLvoid *pointer)
{
glVertexAttribPointer (COGL_GLES2_WRAPPER_COLOR_ATTRIB, size, type,
GL_TRUE, stride, pointer);
}
void
cogl_wrap_glNormalPointer (GLenum type, GLsizei stride, const GLvoid *pointer)
_cogl_wrap_glNormalPointer (GLenum type, GLsizei stride, const GLvoid *pointer)
{
glVertexAttribPointer (COGL_GLES2_WRAPPER_NORMAL_ATTRIB, 1, type,
GL_FALSE, stride, pointer);
@ -1134,7 +1135,7 @@ cogl_gles2_do_set_uniform (GLint location, CoglBoxedValue *value)
}
static void
cogl_wrap_prepare_for_draw (void)
_cogl_wrap_prepare_for_draw (void)
{
CoglGles2WrapperProgram *program;
@ -1320,24 +1321,24 @@ cogl_wrap_prepare_for_draw (void)
}
void
cogl_wrap_glDrawArrays (GLenum mode, GLint first, GLsizei count)
_cogl_wrap_glDrawArrays (GLenum mode, GLint first, GLsizei count)
{
cogl_wrap_prepare_for_draw ();
_cogl_wrap_prepare_for_draw ();
glDrawArrays (mode, first, count);
}
void
cogl_wrap_glDrawElements (GLenum mode, GLsizei count, GLenum type,
_cogl_wrap_glDrawElements (GLenum mode, GLsizei count, GLenum type,
const GLvoid *indices)
{
cogl_wrap_prepare_for_draw ();
_cogl_wrap_prepare_for_draw ();
glDrawElements (mode, count, type, indices);
}
void
cogl_wrap_glTexEnvi (GLenum target, GLenum pname, GLint param)
_cogl_wrap_glTexEnvi (GLenum target, GLenum pname, GLint param)
{
if (target == GL_TEXTURE_ENV)
{
@ -1382,7 +1383,7 @@ cogl_wrap_glTexEnvi (GLenum target, GLenum pname, GLint param)
}
void
cogl_wrap_glTexEnvfv (GLenum target, GLenum pname, const GLfloat *params)
_cogl_wrap_glTexEnvfv (GLenum target, GLenum pname, const GLfloat *params)
{
if (target == GL_TEXTURE_ENV && pname == GL_TEXTURE_ENV_COLOR)
{
@ -1397,7 +1398,7 @@ cogl_wrap_glTexEnvfv (GLenum target, GLenum pname, const GLfloat *params)
}
void
cogl_wrap_glClientActiveTexture (GLenum texture)
_cogl_wrap_glClientActiveTexture (GLenum texture)
{
int texture_unit_index = texture - GL_TEXTURE0;
_COGL_GET_GLES2_WRAPPER (w, NO_RETVAL);
@ -1407,7 +1408,7 @@ cogl_wrap_glClientActiveTexture (GLenum texture)
}
void
cogl_wrap_glActiveTexture (GLenum texture)
_cogl_wrap_glActiveTexture (GLenum texture)
{
int texture_unit_index = texture - GL_TEXTURE0;
_COGL_GET_GLES2_WRAPPER (w, NO_RETVAL);
@ -1419,7 +1420,7 @@ cogl_wrap_glActiveTexture (GLenum texture)
}
void
cogl_wrap_glEnable (GLenum cap)
_cogl_wrap_glEnable (GLenum cap)
{
_COGL_GET_GLES2_WRAPPER (w, NO_RETVAL);
@ -1450,7 +1451,7 @@ cogl_wrap_glEnable (GLenum cap)
}
void
cogl_wrap_glDisable (GLenum cap)
_cogl_wrap_glDisable (GLenum cap)
{
_COGL_GET_GLES2_WRAPPER (w, NO_RETVAL);
@ -1481,7 +1482,7 @@ cogl_wrap_glDisable (GLenum cap)
}
void
cogl_wrap_glEnableClientState (GLenum array)
_cogl_wrap_glEnableClientState (GLenum array)
{
CoglGles2WrapperTextureUnit *texture_unit;
_COGL_GET_GLES2_WRAPPER (w, NO_RETVAL);
@ -1512,7 +1513,7 @@ cogl_wrap_glEnableClientState (GLenum array)
}
void
cogl_wrap_glDisableClientState (GLenum array)
_cogl_wrap_glDisableClientState (GLenum array)
{
CoglGles2WrapperTextureUnit *texture_unit;
_COGL_GET_GLES2_WRAPPER (w, NO_RETVAL);
@ -1543,7 +1544,7 @@ cogl_wrap_glDisableClientState (GLenum array)
}
void
cogl_wrap_glAlphaFunc (GLenum func, GLclampf ref)
_cogl_wrap_glAlphaFunc (GLenum func, GLclampf ref)
{
_COGL_GET_GLES2_WRAPPER (w, NO_RETVAL);
@ -1557,26 +1558,26 @@ cogl_wrap_glAlphaFunc (GLenum func, GLclampf ref)
}
void
cogl_wrap_glColor4f (GLclampf r, GLclampf g, GLclampf b, GLclampf a)
_cogl_wrap_glColor4f (GLclampf r, GLclampf g, GLclampf b, GLclampf a)
{
glVertexAttrib4f (COGL_GLES2_WRAPPER_COLOR_ATTRIB, r, g, b, a);
}
void
cogl_wrap_glColor4ub (GLubyte r, GLubyte g, GLubyte b, GLubyte a)
_cogl_wrap_glColor4ub (GLubyte r, GLubyte g, GLubyte b, GLubyte a)
{
glVertexAttrib4f (COGL_GLES2_WRAPPER_COLOR_ATTRIB,
r/255.0, g/255.0, b/255.0, a/255.0);
}
void
cogl_wrap_glClipPlanef (GLenum plane, GLfloat *equation)
_cogl_wrap_glClipPlanef (GLenum plane, GLfloat *equation)
{
/* FIXME */
}
void
cogl_wrap_glGetIntegerv (GLenum pname, GLint *params)
_cogl_wrap_glGetIntegerv (GLenum pname, GLint *params)
{
_COGL_GET_GLES2_WRAPPER (w, NO_RETVAL);
@ -1603,7 +1604,7 @@ cogl_wrap_glGetIntegerv (GLenum pname, GLint *params)
}
void
cogl_wrap_glGetFloatv (GLenum pname, GLfloat *params)
_cogl_wrap_glGetFloatv (GLenum pname, GLfloat *params)
{
CoglGles2WrapperTextureUnit *texture_unit;
@ -1631,7 +1632,7 @@ cogl_wrap_glGetFloatv (GLenum pname, GLfloat *params)
}
void
cogl_wrap_glFogf (GLenum pname, GLfloat param)
_cogl_wrap_glFogf (GLenum pname, GLfloat param)
{
_COGL_GET_GLES2_WRAPPER (w, NO_RETVAL);
@ -1659,7 +1660,7 @@ cogl_wrap_glFogf (GLenum pname, GLfloat param)
}
void
cogl_wrap_glFogfv (GLenum pname, const GLfloat *params)
_cogl_wrap_glFogfv (GLenum pname, const GLfloat *params)
{
int i;
_COGL_GET_GLES2_WRAPPER (w, NO_RETVAL);
@ -1674,14 +1675,14 @@ cogl_wrap_glFogfv (GLenum pname, const GLfloat *params)
}
void
cogl_wrap_glTexParameteri (GLenum target, GLenum pname, GLfloat param)
_cogl_wrap_glTexParameteri (GLenum target, GLenum pname, GLfloat param)
{
if (pname != GL_GENERATE_MIPMAP)
glTexParameteri (target, pname, param);
}
void
cogl_wrap_glMaterialfv (GLenum face, GLenum pname, const GLfloat *params)
_cogl_wrap_glMaterialfv (GLenum face, GLenum pname, const GLfloat *params)
{
/* FIXME: the GLES 2 backend doesn't yet support lighting so this
function can't do anything */

View File

@ -317,115 +317,115 @@ struct _CoglGles2WrapperShader
#endif /* GL_MODELVIEW */
void cogl_gles2_wrapper_init (CoglGles2Wrapper *wrapper);
void cogl_gles2_wrapper_deinit (CoglGles2Wrapper *wrapper);
void _cogl_gles2_wrapper_init (CoglGles2Wrapper *wrapper);
void _cogl_gles2_wrapper_deinit (CoglGles2Wrapper *wrapper);
void cogl_wrap_glPushMatrix ();
void cogl_wrap_glPopMatrix ();
void cogl_wrap_glMatrixMode (GLenum mode);
void cogl_wrap_glLoadIdentity ();
void cogl_wrap_glMultMatrixf (const GLfloat *m);
void cogl_wrap_glLoadMatrixf (const GLfloat *m);
void cogl_wrap_glFrustumf (GLfloat left, GLfloat right,
GLfloat bottom, GLfloat top,
GLfloat z_near, GLfloat z_far);
void cogl_wrap_glScalef (GLfloat x, GLfloat y, GLfloat z);
void cogl_wrap_glTranslatef (GLfloat x, GLfloat y, GLfloat z);
void cogl_wrap_glRotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
void cogl_wrap_glOrthof (GLfloat left, GLfloat right,
GLfloat bottom, GLfloat top,
GLfloat near, GLfloat far);
void _cogl_wrap_glPushMatrix ();
void _cogl_wrap_glPopMatrix ();
void _cogl_wrap_glMatrixMode (GLenum mode);
void _cogl_wrap_glLoadIdentity ();
void _cogl_wrap_glMultMatrixf (const GLfloat *m);
void _cogl_wrap_glLoadMatrixf (const GLfloat *m);
void _cogl_wrap_glFrustumf (GLfloat left, GLfloat right,
GLfloat bottom, GLfloat top,
GLfloat z_near, GLfloat z_far);
void _cogl_wrap_glScalef (GLfloat x, GLfloat y, GLfloat z);
void _cogl_wrap_glTranslatef (GLfloat x, GLfloat y, GLfloat z);
void _cogl_wrap_glRotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
void _cogl_wrap_glOrthof (GLfloat left, GLfloat right,
GLfloat bottom, GLfloat top,
GLfloat near, GLfloat far);
void cogl_wrap_glEnable (GLenum cap);
void cogl_wrap_glDisable (GLenum cap);
void _cogl_wrap_glEnable (GLenum cap);
void _cogl_wrap_glDisable (GLenum cap);
void cogl_wrap_glTexCoordPointer (GLint size, GLenum type, GLsizei stride,
const GLvoid *pointer);
void cogl_wrap_glVertexPointer (GLint size, GLenum type, GLsizei stride,
const GLvoid *pointer);
void cogl_wrap_glColorPointer (GLint size, GLenum type, GLsizei stride,
const GLvoid *pointer);
void cogl_wrap_glNormalPointer (GLenum type, GLsizei stride,
const GLvoid *pointer);
void _cogl_wrap_glTexCoordPointer (GLint size, GLenum type, GLsizei stride,
const GLvoid *pointer);
void _cogl_wrap_glVertexPointer (GLint size, GLenum type, GLsizei stride,
const GLvoid *pointer);
void _cogl_wrap_glColorPointer (GLint size, GLenum type, GLsizei stride,
const GLvoid *pointer);
void _cogl_wrap_glNormalPointer (GLenum type, GLsizei stride,
const GLvoid *pointer);
void cogl_wrap_glTexEnvi (GLenum target, GLenum pname, GLint param);
void cogl_wrap_glTexEnvfv (GLenum target, GLenum pname, const GLfloat *params);
void _cogl_wrap_glTexEnvi (GLenum target, GLenum pname, GLint param);
void _cogl_wrap_glTexEnvfv (GLenum target, GLenum pname, const GLfloat *params);
void cogl_wrap_glClientActiveTexture (GLenum texture);
void cogl_wrap_glActiveTexture (GLenum texture);
void _cogl_wrap_glClientActiveTexture (GLenum texture);
void _cogl_wrap_glActiveTexture (GLenum texture);
void cogl_wrap_glEnableClientState (GLenum array);
void cogl_wrap_glDisableClientState (GLenum array);
void _cogl_wrap_glEnableClientState (GLenum array);
void _cogl_wrap_glDisableClientState (GLenum array);
void cogl_wrap_glAlphaFunc (GLenum func, GLclampf ref);
void _cogl_wrap_glAlphaFunc (GLenum func, GLclampf ref);
void cogl_wrap_glColor4f (GLclampf r, GLclampf g, GLclampf b, GLclampf a);
void cogl_wrap_glColor4ub (GLubyte r, GLubyte g, GLubyte b, GLubyte a);
void _cogl_wrap_glColor4f (GLclampf r, GLclampf g, GLclampf b, GLclampf a);
void _cogl_wrap_glColor4ub (GLubyte r, GLubyte g, GLubyte b, GLubyte a);
void cogl_wrap_glClipPlanef (GLenum plane, GLfloat *equation);
void _cogl_wrap_glClipPlanef (GLenum plane, GLfloat *equation);
void cogl_wrap_glGetIntegerv (GLenum pname, GLint *params);
void cogl_wrap_glGetFloatv (GLenum pname, GLfloat *params);
void _cogl_wrap_glGetIntegerv (GLenum pname, GLint *params);
void _cogl_wrap_glGetFloatv (GLenum pname, GLfloat *params);
void cogl_wrap_glFogf (GLenum pname, GLfloat param);
void cogl_wrap_glFogfv (GLenum pname, const GLfloat *params);
void _cogl_wrap_glFogf (GLenum pname, GLfloat param);
void _cogl_wrap_glFogfv (GLenum pname, const GLfloat *params);
void cogl_wrap_glDrawArrays (GLenum mode, GLint first, GLsizei count);
void cogl_wrap_glDrawElements (GLenum mode, GLsizei count, GLenum type,
const GLvoid *indices);
void cogl_wrap_glTexParameteri (GLenum target, GLenum pname, GLfloat param);
void _cogl_wrap_glDrawArrays (GLenum mode, GLint first, GLsizei count);
void _cogl_wrap_glDrawElements (GLenum mode, GLsizei count, GLenum type,
const GLvoid *indices);
void _cogl_wrap_glTexParameteri (GLenum target, GLenum pname, GLfloat param);
void cogl_wrap_glMaterialfv (GLenum face, GLenum pname, const GLfloat *params);
void _cogl_wrap_glMaterialfv (GLenum face, GLenum pname, const GLfloat *params);
/* This function is only available on GLES 2 */
#define cogl_wrap_glGenerateMipmap glGenerateMipmap
#define _cogl_wrap_glGenerateMipmap glGenerateMipmap
void _cogl_gles2_clear_cache_for_program (CoglHandle program);
/* Remap the missing GL functions to use the wrappers */
#ifndef COGL_GLES2_WRAPPER_NO_REMAP
#define glDrawArrays cogl_wrap_glDrawArrays
#define glDrawElements cogl_wrap_glDrawElements
#define glPushMatrix cogl_wrap_glPushMatrix
#define glPopMatrix cogl_wrap_glPopMatrix
#define glMatrixMode cogl_wrap_glMatrixMode
#define glLoadIdentity cogl_wrap_glLoadIdentity
#define glMultMatrixf cogl_wrap_glMultMatrixf
#define glLoadMatrixf cogl_wrap_glLoadMatrixf
#define glFrustumf cogl_wrap_glFrustumf
#define glScalef cogl_wrap_glScalef
#define glTranslatef cogl_wrap_glTranslatef
#define glRotatef cogl_wrap_glRotatef
#define glOrthof cogl_wrap_glOrthof
#define glEnable cogl_wrap_glEnable
#define glDisable cogl_wrap_glDisable
#define glTexCoordPointer cogl_wrap_glTexCoordPointer
#define glVertexPointer cogl_wrap_glVertexPointer
#define glColorPointer cogl_wrap_glColorPointer
#define glNormalPointer cogl_wrap_glNormalPointer
#define glTexEnvi cogl_wrap_glTexEnvi
#define glTexEnvfv cogl_wrap_glTexEnvfv
#define glActiveTexture cogl_wrap_glActiveTexture
#define glClientActiveTexture cogl_wrap_glClientActiveTexture
#define glEnableClientState cogl_wrap_glEnableClientState
#define glDisableClientState cogl_wrap_glDisableClientState
#define glAlphaFunc cogl_wrap_glAlphaFunc
#define glColor4f cogl_wrap_glColor4f
#define glColor4ub cogl_wrap_glColor4ub
#define glClipPlanef cogl_wrap_glClipPlanef
#define glGetIntegerv cogl_wrap_glGetIntegerv
#define glGetFloatv cogl_wrap_glGetFloatv
#define glFogf cogl_wrap_glFogf
#define glFogfv cogl_wrap_glFogfv
#define glTexParameteri cogl_wrap_glTexParameteri
#define glMaterialfv cogl_wrap_glMaterialfv
#define glDrawArrays _cogl_wrap_glDrawArrays
#define glDrawElements _cogl_wrap_glDrawElements
#define glPushMatrix _cogl_wrap_glPushMatrix
#define glPopMatrix _cogl_wrap_glPopMatrix
#define glMatrixMode _cogl_wrap_glMatrixMode
#define glLoadIdentity _cogl_wrap_glLoadIdentity
#define glMultMatrixf _cogl_wrap_glMultMatrixf
#define glLoadMatrixf _cogl_wrap_glLoadMatrixf
#define glFrustumf _cogl_wrap_glFrustumf
#define glScalef _cogl_wrap_glScalef
#define glTranslatef _cogl_wrap_glTranslatef
#define glRotatef _cogl_wrap_glRotatef
#define glOrthof _cogl_wrap_glOrthof
#define glEnable _cogl_wrap_glEnable
#define glDisable _cogl_wrap_glDisable
#define glTexCoordPointer _cogl_wrap_glTexCoordPointer
#define glVertexPointer _cogl_wrap_glVertexPointer
#define glColorPointer _cogl_wrap_glColorPointer
#define glNormalPointer _cogl_wrap_glNormalPointer
#define glTexEnvi _cogl_wrap_glTexEnvi
#define glTexEnvfv _cogl_wrap_glTexEnvfv
#define glActiveTexture _cogl_wrap_glActiveTexture
#define glClientActiveTexture _cogl_wrap_glClientActiveTexture
#define glEnableClientState _cogl_wrap_glEnableClientState
#define glDisableClientState _cogl_wrap_glDisableClientState
#define glAlphaFunc _cogl_wrap_glAlphaFunc
#define glColor4f _cogl_wrap_glColor4f
#define glColor4ub _cogl_wrap_glColor4ub
#define glClipPlanef _cogl_wrap_glClipPlanef
#define glGetIntegerv _cogl_wrap_glGetIntegerv
#define glGetFloatv _cogl_wrap_glGetFloatv
#define glFogf _cogl_wrap_glFogf
#define glFogfv _cogl_wrap_glFogfv
#define glTexParameteri _cogl_wrap_glTexParameteri
#define glMaterialfv _cogl_wrap_glMaterialfv
#endif /* COGL_GLES2_WRAPPER_NO_REMAP */
#else /* HAVE_COGL_GLES2 */
/* COGL uses the automatic mipmap generation for GLES 1 so
glGenerateMipmap doesn't need to do anything */
#define cogl_wrap_glGenerateMipmap(x) ((void) 0)
#define _cogl_wrap_glGenerateMipmap(x) ((void) 0)
/* GLES doesn't have glDrawRangeElements, so we simply pretend it does
* but that it makes no use of the start, end constraints: */

View File

@ -325,7 +325,7 @@ _cogl_texture_driver_allows_foreign_gl_target (GLenum gl_target)
void
_cogl_texture_driver_gl_generate_mipmaps (GLenum gl_target)
{
GE( cogl_wrap_glGenerateMipmap (gl_target) );
GE( _cogl_wrap_glGenerateMipmap (gl_target) );
}
CoglPixelFormat