API design change. trunk
authorRyan C. Gordon <icculus@icculus.org>
Fri, 25 Apr 2008 23:15:52 -0400
branchtrunk
changeset 197 2ad08d31ea93
parent 196 5715754e5549
child 198 e69f11a7b700
API design change. We'll reference count shaders/programs internally so there's no concern about deleting an in-use object.
mojoshader.h
--- a/mojoshader.h	Fri Apr 25 21:12:42 2008 -0400
+++ b/mojoshader.h	Fri Apr 25 23:15:52 2008 -0400
@@ -513,8 +513,8 @@
  * Free the resources of a linked program. This will delete the GL object
  *  and free memory.
  *
- * You must not call this on a bound program! Either bind a different one
- *  or call MOJOSHADER_glBindProgram(NULL) first to unbind it.
+ * If the program is currently bound by MOJOSHADER_glBindProgram(), it will
+ *  be deleted as soon as it becomes unbound.
  */
 void MOJOSHADER_glDeleteProgram(const MOJOSHADER_glProgram *program);
 
@@ -522,8 +522,8 @@
  * Free the resources of a compiled shader. This will delete the GL object
  *  and free memory.
  *
- * You must not call this on a shader that's currently linked in a program.
- *  Call MOJOSHADER_glDeleteProgram() on any programs, first.
+ * If the shader is currently referenced by a linked program, it will
+ *  be deleted as soon as all referencing programs are deleted, too.
  */
 void MOJOSHADER_glDeleteShader(const MOJOSHADER_glShader *shader);