Skip to content

Commit

Permalink
Added MOJOSHADER_glGetShaderParseData().
Browse files Browse the repository at this point in the history
--HG--
branch : trunk
  • Loading branch information
icculus committed Apr 29, 2008
1 parent 2768ea9 commit 37d2c5b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
10 changes: 10 additions & 0 deletions mojoshader.h
Expand Up @@ -455,6 +455,16 @@ const char *MOJOSHADER_glGetError(void);
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
Expand Down
7 changes: 7 additions & 0 deletions mojoshader_opengl.c
Expand Up @@ -401,6 +401,13 @@ MOJOSHADER_glShader *MOJOSHADER_glCompileShader(const unsigned char *tokenbuf,
} // 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)
Expand Down

0 comments on commit 37d2c5b

Please sign in to comment.