summaryrefslogtreecommitdiffstats
path: root/src/mesa/es/main/es_fbo.c
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2009-09-21 17:57:57 +0800
committerBrian Paul <[email protected]>2009-11-05 20:04:20 -0700
commitbfa66bd6f941920cf32ce79fb103c3755b4dd8fb (patch)
tree180a41b8262fc3d6dd80ad498889fd65dd260b49 /src/mesa/es/main/es_fbo.c
parentf68bf0621d1f865033b078191c1f4ec1fa0bbc5c (diff)
mesa/es: Add OpenGL ES overlay.
This is primitive support for OpenGL ES. It uses a subset of mesa sources to build libesXgallium.a and libesXapi.a, where X is 1 for OpenGL ES 1.x, 2 for OpenGL ES 2.x. The static libraries serve the same purpose as libmesagallium.a and libglapi.a do for OpenGL. This is based on the work of opengl-es branch. Signed-off-by: Chia-I Wu <[email protected]>
Diffstat (limited to 'src/mesa/es/main/es_fbo.c')
-rw-r--r--src/mesa/es/main/es_fbo.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/mesa/es/main/es_fbo.c b/src/mesa/es/main/es_fbo.c
new file mode 100644
index 00000000000..545c46ca99c
--- /dev/null
+++ b/src/mesa/es/main/es_fbo.c
@@ -0,0 +1,37 @@
+/**************************************************************************
+ *
+ * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ **************************************************************************/
+
+
+#include "GLES2/gl2.h"
+#include "GLES2/gl2ext.h"
+
+
+extern void GL_APIENTRY _es_RenderbufferStorage(GLenum target, GLenum internalFormat, GLsizei width, GLsizei height);
+
+extern void GL_APIENTRY _mesa_RenderbufferStorageEXT(GLenum target, GLenum internalFormat, GLsizei width, GLsizei height);
+
+
+void GL_APIENTRY
+_es_RenderbufferStorage(GLenum target, GLenum internalFormat,
+ GLsizei width, GLsizei height)
+{
+ switch (internalFormat) {
+ case GL_RGBA4:
+ case GL_RGB5_A1:
+ case GL_RGB565:
+ internalFormat = GL_RGBA;
+ break;
+ case GL_STENCIL_INDEX1_OES:
+ case GL_STENCIL_INDEX4_OES:
+ case GL_STENCIL_INDEX8:
+ internalFormat = GL_STENCIL_INDEX;
+ break;
+ default:
+ ; /* no op */
+ }
+ _mesa_RenderbufferStorageEXT(target, internalFormat, width, height);
+}