summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/get.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>1999-11-11 01:22:25 +0000
committerBrian Paul <[email protected]>1999-11-11 01:22:25 +0000
commitfbd8f212c3866ec98c1d8c9d3db3ddb7e7c479a5 (patch)
treefb9ea4452e1f65c6e3c11ee4c4f17c023f8262e5 /src/mesa/main/get.c
parent06ac59281bdad6679fb1941e31e3c4df1c12cede (diff)
first big check-in of new Mesa 3.3 code
Diffstat (limited to 'src/mesa/main/get.c')
-rw-r--r--src/mesa/main/get.c85
1 files changed, 55 insertions, 30 deletions
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 25544d01263..165b9589ed5 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -1,8 +1,8 @@
-/* $Id: get.c,v 1.5 1999/10/17 22:36:35 brianp Exp $ */
+/* $Id: get.c,v 1.6 1999/11/11 01:22:26 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,18 +25,10 @@
*/
-/* $XFree86: xc/lib/GL/mesa/src/get.c,v 1.3 1999/04/04 00:20:25 dawes Exp $ */
-
#ifdef PC_HEADER
#include "all.h"
#else
-#ifndef XFree86Server
-#include <assert.h>
-#include <stdio.h>
-#include <string.h>
-#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "context.h"
#include "enable.h"
#include "enums.h"
@@ -66,8 +58,10 @@
-void gl_GetBooleanv( GLcontext *ctx, GLenum pname, GLboolean *params )
+void
+_mesa_GetBooleanv( GLenum pname, GLboolean *params )
{
+ GET_CURRENT_CONTEXT(ctx);
GLuint i;
GLuint texUnit = ctx->Texture.CurrentUnit;
GLuint texTransformUnit = ctx->Texture.CurrentTransformUnit;
@@ -748,13 +742,13 @@ void gl_GetBooleanv( GLcontext *ctx, GLenum pname, GLboolean *params )
*params = INT_TO_BOOL(0); /* TODO */
break;
case GL_TEXTURE_1D:
- *params = gl_IsEnabled( ctx, GL_TEXTURE_1D );
+ *params = _mesa_IsEnabled(GL_TEXTURE_1D );
break;
case GL_TEXTURE_2D:
- *params = gl_IsEnabled( ctx, GL_TEXTURE_2D );
+ *params = _mesa_IsEnabled(GL_TEXTURE_2D );
break;
case GL_TEXTURE_3D:
- *params = gl_IsEnabled( ctx, GL_TEXTURE_3D );
+ *params = _mesa_IsEnabled(GL_TEXTURE_3D );
break;
case GL_TEXTURE_BINDING_1D:
*params = INT_TO_BOOL(textureUnit->CurrentD[1]->Name);
@@ -978,8 +972,10 @@ void gl_GetBooleanv( GLcontext *ctx, GLenum pname, GLboolean *params )
-void gl_GetDoublev( GLcontext *ctx, GLenum pname, GLdouble *params )
+void
+_mesa_GetDoublev( GLenum pname, GLdouble *params )
{
+ GET_CURRENT_CONTEXT(ctx);
GLuint i;
GLuint texUnit = ctx->Texture.CurrentUnit;
GLuint texTransformUnit = ctx->Texture.CurrentTransformUnit;
@@ -1660,13 +1656,13 @@ void gl_GetDoublev( GLcontext *ctx, GLenum pname, GLdouble *params )
*params = 0.0; /* TODO */
break;
case GL_TEXTURE_1D:
- *params = gl_IsEnabled(ctx, GL_TEXTURE_1D) ? 1.0 : 0.0;
+ *params = _mesa_IsEnabled(GL_TEXTURE_1D) ? 1.0 : 0.0;
break;
case GL_TEXTURE_2D:
- *params = gl_IsEnabled(ctx, GL_TEXTURE_2D) ? 1.0 : 0.0;
+ *params = _mesa_IsEnabled(GL_TEXTURE_2D) ? 1.0 : 0.0;
break;
case GL_TEXTURE_3D:
- *params = gl_IsEnabled(ctx, GL_TEXTURE_3D) ? 1.0 : 0.0;
+ *params = _mesa_IsEnabled(GL_TEXTURE_3D) ? 1.0 : 0.0;
break;
case GL_TEXTURE_BINDING_1D:
*params = (GLdouble) textureUnit->CurrentD[1]->Name;
@@ -1893,8 +1889,10 @@ void gl_GetDoublev( GLcontext *ctx, GLenum pname, GLdouble *params )
-void gl_GetFloatv( GLcontext *ctx, GLenum pname, GLfloat *params )
+void
+_mesa_GetFloatv( GLenum pname, GLfloat *params )
{
+ GET_CURRENT_CONTEXT(ctx);
GLuint i;
GLuint texUnit = ctx->Texture.CurrentUnit;
GLuint texTransformUnit = ctx->Texture.CurrentTransformUnit;
@@ -2572,13 +2570,13 @@ void gl_GetFloatv( GLcontext *ctx, GLenum pname, GLfloat *params )
*params = 0.0F; /* TODO */
break;
case GL_TEXTURE_1D:
- *params = gl_IsEnabled(ctx, GL_TEXTURE_1D) ? 1.0 : 0.0;
+ *params = _mesa_IsEnabled(GL_TEXTURE_1D) ? 1.0 : 0.0;
break;
case GL_TEXTURE_2D:
- *params = gl_IsEnabled(ctx, GL_TEXTURE_2D) ? 1.0 : 0.0;
+ *params = _mesa_IsEnabled(GL_TEXTURE_2D) ? 1.0 : 0.0;
break;
case GL_TEXTURE_3D:
- *params = gl_IsEnabled(ctx, GL_TEXTURE_3D) ? 1.0 : 0.0;
+ *params = _mesa_IsEnabled(GL_TEXTURE_3D) ? 1.0 : 0.0;
break;
case GL_TEXTURE_BINDING_1D:
*params = (GLfloat) textureUnit->CurrentD[1]->Name;
@@ -2802,8 +2800,10 @@ void gl_GetFloatv( GLcontext *ctx, GLenum pname, GLfloat *params )
-void gl_GetIntegerv( GLcontext *ctx, GLenum pname, GLint *params )
+void
+_mesa_GetIntegerv( GLenum pname, GLint *params )
{
+ GET_CURRENT_CONTEXT(ctx);
GLuint i;
GLuint texUnit = ctx->Texture.CurrentUnit;
GLuint texTransformUnit = ctx->Texture.CurrentTransformUnit;
@@ -3485,13 +3485,13 @@ void gl_GetIntegerv( GLcontext *ctx, GLenum pname, GLint *params )
*params = 0; /* TODO */
break;
case GL_TEXTURE_1D:
- *params = gl_IsEnabled(ctx, GL_TEXTURE_1D) ? 1 : 0;
+ *params = _mesa_IsEnabled(GL_TEXTURE_1D) ? 1 : 0;
break;
case GL_TEXTURE_2D:
- *params = gl_IsEnabled(ctx, GL_TEXTURE_2D) ? 1 : 0;
+ *params = _mesa_IsEnabled(GL_TEXTURE_2D) ? 1 : 0;
break;
case GL_TEXTURE_3D:
- *params = gl_IsEnabled(ctx, GL_TEXTURE_3D) ? 1 : 0;
+ *params = _mesa_IsEnabled(GL_TEXTURE_3D) ? 1 : 0;
break;
case GL_TEXTURE_BINDING_1D:
*params = textureUnit->CurrentD[1]->Name;
@@ -3725,8 +3725,10 @@ void gl_GetIntegerv( GLcontext *ctx, GLenum pname, GLint *params )
-void gl_GetPointerv( GLcontext *ctx, GLenum pname, GLvoid **params )
+void
+_mesa_GetPointerv( GLenum pname, GLvoid **params )
{
+ GET_CURRENT_CONTEXT(ctx);
GLuint texUnit = ctx->Texture.CurrentUnit;
/*GLuint texTransformUnit = ctx->Texture.CurrentTransformUnit;*/
@@ -3766,11 +3768,13 @@ void gl_GetPointerv( GLcontext *ctx, GLenum pname, GLvoid **params )
-const GLubyte *gl_GetString( GLcontext *ctx, GLenum name )
+const GLubyte *
+_mesa_GetString( GLenum name )
{
+ GET_CURRENT_CONTEXT(ctx);
static char result[1000];
static char *vendor = "Brian Paul";
- static char *version = "1.2 Mesa 3.1 beta";
+ static char *version = "1.2 Mesa 3.3 beta";
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, "glGetString", 0);
@@ -3811,3 +3815,24 @@ const GLubyte *gl_GetString( GLcontext *ctx, GLenum name )
return NULL;
}
}
+
+
+/*
+ * Execute a glGetError command
+ */
+GLenum
+_mesa_GetError( void )
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ GLenum e = ctx->ErrorValue;
+
+ ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL( ctx, "glGetError", (GLenum) 0);
+
+ if (MESA_VERBOSE & VERBOSE_API)
+ fprintf(stderr, "glGetError <-- %s\n", gl_lookup_enum_by_nr(e));
+
+ ctx->ErrorValue = (GLenum) GL_NO_ERROR;
+ return e;
+}
+