Added MOJOSHADER_glGetShaderParseData(). trunk
authorRyan C. Gordon <icculus@icculus.org>
Mon, 28 Apr 2008 23:14:14 -0400
branchtrunk
changeset 245 1f04b805a4f2
parent 244 30ceb789b9a1
child 246 897868fdd958
Added MOJOSHADER_glGetShaderParseData().
mojoshader.h
mojoshader_opengl.c
--- a/mojoshader.h	Mon Apr 28 22:14:19 2008 -0400
+++ b/mojoshader.h	Mon Apr 28 23:14:14 2008 -0400
@@ -455,6 +455,16 @@
 MOJOSHADER_glShader *MOJOSHADER_glCompileShader(const unsigned char *tokenbuf,
                                                 const unsigned int bufsize);
 
+
+/*
+ * Get the MOJOSHADER_parseData structure that was produced from the
+ *  call to MOJOSHADER_glCompileShader().
+ *
+ * This data is read-only, and you should NOT attempt to free it. This
+ *  pointer remains valid until the shader is deleted.
+ */
+const MOJOSHADER_parseData *MOJOSHADER_glGetShaderParseData(
+                                                MOJOSHADER_glShader *shader);
 /*
  * Link a vertex and pixel shader into an OpenGL program.
  *  (vshader) or (pshader) can be NULL, to specify that the GL should use the
--- a/mojoshader_opengl.c	Mon Apr 28 22:14:19 2008 -0400
+++ b/mojoshader_opengl.c	Mon Apr 28 23:14:14 2008 -0400
@@ -401,6 +401,13 @@
 } // MOJOSHADER_glCompileShader
 
 
+const MOJOSHADER_parseData *MOJOSHADER_glGetShaderParseData(
+                                                MOJOSHADER_glShader *shader)
+{
+    return (shader != NULL) ? shader->parseData : NULL;
+} // MOJOSHADER_glGetShaderParseData
+
+
 static void shader_unref(MOJOSHADER_glShader *shader)
 {
     if (shader != NULL)