mojoshader.h
branchtrunk
changeset 262 0f1531ac2578
parent 245 1f04b805a4f2
child 276 1d7437469c94
equal deleted inserted replaced
261:929496882e30 262:0f1531ac2578
   353  */
   353  */
   354 typedef struct MOJOSHADER_glContext MOJOSHADER_glContext;
   354 typedef struct MOJOSHADER_glContext MOJOSHADER_glContext;
   355 typedef struct MOJOSHADER_glShader MOJOSHADER_glShader;
   355 typedef struct MOJOSHADER_glShader MOJOSHADER_glShader;
   356 typedef struct MOJOSHADER_glProgram MOJOSHADER_glProgram;
   356 typedef struct MOJOSHADER_glProgram MOJOSHADER_glProgram;
   357 
   357 
       
   358 
       
   359 /*
       
   360  * Determine the best profile to use for the current system.
       
   361  *
       
   362  * You do not need to call this if all you want is MOJOSHADER_parse().
       
   363  *
       
   364  * You can only call this AFTER you have successfully built your GL context
       
   365  *  and made it current. This function will lookup the GL functions it needs
       
   366  *  through the callback you supply. The lookup function is neither stored nor
       
   367  *  used by MojoShader after this function returns, nor are the functions it
       
   368  *  might look up.
       
   369  *
       
   370  * Returns the name of the "best" profile on success, NULL if none of the
       
   371  *  available profiles will work on this system. "Best" is a relative term,
       
   372  *  but it generally means the best trade off between feature set and
       
   373  *  performance. The selection algorithm may be arbitrary and complex.
       
   374  *
       
   375  * The returned value is an internal static string, and should not be free()'d
       
   376  *  by the caller. If you get a NULL, calling MOJOSHADER_glGetError() might
       
   377  *  shed some light on why.
       
   378  *
       
   379  * This call is NOT thread safe! As most OpenGL implementations are not thread
       
   380  *  safe, you should probably only call this from the same thread that created
       
   381  *  the GL context.
       
   382  */
       
   383 const char *MOJOSHADER_glBestProfile(void *(*lookup)(const char *fnname));
       
   384 
       
   385 
   358 /*
   386 /*
   359  * Prepare MojoShader to manage OpenGL shaders.
   387  * Prepare MojoShader to manage OpenGL shaders.
   360  *
   388  *
   361  * You do not need to call this if all you want is MOJOSHADER_parse().
   389  * You do not need to call this if all you want is MOJOSHADER_parse().
   362  *
   390  *