X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=glaze.h;h=198ec5b797b4ff9cf8167b625d1c529628de5ef6;hb=85faa290c2777d8e89af05648c229b0da395d4f7;hp=325483a86f1e480fa8f93480cc1f090d06fe12e8;hpb=fded9f20d5f5c92bd5af051117327816dda0238e;p=glaze diff --git a/glaze.h b/glaze.h index 325483a..198ec5b 100644 --- a/glaze.h +++ b/glaze.h @@ -100,4 +100,29 @@ glaze_lookup (char *function); void glaze_execute (int argc, char *argv[], const char *wrapper); +/* Register a callback function to be called when the first GL + * function, (not glX function) is called. + * + * It's common for Glaze-using libraries to need to do some + * initialization that can only be done once a valid OpenGL context is + * initialized. For example, the library may need to query what kind + * of context has been created. + * + * This function can be used for this purpose. It arranges for a + * function in the wrapper library to be called immediately before the + * first call to an OpenGL function by the application. Note that any + * window-system-sepecific function calls (such as glX functions) are + * not considered "an OpenGL function" for this purpose. + * + * The 'function_name' argument here should be the name of an exported + * function in the wrapper library passed to glaze_exectute, (or + * specified in the GLAZE_WRAPPER variable). The function must have a + * return type of void and must accept no arguments, so should have a + * signature such as: + * + * void function (void); + */ +void +glaze_set_first_gl_call_callback (const char *function_name); + #endif /* GLAZE_H */