mojoshader.h
changeset 1068 89f0be59ad5d
parent 1066 ff14db741834
child 1090 636ffcd3f14a
equal deleted inserted replaced
1067:e6397ec11bc9 1068:89f0be59ad5d
  2703  * This call requires a valid MOJOSHADER_glContext to have been made current,
  2703  * This call requires a valid MOJOSHADER_glContext to have been made current,
  2704  *  or it will crash your program. See MOJOSHADER_glMakeContextCurrent().
  2704  *  or it will crash your program. See MOJOSHADER_glMakeContextCurrent().
  2705  */
  2705  */
  2706 void MOJOSHADER_glBindProgram(MOJOSHADER_glProgram *program);
  2706 void MOJOSHADER_glBindProgram(MOJOSHADER_glProgram *program);
  2707 
  2707 
  2708 // !!! FIXME: document this.
  2708 /*
       
  2709  * This binds individual shaders as if you had linked them with
       
  2710  *  MOJOSHADER_glLinkProgram(), and used MOJOSHADER_glBindProgram() on the
       
  2711  *  linked result.
       
  2712  *
       
  2713  * MojoShader will handle linking behind the scenes, and keep a cache of
       
  2714  *  programs linked here. Programs are removed from this cache when one of the
       
  2715  *  invidual shaders in it is deleted, otherwise they remain cached so future
       
  2716  *  calls to this function don't need to relink a previously-used shader
       
  2717  *  grouping.
       
  2718  *
       
  2719  * This function is for convenience, as the API is closer to how Direct3D
       
  2720  *  works, and retrofitting linking into your app can be difficult;
       
  2721  *  frequently, you just end up building your own cache, anyhow.
       
  2722  *
       
  2723  * Calling with all shaders set to NULL is equivalent to calling
       
  2724  *  MOJOSHADER_glBindProgram(NULL).
       
  2725  *
       
  2726  * This call is NOT thread safe! As most OpenGL implementations are not thread
       
  2727  *  safe, you should probably only call this from the same thread that created
       
  2728  *  the GL context.
       
  2729  *
       
  2730  * This call requires a valid MOJOSHADER_glContext to have been made current,
       
  2731  *  or it will crash your program. See MOJOSHADER_glMakeContextCurrent().
       
  2732  */
  2709 void MOJOSHADER_glBindShaders(MOJOSHADER_glShader *vshader,
  2733 void MOJOSHADER_glBindShaders(MOJOSHADER_glShader *vshader,
  2710                               MOJOSHADER_glShader *pshader);
  2734                               MOJOSHADER_glShader *pshader);
  2711 
  2735 
  2712 /*
  2736 /*
  2713  * Set a floating-point uniform value (what Direct3D calls a "constant").
  2737  * Set a floating-point uniform value (what Direct3D calls a "constant").