2008-11-21 Neil Roberts <neil@linux.intel.com>
+ Bug 1271 - mingw compiling failed: undefined reference to
+ `_glDrawRangeElements@24'
+
+ Resolve glDrawRangeElements with cogl_get_proc_address instead of
+ calling it directly because functions defined in GL > 1.1 are not
+ directly exported under Windows.
+
+ * clutter/cogl/common/cogl-mesh.c: Use the function pointer from
+ the context
+
+ * clutter/cogl/gl/cogl-context.c (cogl_create_context): Initialise
+ function pointer.
+
+ * clutter/cogl/gl/cogl-context.h (CoglContext): Add a function
+ pointer
+
+ * clutter/cogl/gl/cogl-defines.h.in: Add a typedef for the
+ function pointer.
+
+ * clutter/cogl/gl/cogl.c (_cogl_features_init): Resolve
+ glDrawRangeElements
+
+2008-11-21 Neil Roberts <neil@linux.intel.com>
+
* tests/interactive/Makefile.am:
* tests/conform/Makefile.am: Use $(EXEEXT) when specifying a
dependency on an executable otherwise there won't be a rule to
#endif
#ifndef HAVE_COGL_GL
+
/* GLES doesn't have glDrawRangeElements, so we simply pretend it does
* but that it makes no use of the start, end constraints: */
#define glDrawRangeElements(mode, start, end, count, type, indices) \
glDrawElements (mode, count, type, indices)
-#endif
+
+#else /* HAVE_COGL_GL */
+
+#define glDrawRangeElements(mode, start, end, count, type, indices) \
+ ctx->pf_glDrawRangeElements (mode, start, end, count, type, indices)
+
+#endif /* HAVE_COGL_GL */
static void _cogl_mesh_free (CoglMesh *mesh);
const GLvoid *indices)
{
CoglMesh *mesh;
+
+ _COGL_GET_CONTEXT (ctx, NO_RETVAL);
if (!cogl_is_mesh (handle))
return;
_context->pf_glUniformMatrix2fvARB = NULL;
_context->pf_glUniformMatrix3fvARB = NULL;
_context->pf_glUniformMatrix4fvARB = NULL;
+
+ _context->pf_glDrawRangeElements = NULL;
/* Init OpenGL state */
GE( glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE) );
COGL_PFNGLUNIFORMMATRIX2FVARBPROC pf_glUniformMatrix2fvARB;
COGL_PFNGLUNIFORMMATRIX3FVARBPROC pf_glUniformMatrix3fvARB;
COGL_PFNGLUNIFORMMATRIX4FVARBPROC pf_glUniformMatrix4fvARB;
+
+ COGL_PFNGLDRAWRANGEELEMENTSPROC pf_glDrawRangeElements;
} CoglContext;
CoglContext *
GLboolean transpose,
const GLfloat *value);
+typedef void
+ (APIENTRYP COGL_PFNGLDRAWRANGEELEMENTSPROC)
+ (GLenum mode,
+ GLuint start,
+ GLuint end,
+ GLsizei count,
+ GLenum type,
+ const GLvoid *indices);
+
G_END_DECLS
#endif
flags |= COGL_FEATURE_VBOS;
}
+ /* This should always be available because it is defined in GL 1.2,
+ but we can't call it directly because under Windows functions >
+ 1.1 aren't exported */
+ ctx->pf_glDrawRangeElements =
+ (COGL_PFNGLDRAWRANGEELEMENTSPROC)
+ cogl_get_proc_address ("glDrawRangeElements");
+
/* Cache features */
ctx->feature_flags = flags;
ctx->features_cached = TRUE;