diff options
author | David Li <davidxli@google.com> | 2011-03-01 16:54:04 -0800 |
---|---|---|
committer | David Li <davidxli@google.com> | 2011-03-08 17:41:29 -0800 |
commit | af94ceb5df8c7ee21d84a58caa5f632663d4e1b0 (patch) | |
tree | d4d71fbdd5d9119619d35a3a933f892a50124853 /opengl/libagl2/src/get.cpp | |
parent | b57af729808cc33f470afaf266b857a3e91ca3e7 (diff) | |
download | frameworks_base-af94ceb5df8c7ee21d84a58caa5f632663d4e1b0.zip frameworks_base-af94ceb5df8c7ee21d84a58caa5f632663d4e1b0.tar.gz frameworks_base-af94ceb5df8c7ee21d84a58caa5f632663d4e1b0.tar.bz2 |
Initial commit of libAgl2 using Pixelflinger2 in external/mesa3d
Somewhat functional, refer to README for details.
Need to enable Android.mk to build.
It builds libGLES_android.so, which needs to replace
the one in system/lib/egl built by libagl.
Change-Id: Iec3aaa8f3963a4185d81955cd24019eb0c4a5850
Signed-off-by: David Li <davidxli@google.com>
Diffstat (limited to 'opengl/libagl2/src/get.cpp')
-rw-r--r-- | opengl/libagl2/src/get.cpp | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/opengl/libagl2/src/get.cpp b/opengl/libagl2/src/get.cpp new file mode 100644 index 0000000..13c28ce --- /dev/null +++ b/opengl/libagl2/src/get.cpp @@ -0,0 +1,79 @@ +#include "gles2context.h" + +static char const * const gVendorString = "Android"; +static char const * const gRendererString = "Android PixelFlinger2 0.0"; +static char const * const gVersionString = "OpenGL ES 2.0"; +static char const * const gExtensionsString = +// "GL_OES_byte_coordinates " // OK +// "GL_OES_fixed_point " // OK +// "GL_OES_single_precision " // OK +// "GL_OES_read_format " // OK +// "GL_OES_compressed_paletted_texture " // OK +// "GL_OES_draw_texture " // OK +// "GL_OES_matrix_get " // OK +// "GL_OES_query_matrix " // OK +// // "GL_OES_point_size_array " // TODO +// // "GL_OES_point_sprite " // TODO +// "GL_OES_EGL_image " // OK +//#ifdef GL_OES_compressed_ETC1_RGB8_texture +// "GL_OES_compressed_ETC1_RGB8_texture " // OK +//#endif +// "GL_ARB_texture_compression " // OK +// "GL_ARB_texture_non_power_of_two " // OK +// "GL_ANDROID_user_clip_plane " // OK +// "GL_ANDROID_vertex_buffer_object " // OK +// "GL_ANDROID_generate_mipmap " // OK + "" + ; + +void glGetIntegerv(GLenum pname, GLint* params) +{ + switch (pname) { + case GL_MAX_TEXTURE_SIZE : + *params = 4096; // limit is in precision of texcoord calculation, which uses 16.16 + break; + case GL_MAX_VERTEX_ATTRIBS: + *params = GGL_MAXVERTEXATTRIBS; + break; + case GL_MAX_VERTEX_UNIFORM_VECTORS: + *params = GGL_MAXVERTEXUNIFORMVECTORS; + break; + case GL_MAX_VARYING_VECTORS: + *params = GGL_MAXVARYINGVECTORS; + break; + case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS: + *params = GGL_MAXCOMBINEDTEXTUREIMAGEUNITS; + break; + case GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS: + *params = GGL_MAXVERTEXTEXTUREIMAGEUNITS; + break; + case GL_MAX_TEXTURE_IMAGE_UNITS: + *params = GGL_MAXTEXTUREIMAGEUNITS; + break; + case GL_MAX_FRAGMENT_UNIFORM_VECTORS: + *params = GGL_MAXFRAGMENTUNIFORMVECTORS; + break; + case GL_ALIASED_LINE_WIDTH_RANGE: + *params = 1; // TODO: not implemented + break; + default: + LOGD("agl2: glGetIntegerv 0x%.4X", pname); + assert(0); + } +} + +const GLubyte* glGetString(GLenum name) +{ + switch (name) { + case GL_VENDOR: + return (const GLubyte*)gVendorString; + case GL_RENDERER: + return (const GLubyte*)gRendererString; + case GL_VERSION: + return (const GLubyte*)gVersionString; + case GL_EXTENSIONS: + return (const GLubyte*)gExtensionsString; + } + assert(0); //(c, GL_INVALID_ENUM); + return 0; +} |