aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorAndre Weissflog <floooh@gmail.com>2019-04-06 21:36:58 +0200
committerAndre Weissflog <floooh@gmail.com>2019-04-06 21:36:58 +0200
commit595a36e9ebb2f50c9f5c31fbd8ceda4e7e44041c (patch)
treeb7ccd3d90d2be0b297c300a019e3539de11a4d64 /util
parent86e7357d15b0d7792a9fef5e4b0fcadf52cd0ca8 (diff)
sokol_gl.h: mention sgl_error() in the docs
Diffstat (limited to 'util')
-rw-r--r--util/sokol_gl.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/util/sokol_gl.h b/util/sokol_gl.h
index 029e34b8..41bc8a9d 100644
--- a/util/sokol_gl.h
+++ b/util/sokol_gl.h
@@ -108,7 +108,7 @@
to use the default values, leave them zero-initialized.
You can adjust the maximum number of vertices and drawing commands
- through the members:
+ per frame through the members:
int max_vertices - default is 65536
int max_commands - default is 16384
@@ -268,6 +268,23 @@
call to sgl_draw() through sokol-gfx, and will 'rewind' the internal
vertex-, uniform- and command-buffers.
+ --- sokol-gl tracks a single internal error code which can be
+ queried with
+
+ sgl_error_t sgl_error(void)
+
+ ...which can return the following error codes:
+
+ SGL_NO_ERROR - all OK, no error occurded since last sgl_draw()
+ SGL_ERROR_VERTICES_FULL - internal vertex buffer is full (checked in sgl_end())
+ SGL_ERROR_UNIFORMS_FULL - the internal uniforms buffer is full (checked in sgl_end())
+ SGL_ERROR_COMMANDS_FULL - the internal command buffer is full (checked in sgl_end())
+ SGL_ERROR_STACK_OVERFLOW - current matrix stack overflow (checked in sgl_push_matrix())
+ SGL_ERROR_STACK_UNDERFLOW - current matrix stack underflow (checked in sgl_pop_matrix())
+
+ ...if sokol-gl is in an error-state, sgl_draw() will skip any rendering,
+ and reset the error code to SGL_NO_ERROR.
+
UNDER THE HOOD:
===============
sokol_gl.h works by recording vertex data and rendering commands into