Kaydet (Commit) 0e6e0cea authored tarafından Tor Lillqvist's avatar Tor Lillqvist

Add OpenGLContext::UseNoProgram()

Will be useful in cases where there is some external library code that uses
shaders outside of our OpenGLContext.

Change-Id: I59c57e3225f55d13e69b6a9b7c0db1a7487c586d
üst c33a6359
...@@ -167,6 +167,7 @@ public: ...@@ -167,6 +167,7 @@ public:
// retrieve a program from the cache or compile/link it // retrieve a program from the cache or compile/link it
OpenGLProgram* GetProgram( const OUString& rVertexShader, const OUString& rFragmentShader, const OString& preamble = "" ); OpenGLProgram* GetProgram( const OUString& rVertexShader, const OUString& rFragmentShader, const OString& preamble = "" );
OpenGLProgram* UseProgram( const OUString& rVertexShader, const OUString& rFragmentShader, const OString& preamble = "" ); OpenGLProgram* UseProgram( const OUString& rVertexShader, const OUString& rFragmentShader, const OString& preamble = "" );
void UseNoProgram();
/// Is this GL context the current context ? /// Is this GL context the current context ?
bool isCurrent(); bool isCurrent();
......
...@@ -1732,4 +1732,14 @@ OpenGLProgram* OpenGLContext::UseProgram( const OUString& rVertexShader, const O ...@@ -1732,4 +1732,14 @@ OpenGLProgram* OpenGLContext::UseProgram( const OUString& rVertexShader, const O
return mpCurrentProgram; return mpCurrentProgram;
} }
void OpenGLContext::UseNoProgram()
{
if( mpCurrentProgram == NULL )
return;
mpCurrentProgram = NULL;
glUseProgram( 0 );
CHECK_GL_ERROR();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment