summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2004-10-16 01:16:54 +0000
committerIan Romanick <[email protected]>2004-10-16 01:16:54 +0000
commit33899b7c351fda77bed6dee5e5d02e31c2f7e0e5 (patch)
tree4bd56b79459db045b187e6aabc5027f359f80721 /src
parent83c74b72792928b5a5ac540eeef65fca3145ddb6 (diff)
Add support for OES_read_format. As soon as glext.h is updated with the
enums for this extension, the changes to gl.h can be removed.
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/context.c3
-rw-r--r--src/mesa/main/extensions.c1
-rw-r--r--src/mesa/main/get.c28
-rw-r--r--src/mesa/main/mtypes.h4
4 files changed, 36 insertions, 0 deletions
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 44e3fcb9adc..f90751fd092 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -1114,6 +1114,9 @@ _mesa_init_constants( GLcontext *ctx )
ctx->Const.MaxDrawBuffers = MAX_DRAW_BUFFERS;
+ ctx->Const.ColorReadFormat = GL_RGBA;
+ ctx->Const.ColorReadType = GL_UNSIGNED_BYTE;
+
/* sanity checks */
ASSERT(ctx->Const.MaxTextureUnits == MAX2(ctx->Const.MaxTextureImageUnits, ctx->Const.MaxTextureCoordUnits));
}
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index a8003116fad..11c7ae55384 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -141,6 +141,7 @@ static const struct {
{ ON, "GL_NV_texgen_reflection", F(NV_texgen_reflection) },
{ OFF, "GL_NV_vertex_program", F(NV_vertex_program) },
{ OFF, "GL_NV_vertex_program1_1", F(NV_vertex_program1_1) },
+ { ON, "GL_OES_read_format", F(OES_read_format) },
{ OFF, "GL_SGI_color_matrix", F(SGI_color_matrix) },
{ OFF, "GL_SGI_color_table", F(SGI_color_table) },
{ OFF, "GL_SGI_texture_color_table", F(SGI_texture_color_table) },
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 6eac604ea51..646e6ac20fc 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -1723,6 +1723,13 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
}
break;
+ case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES:
+ *params = INT_TO_BOOL(ctx->Const.ColorReadType);
+ return;
+ case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES:
+ *params = INT_TO_BOOL(ctx->Const.ColorReadFormat);
+ return;
+
default:
_mesa_error(ctx, GL_INVALID_ENUM, "glGetBooleanv(pname=0x%x)", pname);
}
@@ -3317,6 +3324,13 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
}
break;
+ case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES:
+ *params = (GLdouble) ctx->Const.ColorReadType;
+ return;
+ case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES:
+ *params = (GLdouble) ctx->Const.ColorReadFormat;
+ return;
+
default:
_mesa_error(ctx, GL_INVALID_ENUM, "glGetDoublev(pname=0x%x)", pname);
}
@@ -4887,6 +4901,13 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
}
break;
+ case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES:
+ *params = (GLfloat) ctx->Const.ColorReadType;
+ return;
+ case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES:
+ *params = (GLfloat) ctx->Const.ColorReadFormat;
+ return;
+
default:
_mesa_error(ctx, GL_INVALID_ENUM, "glGetFloatv(0x%x)", pname);
}
@@ -6495,6 +6516,13 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
}
break;
+ case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES:
+ *params = ctx->Const.ColorReadType;
+ return;
+ case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES:
+ *params = ctx->Const.ColorReadFormat;
+ return;
+
default:
_mesa_error(ctx, GL_INVALID_ENUM, "glGetIntegerv(pname=0x%x)", pname);
}
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 4086ef94bed..37b940dea9d 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -1913,6 +1913,9 @@ struct gl_constants
GLboolean CheckArrayBounds;
/* GL_ARB_draw_buffers */
GLuint MaxDrawBuffers;
+ /* GL_OES_read_format */
+ GLenum ColorReadFormat;
+ GLenum ColorReadType;
};
@@ -2015,6 +2018,7 @@ struct gl_extensions
GLboolean NV_texture_rectangle;
GLboolean NV_vertex_program;
GLboolean NV_vertex_program1_1;
+ GLboolean OES_read_format;
GLboolean SGI_color_matrix;
GLboolean SGI_color_table;
GLboolean SGI_texture_color_table;