mesa: fix signed/unsigned sscanf() warning in _mesa_override_glsl_version()
[mesa.git] / src / mesa / main / api_noop.c
index 9a36394d65e45570773e1aed8ec99c81ffa73353..c4ac95c986aa7353189079e27ebd0046b7ec1949 100644 (file)
@@ -30,6 +30,7 @@
 #include "context.h"
 #include "light.h"
 #include "macros.h"
+#include "mfeatures.h"
 #include "dlist.h"
 #include "eval.h"
 #include "main/dispatch.h"
@@ -679,6 +680,16 @@ static void GLAPIENTRY _mesa_noop_End( void )
 }
 
 
+/***
+ * PrimitiveRestart called outside glBegin()/End(): raise an error
+ */
+static void GLAPIENTRY _mesa_noop_PrimitiveRestartNV( void )
+{
+   GET_CURRENT_CONTEXT(ctx);
+   _mesa_error(ctx, GL_INVALID_OPERATION, "glPrimitiveRestartNV(no glBegin)");
+}
+
+
 /**
  * Execute a glRectf() function.  This is not suitable for GL_COMPILE
  * modes (as the test for outside begin/end is not compiled),
@@ -881,6 +892,8 @@ _mesa_noop_EvalMesh1( GLenum mode, GLint i1, GLint i2 )
    GLfloat u, du;
    GLenum prim;
 
+   ASSERT_OUTSIDE_BEGIN_END(ctx);
+
    switch (mode) {
    case GL_POINT:
       prim = GL_POINTS;
@@ -919,6 +932,8 @@ _mesa_noop_EvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 )
    GLfloat u, du, v, dv, v1, u1;
    GLint i, j;
 
+   ASSERT_OUTSIDE_BEGIN_END(ctx);
+
    switch (mode) {
    case GL_POINT:
    case GL_LINE:
@@ -1007,6 +1022,8 @@ _mesa_noop_vtxfmt_init( GLvertexformat *vfmt )
    vfmt->EdgeFlag = _mesa_noop_EdgeFlag;
    vfmt->End = _mesa_noop_End;
 
+   vfmt->PrimitiveRestartNV = _mesa_noop_PrimitiveRestartNV;
+
    _MESA_INIT_EVAL_VTXFMT(vfmt, _mesa_noop_);
 
    vfmt->FogCoordfEXT = _mesa_noop_FogCoordfEXT;