Go to the source code of this file.
Functions | |
static void | get_preferred_read_format_type (GLcontext *ctx, GLint *format, GLint *type) |
glGet functions | |
static GLboolean | st_GetIntegerv (GLcontext *ctx, GLenum pname, GLint *params) |
We only intercept the OES preferred ReadPixels format/type. | |
void | st_init_get_functions (struct dd_function_table *functions) |
static void get_preferred_read_format_type | ( | GLcontext * | ctx, | |
GLint * | format, | |||
GLint * | type | |||
) | [static] |
glGet functions
Definition at line 50 of file st_cb_get.c.
References st_renderbuffer::format, PIPE_FORMAT_A8R8G8B8_UNORM, and st_renderbuffer().
00051 { 00052 struct gl_framebuffer *fb = ctx->ReadBuffer; 00053 struct st_renderbuffer *strb = st_renderbuffer(fb->_ColorReadBuffer); 00054 00055 /* defaults */ 00056 *format = ctx->Const.ColorReadFormat; 00057 *type = ctx->Const.ColorReadType; 00058 00059 if (strb) { 00060 /* XXX could add more cases here... */ 00061 if (strb->format == PIPE_FORMAT_A8R8G8B8_UNORM) { 00062 *format = GL_BGRA; 00063 if (_mesa_little_endian()) 00064 *type = GL_UNSIGNED_INT_8_8_8_8_REV; 00065 else 00066 *type = GL_UNSIGNED_INT_8_8_8_8; 00067 } 00068 } 00069 }
static GLboolean st_GetIntegerv | ( | GLcontext * | ctx, | |
GLenum | pname, | |||
GLint * | params | |||
) | [static] |
We only intercept the OES preferred ReadPixels format/type.
Everything else goes to the default _mesa_GetIntegerv.
Definition at line 77 of file st_cb_get.c.
References get_preferred_read_format_type().
00078 { 00079 GLint dummy; 00080 00081 switch (pname) { 00082 case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES: 00083 get_preferred_read_format_type(ctx, &dummy, params); 00084 return GL_TRUE; 00085 case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES: 00086 get_preferred_read_format_type(ctx, params, &dummy); 00087 return GL_TRUE; 00088 default: 00089 return GL_FALSE; 00090 } 00091 }
void st_init_get_functions | ( | struct dd_function_table * | functions | ) |
Definition at line 94 of file st_cb_get.c.
References st_GetIntegerv().
00095 { 00096 functions->GetIntegerv = st_GetIntegerv; 00097 }