File tree Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Original file line number Diff line number Diff line change 55extern "C" {
66#endif
77
8+ /**
9+ * @brief Initialize the OpenGL Validation Layer
10+ * @param gl_version_major OpenGL context major version.
11+ * @param gl_version_minor OpenGL context minor version.
12+ * @return 0 on success, any other value on error.
13+ */
814int gl_layer_init (unsigned int gl_version_major , unsigned int gl_version_minor );
15+
16+ /**
17+ * @brief Terminate the OpenGL Validation Layer.
18+ */
919void gl_layer_terminate ();
1020
21+ /**
22+ * @brief This function will be used to perform validation. To enable validation, this must be called before every OpenGL call you make.
23+ * When using the GLAD loader, this can be done by simply calling glad_set_pre_callback(&gl_layer_callback). If you are using a
24+ * different loader, you will need to register this callback some other way.
25+ * @param name Name of the OpenGL function being called.
26+ * @param func_ptr Pointer to the OpenGL function being called.
27+ * @param num_args Amount of arguments.
28+ * @param ... Arguments to the OpenGL function being called.
29+ */
1130void gl_layer_callback (const char * name , void * func_ptr , int num_args , ...);
1231
1332typedef void (* GLLayerOutputFun )(const char * text );
33+ /**
34+ * @brief This function allows the user to set a custom callback for writing validation output.
35+ * @param callback Callback that is called when output needs to be written. This function must take a single argument of type const char*
36+ * with the text to write.
37+ */
1438void gl_layer_set_output_callback (GLLayerOutputFun callback );
1539
1640#ifdef __cplusplus
Original file line number Diff line number Diff line change 44
55namespace gl_layer {
66
7- void default_output_func (const char * text) {
7+ static void default_output_func (const char * text) {
88 printf (" %s" , text);
99}
1010
@@ -15,7 +15,7 @@ struct Version {
1515
1616class Context {
1717public:
18- explicit Context (Version gl_version ) : gl_version(gl_version ) {
18+ explicit Context (Version version ) : gl_version(version ) {
1919
2020 }
2121
You can’t perform that action at this time.
0 commit comments