Implements GetRenderbufferParameteriv
TRAC #11877
Signed-off-by: Andrew Lewycky
Signed-off-by: Daniel Koch

Author:    Shannon Woods

git-svn-id: https://angleproject.googlecode.com/svn/trunk@168 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libGLESv2/Renderbuffer.cpp b/src/libGLESv2/Renderbuffer.cpp
index 86796f0..3d267ef 100644
--- a/src/libGLESv2/Renderbuffer.cpp
+++ b/src/libGLESv2/Renderbuffer.cpp
@@ -19,6 +19,7 @@
 {
     mWidth = 0;
     mHeight = 0;
+    mFormat = GL_RGBA4; // default format, needs to be one of the expected renderbuffer formats
 }
 
 Renderbuffer::~Renderbuffer()
@@ -60,6 +61,11 @@
     return mHeight;
 }
 
+GLenum Renderbuffer::getFormat()
+{
+    return mFormat;
+}
+
 Colorbuffer::Colorbuffer(IDirect3DSurface9 *renderTarget) : mRenderTarget(renderTarget)
 {
     if (renderTarget)
@@ -95,11 +101,13 @@
     {
         mWidth = width;
         mHeight = height;
+        mFormat = format;
     }
     else
     {
         mWidth = 0;
         mHeight = 0;
+        mFormat = GL_RGBA4;
     }
 }
 
@@ -184,6 +192,9 @@
 
         mWidth = description.Width;
         mHeight = description.Height;
+        mFormat = GL_DEPTH_COMPONENT16; // If the renderbuffer parameters are queried, the calling function
+                                        // will expect one of the valid renderbuffer formats for use in 
+                                        // glRenderbufferStorage
     }
 }
 
@@ -207,11 +218,15 @@
     {
         mWidth = width;
         mHeight = height;
+        mFormat = GL_DEPTH_COMPONENT16; // If the renderbuffer parameters are queried, the calling function
+                                        // will expect one of the valid renderbuffer formats for use in 
+                                        // glRenderbufferStorage
     }
     else
     {
         mWidth = 0;
         mHeight = 0;
+        mFormat = GL_RGBA4; //default format
     }
 }
 
@@ -257,6 +272,9 @@
 
         mWidth = description.Width;
         mHeight = description.Height;
+        mFormat = GL_STENCIL_INDEX8; // If the renderbuffer parameters are queried, the calling function
+                                     // will expect one of the valid renderbuffer formats for use in 
+                                     // glRenderbufferStorage
     }
 }
 
@@ -280,11 +298,15 @@
     {
         mWidth = width;
         mHeight = height;
+        mFormat = GL_STENCIL_INDEX8; // If the renderbuffer parameters are queried, the calling function
+                                     // will expect one of the valid renderbuffer formats for use in 
+                                     // glRenderbufferStorage
     }
     else
     {
         mWidth = 0;
         mHeight = 0;
+        mFormat = GL_RGBA4; //default format
     }
 }