JackUtils 0.5
Provides simplified Jack API for clients :)
Loading...
Searching...
No Matches
Functions
JackGUI extension

GUI and window creation extension for JackUtils :) All other GUI functions are provided by nuklear API. More...

Functions

JG_API jg_ctx_t * jg_init (const char *title, int w, int h)
 Initializes GUI context. More...
 
JG_API void jg_uninit (jg_ctx_t *u)
 Destroys GUI context. More...
 
JG_API int jg_begin (jg_ctx_t *u, int fullscreen)
 Starts GUI objects enumeration. More...
 
JG_API void jg_end (jg_ctx_t *u, int mul)
 Ends GUI objects enumeration. More...
 
JG_API void jg_sync_visibility (jg_ctx_t *gui, ju_ctx_t *ctx)
 Synchronize window visibility with Session Manager (if has one, else do nothing). More...
 
JG_API void jg_request_redraw (jg_ctx_t *u)
 Sends redraw event to internal event pool. More...
 
JG_API void jg_show_message (jg_ctx_t *u, ju_cstr_t msg)
 Notifies user with message. More...
 
JG_API void jg_show_about (jg_ctx_t *u)
 Shows about subwindow with information about your program. More...
 

Detailed Description

GUI and window creation extension for JackUtils :) All other GUI functions are provided by nuklear API.

:) nuklear

Function Documentation

◆ jg_begin()

JG_API int jg_begin ( jg_ctx_t *  u,
int  fullscreen 
)

Starts GUI objects enumeration.

You must call jg_end() when you done

You can use OpenG commands here ONLY before drawing any GUI element (for future compability).

Parameters
uGUI context
fullscreendraw window on fullscreen? (if your program does not draw anything using OpenGL on the background...)
Returns
1 on sucess. In other case you must not enumerate anything!

◆ jg_end()

JG_API void jg_end ( jg_ctx_t *  u,
int  mul 
)

Ends GUI objects enumeration.

It combines GUI verticies and send them to OpenGL. Also pulls GLFW Window events, switches buffers, etc.

Parameters
uGUI Context
mulFor ABI compability! Set always to zero!

◆ jg_init()

JG_API jg_ctx_t * jg_init ( const char *  title,
int  w,
int  h 
)

Initializes GUI context.

Parameters
titlewindow title
wdefault width of the window
hdefault height of the window
Returns
NULL in case of error
GUI context on sucess

References jg_image_load_from_memory().

◆ jg_request_redraw()

JG_API void jg_request_redraw ( jg_ctx_t *  u)

Sends redraw event to internal event pool.

Window context redraws only user interacts with windowby default (when any event extst). This may be not enough for you, and in this case you can call this function to make redraw window again at next tick.

Parameters
uGUI context

◆ jg_show_about()

JG_API void jg_show_about ( jg_ctx_t *  u)

Shows about subwindow with information about your program.

Parameters
uGUI Context

◆ jg_show_message()

JG_API void jg_show_message ( jg_ctx_t *  u,
ju_cstr_t  msg 
)

Notifies user with message.

You need to call it ONCE! If you call it not once, old message will be concated with new. Message will be cleared when user will close it.

Parameters
uGUI context
msgMessage to show.

◆ jg_sync_visibility()

JG_API void jg_sync_visibility ( jg_ctx_t *  gui,
ju_ctx_t ctx 
)

Synchronize window visibility with Session Manager (if has one, else do nothing).

Parameters
guiGUI context
ctxJackUtils context

References ju_need_gui(), and ju_set_gui().

◆ jg_uninit()

JG_API void jg_uninit ( jg_ctx_t *  u)

Destroys GUI context.

Parameters
uGUI context

References jg_image_free().