Implements glGetUniform
TRAC #11647
Signed-off-by: Andrew Lewycky
Signed-off-by: Daniel Koch
Author: Shannon Woods
git-svn-id: https://angleproject.googlecode.com/svn/trunk@123 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libGLESv2/libGLESv2.cpp b/src/libGLESv2/libGLESv2.cpp
index fd81a9e..61fbed1 100644
--- a/src/libGLESv2/libGLESv2.cpp
+++ b/src/libGLESv2/libGLESv2.cpp
@@ -2286,7 +2286,27 @@
try
{
- UNIMPLEMENTED(); // FIXME
+ gl::Context *context = gl::getContext();
+
+ if (context)
+ {
+ if (program == 0)
+ {
+ return error(GL_INVALID_VALUE);
+ }
+
+ gl::Program *programObject = context->getProgram(program);
+
+ if (!programObject || !programObject->isLinked())
+ {
+ return error(GL_INVALID_OPERATION);
+ }
+
+ if (!programObject->getUniformfv(location, params))
+ {
+ return error(GL_INVALID_OPERATION);
+ }
+ }
}
catch(std::bad_alloc&)
{
@@ -2300,7 +2320,32 @@
try
{
- UNIMPLEMENTED(); // FIXME
+ gl::Context *context = gl::getContext();
+
+ if (context)
+ {
+ if (program == 0)
+ {
+ return error(GL_INVALID_VALUE);
+ }
+
+ gl::Program *programObject = context->getProgram(program);
+
+ if (!programObject || !programObject->isLinked())
+ {
+ return error(GL_INVALID_OPERATION);
+ }
+
+ if (!programObject)
+ {
+ return error(GL_INVALID_OPERATION);
+ }
+
+ if (!programObject->getUniformiv(location, params))
+ {
+ return error(GL_INVALID_OPERATION);
+ }
+ }
}
catch(std::bad_alloc&)
{