#include "cogl-context.h"
#include "cogl-handle.h"
-#ifndef HAVE_COGL_GLES
-
-#include <string.h>
-
#include "cogl-shader-private.h"
#include "cogl-program-private.h"
+#include <string.h>
+
static void _cogl_program_free (CoglProgram *program);
COGL_HANDLE_DEFINE (Program, program);
uniform_no, size, count, transpose, value);
}
+#ifndef HAVE_COGL_GLES
+
/* ARBfp local parameters can be referenced like:
*
* "program.local[5]"
}
}
+#endif /* HAVE_COGL_GLES */
+
#ifdef HAVE_COGL_GL
static void
GLuint gl_program,
gboolean gl_program_changed)
{
+#ifdef HAVE_COGL_GLES
+
+ g_return_if_reached ();
+
+#else /* HAVE_COGL_GLES */
+
CoglProgramUniform *uniform;
int i;
uniform->dirty = FALSE;
}
}
-}
-
-#else /* HAVE_COGL_GLES */
-
-/* No support on regular OpenGL 1.1 */
-
-CoglHandle
-cogl_create_program (void)
-{
- return COGL_INVALID_HANDLE;
-}
-
-gboolean
-cogl_is_program (CoglHandle handle)
-{
- return FALSE;
-}
-
-CoglHandle
-cogl_program_ref (CoglHandle handle)
-{
- return COGL_INVALID_HANDLE;
-}
-
-void
-cogl_program_unref (CoglHandle handle)
-{
-}
-
-void
-cogl_program_attach_shader (CoglHandle program_handle,
- CoglHandle shader_handle)
-{
-}
-
-void
-cogl_program_link (CoglHandle program_handle)
-{
-}
-
-void
-cogl_program_use (CoglHandle program_handle)
-{
-}
-
-int
-cogl_program_get_uniform_location (CoglHandle program_handle,
- const char *uniform_name)
-{
- return 0;
-}
-
-void
-cogl_program_uniform_1f (int uniform_no,
- float value)
-{
-}
-
-void
-cogl_program_uniform_1i (int uniform_no,
- int value)
-{
-}
-
-void
-cogl_program_uniform_float (int uniform_no,
- int size,
- int count,
- const GLfloat *value)
-{
-}
-
-void
-cogl_program_uniform_int (int uniform_no,
- int size,
- int count,
- const int *value)
-{
-}
-void
-cogl_program_uniform_matrix (int uniform_no,
- int size,
- int count,
- gboolean transpose,
- const GLfloat *value)
-{
+#endif /* HAVE_COGL_GLES */
}
-#endif /* HAVE_COGL_GLES2 */
-
CoglShaderLanguage
_cogl_program_get_language (CoglHandle handle)
{
#define GET_CONTEXT(CTXVAR,RETVAL) G_STMT_START { } G_STMT_END
#endif
-#ifndef HAVE_COGL_GLES
-
static void _cogl_shader_free (CoglShader *shader);
COGL_HANDLE_DEFINE (Shader, shader);
static void
_cogl_shader_free (CoglShader *shader)
{
+#ifndef HAVE_COGL_GLES
+
/* Frees shader resources but its handle is not
released! Do that separately before this! */
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
if (shader->gl_handle)
GE (glDeleteShader (shader->gl_handle));
+#endif /* HAVE_COGL_GLES */
+
g_slice_free (CoglShader, shader);
}
static void
delete_shader (CoglShader *shader)
{
+#ifndef HAVE_COGL_GLES
+
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
#ifdef HAVE_COGL_GL
}
shader->gl_handle = 0;
+
+#endif /* HAVE_COGL_GLES */
}
void
const char **strings_in,
const GLint *lengths_in)
{
+#ifndef HAVE_COGL_GLES
+
static const char vertex_boilerplate[] = _COGL_VERTEX_SHADER_BOILERPLATE;
static const char fragment_boilerplate[] = _COGL_FRAGMENT_SHADER_BOILERPLATE;
#ifdef HAVE_COGL_GLES2
g_free (tex_coord_declarations);
#endif
+
+#endif /* HAVE_COGL_GLES */
}
void
_cogl_shader_compile_real (CoglHandle handle,
int n_tex_coord_attribs)
{
+#ifndef HAVE_COGL_GLES
+
CoglShader *shader = handle;
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
}
#endif
}
+
+#endif /* HAVE_COGL_GLES */
}
char *
cogl_shader_get_info_log (CoglHandle handle)
{
+#ifdef HAVE_COGL_GLES
+
+ return NULL;
+
+#else /* HAVE_COGL_GLES */
+
CoglShader *shader;
GET_CONTEXT (ctx, NULL);
buffer[len] = '\0';
return g_strdup (buffer);
}
+
+#endif /* HAVE_COGL_GLES */
}
CoglShaderType
gboolean
cogl_shader_is_compiled (CoglHandle handle)
{
+#ifdef HAVE_COGL_GLES
+
+ return FALSE;
+
+#else /* HAVE_COGL_GLES */
+
GLint status;
CoglShader *shader;
else
return FALSE;
}
-}
-
-#else /* HAVE_COGL_GLES */
-
-/* No support on regular OpenGL 1.1 */
-
-CoglHandle
-cogl_create_shader (CoglShaderType type)
-{
- return COGL_INVALID_HANDLE;
-}
-
-gboolean
-cogl_is_shader (CoglHandle handle)
-{
- return FALSE;
-}
-
-CoglHandle
-cogl_shader_ref (CoglHandle handle)
-{
- return COGL_INVALID_HANDLE;
-}
-
-void
-cogl_shader_unref (CoglHandle handle)
-{
-}
-
-void
-cogl_shader_source (CoglHandle shader,
- const char *source)
-{
-}
-
-void
-cogl_shader_compile (CoglHandle shader_handle)
-{
-}
-
-char *
-cogl_shader_get_info_log (CoglHandle handle)
-{
- return NULL;
-}
-
-CoglShaderType
-cogl_shader_get_type (CoglHandle handle)
-{
- return COGL_SHADER_TYPE_VERTEX;
-}
-
-gboolean
-cogl_shader_is_compiled (CoglHandle handle)
-{
- return FALSE;
-}
#endif /* HAVE_COGL_GLES */
-
+}