You can tweak SMGUI by providing some define before you include ui.h.
WARN: Only define this after you have included the modules.
Set this if you want to include not just the definitions but the implementation too.
Disable anti-aliased lines (eliminates math.h and libm dependency).
Set the maximum number of pending events. If not defined otherwise, defaults to 16.
Set the maximum number of visible popups. If not defined otherwise, defaults to 16.
Set if you want to call glfwInit()
/ glfwTerminate()
, SDL_Init()
/ SDL_Quit()
etc. yourself. This is needed if you want
SMGUI to handle multiple windows.
Set if you don't want ui_event()
to flush the window, and you call glfwSwapBuffers()
/
SDL_RenderPresent()
/ etc. yourself. This is needed if you want to draw over the UI layer.
Separately you can tweak the GLFW3 backend by providing some define before you include ui_glfw.h.
By default, this backend is compiled with shaders for OpenGL3.3 core profile with both glad
and glew
extension loader
support.
Use old-school OpenGL API. This works everywhere and requires no extension loader nor shaders. The downside is, that some video card drivers are buggy and break backward compatibility, so you won't be able to use your own shaders either with this option.
Use shaders, but only OpenGL ES 2.0 (mobile platform variant). For supporting legacy mobiles only, most modern devices have no issues using OpenGL 3.3 core.
If you want to use your own GLFW3 hooks, then define this, and also call the backend's hooks from your hooks. For example:
/* set your hook as usual */
glfwSetMouseButtonCallback(ui_getwindow(ctx), my_glfw_mouse);
/* your hook */
void my_glfw_mouse(GLFWwindow *window, int button, int action, int mods)
{
/* parse what you want */
/* ... */
/* at the end also call the ui_glfw's hook */
ui_glfw_mouse(window, button, action, mods);
}