Finised context documentation translation
This commit is contained in:
parent
365c982773
commit
9a314f0e29
131
doc/nuklear.html
131
doc/nuklear.html
|
@ -11,10 +11,12 @@
|
|||
2. Constants section
|
||||
3. Dependencies section
|
||||
5. Example section
|
||||
6. License section
|
||||
7. Changelog section
|
||||
8. Gallery section
|
||||
9. Credits section
|
||||
6. API section
|
||||
1. Context section
|
||||
7. License section
|
||||
8. Changelog section
|
||||
9. Gallery section
|
||||
10. Credits section
|
||||
## About
|
||||
This is a minimal state immediate mode graphical user interface toolkit
|
||||
written in ANSI C and licensed under public domain. It was designed as a simple
|
||||
|
@ -75,7 +77,7 @@ or need more control over the library.
|
|||
Every time nuklear is included define the same compiler flags. This very important not doing so could lead to compiler errors or even worse stack corruptions.
|
||||
### Flags
|
||||
Flag | Description
|
||||
-----|-------------
|
||||
--------------------------------|------------------------------------------
|
||||
NK_PRIVATE | If defined declares all functions as static, so they can only be accessed inside the file that contains the implementation
|
||||
NK_INCLUDE_FIXED_TYPES | If defined it will include header `<stdint.h>` for fixed sized types otherwise nuklear tries to select the correct type. If that fails it will throw a compiler error and you have to select the correct types yourself.
|
||||
NK_INCLUDE_DEFAULT_ALLOCATOR | if defined it will include header `<stdlib.h>` and provide additional functions to use this library without caring for memory allocation control and therefore ease memory management.
|
||||
|
@ -104,7 +106,7 @@ NK_ZERO_COMMAND_MEMORY | Defining this will zero out memory for each drawing com
|
|||
- NK_INCLUDE_COMMAND_USERDATA
|
||||
### Constants
|
||||
Define | Description
|
||||
-----|-------------
|
||||
--------------------------------|---------------------------------------
|
||||
NK_BUFFER_DEFAULT_INITIAL_SIZE | Initial buffer size allocated by all buffers while using the default allocator functions included by defining NK_INCLUDE_DEFAULT_ALLOCATOR. If you don't want to allocate the default 4k memory then redefine it.
|
||||
NK_MAX_NUMBER_BUFFER | Maximum buffer size for the conversion buffer between float and string Under normal circumstances this should be more than sufficient.
|
||||
NK_INPUT_MAX | Defines the max number of bytes which can be added as text input in one frame. Under normal circumstances this should be more than sufficient.
|
||||
|
@ -115,7 +117,7 @@ NK_INPUT_MAX | Defines the max number of bytes which can be added as text input
|
|||
- NK_INPUT_MAX
|
||||
### Dependencies
|
||||
Function | Description
|
||||
-----|-------------
|
||||
------------|-------------
|
||||
NK_ASSERT | If you don't define this, nuklear will use <assert.h> with assert().
|
||||
NK_MEMSET | You can define this to 'memset' or your own memset implementation replacement. If not nuklear will use its own version.
|
||||
NK_MEMCPY | You can define this to 'memcpy' or your own memcpy implementation replacement. If not nuklear will use its own version.
|
||||
|
@ -174,6 +176,120 @@ if (nk_begin(&ctx, "Show", nk_rect(50, 50, 220, 220),
|
|||
nk_end(&ctx);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
![](https://cloud.githubusercontent.com/assets/8057201/10187981/584ecd68-675c-11e5-897c-822ef534a876.png)
|
||||
## API
|
||||
### Context
|
||||
Contexts are the main entry point and the majestro of nuklear and contain all required state.
|
||||
They are used for window, memory, input, style, stack, commands and time management and need
|
||||
to be passed into all nuklear GUI specific functions.
|
||||
#### Usage
|
||||
To use a context it first has to be initialized which can be achieved by calling
|
||||
one of either `nk_init_default`, `nk_init_fixed`, `nk_init`, `nk_init_custom`.
|
||||
Each takes in a font handle and a specific way of handling memory. Memory control
|
||||
hereby ranges from standard library to just specifying a fixed sized block of memory
|
||||
which nuklear has to manage itself from.
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
|
||||
struct nk_context ctx;
|
||||
nk_init_xxx(&ctx, ...);
|
||||
while (1) {
|
||||
// [...]
|
||||
nk_clear(&ctx);
|
||||
}
|
||||
nk_free(&ctx);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#### Reference
|
||||
Function | Description
|
||||
--------------------|---------------------------
|
||||
__nk_init_default__ | Initializes context with standard library memory allocation (malloc,free)
|
||||
__nk_init_fixed__ | Initializes context from single fixed size memory block
|
||||
__nk_init__ | Initializes context with memory allocator callbacks for alloc and free
|
||||
__nk_init_custom__ | Initializes context from two buffers. One for draw commands the other for window/panel/table allocations
|
||||
__nk_clear__ | Called at the end of the frame to reset and prepare the context for the next frame
|
||||
__nk_free__ | Shutdown and free all memory allocated inside the context
|
||||
__nk_set_user_data__| Utility function to pass user data to draw command
|
||||
#### nk_init_default
|
||||
Initializes a `nk_context` struct with a default standard library allocator.
|
||||
Should be used if you don't want to be bothered with memory management in nuklear.
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
|
||||
NK_API int nk_init_default(struct nk_context *ctx, const struct nk_user_font *font);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Parameter | Description
|
||||
------------|-------------
|
||||
__ctx__ | Must point to an either stack or heap allocated `nk_context` struct
|
||||
__font__ | Must point to a previously initialized font handle for more info look at font documentation
|
||||
Returns either `false(0)` on failure or `true(1)` on success.
|
||||
#### nk_init_fixed
|
||||
Initializes a `nk_context` struct from a single fixed size memory block
|
||||
Should be used if you want complete control over nuklear's memory management.
|
||||
Especially recommended for system with little memory or systems with virtual memory.
|
||||
For the later case you can just allocate for example 16MB of virtual memory
|
||||
and only the required amount of memory will actually be committed.
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
|
||||
NK_API int nk_init_fixed(struct nk_context *ctx, void *memory, nk_size size, const struct nk_user_font *font);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! Warning
|
||||
make sure the passed memory block is aligned correctly for `nk_draw_commands`.
|
||||
Parameter | Description
|
||||
------------|-------------
|
||||
__ctx__ | Must point to an either stack or heap allocated `nk_context` struct
|
||||
__memory__ | Must point to a previously allocated memory block
|
||||
__size__ | Must contain the total size of __memory__
|
||||
__font__ | Must point to a previously initialized font handle for more info look at font documentation
|
||||
Returns either `false(0)` on failure or `true(1)` on success.
|
||||
#### nk_init
|
||||
Initializes a `nk_context` struct with memory allocation callbacks for nuklear to allocate
|
||||
memory from. Used internally for `nk_init_default` and provides a kitchen sink allocation
|
||||
interface to nuklear. Can be useful for cases like monitoring memory consumption.
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
|
||||
NK_API int nk_init(struct nk_context *ctx, struct nk_allocator *alloc, const struct nk_user_font *font);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Parameter | Description
|
||||
------------|-------------
|
||||
__ctx__ | Must point to an either stack or heap allocated `nk_context` struct
|
||||
__alloc__ | Must point to a previously allocated memory allocator
|
||||
__font__ | Must point to a previously initialized font handle for more info look at font documentation
|
||||
Returns either `false(0)` on failure or `true(1)` on success.
|
||||
#### nk_init_custom
|
||||
Initializes a `nk_context` struct from two different either fixed or growing
|
||||
buffers. The first buffer is for allocating draw commands while the second buffer is
|
||||
used for allocating windows, panels and state tables.
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
|
||||
NK_API int nk_init_custom(struct nk_context *ctx, struct nk_buffer *cmds, struct nk_buffer *pool, const struct nk_user_font *font);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Parameter | Description
|
||||
------------|-------------
|
||||
__ctx__ | Must point to an either stack or heap allocated `nk_context` struct
|
||||
__cmds__ | Must point to a previously initialized memory buffer either fixed or dynamic to store draw commands into
|
||||
__pool__ | Must point to a previously initialized memory buffer either fixed or dynamic to store windows, panels and tables
|
||||
__font__ | Must point to a previously initialized font handle for more info look at font documentation
|
||||
Returns either `false(0)` on failure or `true(1)` on success.
|
||||
#### nk_clear
|
||||
Resets the context state at the end of the frame. This includes mostly
|
||||
garbage collector tasks like removing windows or table not called and therefore
|
||||
used anymore.
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
|
||||
NK_API void nk_clear(struct nk_context *ctx);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Parameter | Description
|
||||
------------|-------------
|
||||
__ctx__ | Must point to a previously initialized `nk_context` struct
|
||||
#### nk_free
|
||||
Frees all memory allocated by nuklear. Not needed if context was
|
||||
initialized with `nk_init_fixed`.
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
|
||||
NK_API void nk_free(struct nk_context *ctx);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Parameter | Description
|
||||
------------|-------------
|
||||
__ctx__ | Must point to a previously initialized `nk_context` struct
|
||||
#### nk_set_user_data
|
||||
Sets the currently passed userdata passed down into each draw command.
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
|
||||
NK_API void nk_set_user_data(struct nk_context *ctx, nk_handle data);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Parameter | Description
|
||||
------------|-------------
|
||||
__ctx__ | Must point to a previously initialized `nk_context` struct
|
||||
__data__ | Handle with either pointer or index to be passed into every draw commands
|
||||
scores --------- */
|
||||
-XXX.XXX- X...X - X...X -X....X - X....X"
|
||||
X...XXXXXXXXXXXXX...X - "
|
||||
|
@ -229,6 +345,7 @@ Offset --*/
|
|||
- [x]: Major version with API and library breaking
|
||||
- [yy]: Minor version with non-breaking API and library changes
|
||||
- [zz]: Bug fix version with no direct changes to API
|
||||
- 2017/01/07 (3.00.1) - Started to change documentation style
|
||||
- 2017/01/05 (3.00.0) - BREAKING CHANGE: The previous color picker API was broken
|
||||
because of conversions between float and byte color representation.
|
||||
Color pickers now use floating point values to represent
|
||||
|
|
245
nuklear.h
245
nuklear.h
|
@ -10,10 +10,12 @@
|
|||
/// 2. Constants section
|
||||
/// 3. Dependencies section
|
||||
/// 5. Example section
|
||||
/// 6. License section
|
||||
/// 7. Changelog section
|
||||
/// 8. Gallery section
|
||||
/// 9. Credits section
|
||||
/// 6. API section
|
||||
/// 1. Context section
|
||||
/// 7. License section
|
||||
/// 8. Changelog section
|
||||
/// 9. Gallery section
|
||||
/// 10. Credits section
|
||||
///
|
||||
/// ## About
|
||||
/// This is a minimal state immediate mode graphical user interface toolkit
|
||||
|
@ -83,7 +85,7 @@
|
|||
///
|
||||
/// ### Flags
|
||||
/// Flag | Description
|
||||
/// -----|-------------
|
||||
/// --------------------------------|------------------------------------------
|
||||
/// NK_PRIVATE | If defined declares all functions as static, so they can only be accessed inside the file that contains the implementation
|
||||
/// NK_INCLUDE_FIXED_TYPES | If defined it will include header `<stdint.h>` for fixed sized types otherwise nuklear tries to select the correct type. If that fails it will throw a compiler error and you have to select the correct types yourself.
|
||||
/// NK_INCLUDE_DEFAULT_ALLOCATOR | if defined it will include header `<stdlib.h>` and provide additional functions to use this library without caring for memory allocation control and therefore ease memory management.
|
||||
|
@ -115,7 +117,7 @@
|
|||
///
|
||||
/// ### Constants
|
||||
/// Define | Description
|
||||
/// -----|-------------
|
||||
/// --------------------------------|---------------------------------------
|
||||
/// NK_BUFFER_DEFAULT_INITIAL_SIZE | Initial buffer size allocated by all buffers while using the default allocator functions included by defining NK_INCLUDE_DEFAULT_ALLOCATOR. If you don't want to allocate the default 4k memory then redefine it.
|
||||
/// NK_MAX_NUMBER_BUFFER | Maximum buffer size for the conversion buffer between float and string Under normal circumstances this should be more than sufficient.
|
||||
/// NK_INPUT_MAX | Defines the max number of bytes which can be added as text input in one frame. Under normal circumstances this should be more than sufficient.
|
||||
|
@ -128,7 +130,7 @@
|
|||
///
|
||||
/// ### Dependencies
|
||||
/// Function | Description
|
||||
/// -----|-------------
|
||||
/// ------------|-------------
|
||||
/// NK_ASSERT | If you don't define this, nuklear will use <assert.h> with assert().
|
||||
/// NK_MEMSET | You can define this to 'memset' or your own memset implementation replacement. If not nuklear will use its own version.
|
||||
/// NK_MEMCPY | You can define this to 'memcpy' or your own memcpy implementation replacement. If not nuklear will use its own version.
|
||||
|
@ -197,6 +199,7 @@
|
|||
///
|
||||
/// ![](https://cloud.githubusercontent.com/assets/8057201/10187981/584ecd68-675c-11e5-897c-822ef534a876.png)
|
||||
///
|
||||
/// ## API
|
||||
///
|
||||
*/
|
||||
#ifndef NK_NUKLEAR_H_
|
||||
|
@ -484,101 +487,159 @@ enum nk_symbol_type {
|
|||
* CONTEXT
|
||||
*
|
||||
* =============================================================================*/
|
||||
/* Contexts are the main entry point and the majestro of nuklear and contain all required state.
|
||||
* They are used for window, memory, input, style, stack, commands and time management and need
|
||||
* to be passed into all nuklear GUI specific functions.
|
||||
*
|
||||
* Usage
|
||||
* -------------------
|
||||
* To use a context it first has to be initialized which can be achieved by calling
|
||||
* one of either `nk_init_default`, `nk_init_fixed`, `nk_init`, `nk_init_custom`.
|
||||
* Each takes in a font handle and a specific way of handling memory. Memory control
|
||||
* hereby ranges from standard library to just specifying a fixed sized block of memory
|
||||
* which nuklear has to manage itself from.
|
||||
*
|
||||
* struct nk_context ctx;
|
||||
* nk_init_xxx(&ctx, ...);
|
||||
* while (1) {
|
||||
* [...]
|
||||
* nk_clear(&ctx);
|
||||
* }
|
||||
* nk_free(&ctx);
|
||||
*
|
||||
* Reference
|
||||
* -------------------
|
||||
* nk_init_default - Initializes context with standard library memory allocation (malloc,free)
|
||||
* nk_init_fixed - Initializes context from single fixed size memory block
|
||||
* nk_init - Initializes context with memory allocator callbacks for alloc and free
|
||||
* nk_init_custom - Initializes context from two buffers. One for draw commands the other for window/panel/table allocations
|
||||
* nk_clear - Called at the end of the frame to reset and prepare the context for the next frame
|
||||
* nk_free - Shutdown and free all memory allocated inside the context
|
||||
* nk_set_user_data - Utility function to pass user data to draw command
|
||||
/*/// ### Context
|
||||
/// Contexts are the main entry point and the majestro of nuklear and contain all required state.
|
||||
/// They are used for window, memory, input, style, stack, commands and time management and need
|
||||
/// to be passed into all nuklear GUI specific functions.
|
||||
///
|
||||
/// #### Usage
|
||||
/// To use a context it first has to be initialized which can be achieved by calling
|
||||
/// one of either `nk_init_default`, `nk_init_fixed`, `nk_init`, `nk_init_custom`.
|
||||
/// Each takes in a font handle and a specific way of handling memory. Memory control
|
||||
/// hereby ranges from standard library to just specifying a fixed sized block of memory
|
||||
/// which nuklear has to manage itself from.
|
||||
///
|
||||
/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
|
||||
/// struct nk_context ctx;
|
||||
/// nk_init_xxx(&ctx, ...);
|
||||
/// while (1) {
|
||||
/// // [...]
|
||||
/// nk_clear(&ctx);
|
||||
/// }
|
||||
/// nk_free(&ctx);
|
||||
/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
///
|
||||
/// #### Reference
|
||||
/// Function | Description
|
||||
/// --------------------|---------------------------
|
||||
/// __nk_init_default__ | Initializes context with standard library memory allocation (malloc,free)
|
||||
/// __nk_init_fixed__ | Initializes context from single fixed size memory block
|
||||
/// __nk_init__ | Initializes context with memory allocator callbacks for alloc and free
|
||||
/// __nk_init_custom__ | Initializes context from two buffers. One for draw commands the other for window/panel/table allocations
|
||||
/// __nk_clear__ | Called at the end of the frame to reset and prepare the context for the next frame
|
||||
/// __nk_free__ | Shutdown and free all memory allocated inside the context
|
||||
/// __nk_set_user_data__| Utility function to pass user data to draw command
|
||||
*/
|
||||
#ifdef NK_INCLUDE_DEFAULT_ALLOCATOR
|
||||
/* nk_init_default - Initializes a `nk_context` struct with a default standard library allocator.
|
||||
* Should be used if you don't want to be bothered with memory management in nuklear.
|
||||
* Parameters:
|
||||
* @ctx must point to an either stack or heap allocated `nk_context` struct
|
||||
* @font must point to a previously initialized font handle for more info look at font documentation
|
||||
* Return values:
|
||||
* true(1) on success
|
||||
* false(0) on failure */
|
||||
/*/// #### nk_init_default
|
||||
/// Initializes a `nk_context` struct with a default standard library allocator.
|
||||
/// Should be used if you don't want to be bothered with memory management in nuklear.
|
||||
///
|
||||
/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
|
||||
/// NK_API int nk_init_default(struct nk_context *ctx, const struct nk_user_font *font);
|
||||
/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
///
|
||||
/// Parameter | Description
|
||||
/// ------------|-------------
|
||||
/// __ctx__ | Must point to an either stack or heap allocated `nk_context` struct
|
||||
/// __font__ | Must point to a previously initialized font handle for more info look at font documentation
|
||||
///
|
||||
/// Returns either `false(0)` on failure or `true(1)` on success.
|
||||
///
|
||||
*/
|
||||
NK_API int nk_init_default(struct nk_context*, const struct nk_user_font*);
|
||||
#endif
|
||||
/* nk_init_fixed - Initializes a `nk_context` struct from a single fixed size memory block
|
||||
* Should be used if you want complete control over nuklear's memory management.
|
||||
* Especially recommended for system with little memory or systems with virtual memory.
|
||||
* For the later case you can just allocate for example 16MB of virtual memory
|
||||
* and only the required amount of memory will actually be committed.
|
||||
* IMPORTANT: make sure the passed memory block is aligned correctly for `nk_draw_commands`
|
||||
* Parameters:
|
||||
* @ctx must point to an either stack or heap allocated `nk_context` struct
|
||||
* @memory must point to a previously allocated memory block
|
||||
* @size must contain the total size of @memory
|
||||
* @font must point to a previously initialized font handle for more info look at font documentation
|
||||
* Return values:
|
||||
* true(1) on success
|
||||
* false(0) on failure */
|
||||
/*/// #### nk_init_fixed
|
||||
/// Initializes a `nk_context` struct from a single fixed size memory block
|
||||
/// Should be used if you want complete control over nuklear's memory management.
|
||||
/// Especially recommended for system with little memory or systems with virtual memory.
|
||||
/// For the later case you can just allocate for example 16MB of virtual memory
|
||||
/// and only the required amount of memory will actually be committed.
|
||||
///
|
||||
/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
|
||||
/// NK_API int nk_init_fixed(struct nk_context *ctx, void *memory, nk_size size, const struct nk_user_font *font);
|
||||
/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
///
|
||||
/// !!! Warning
|
||||
/// make sure the passed memory block is aligned correctly for `nk_draw_commands`.
|
||||
///
|
||||
/// Parameter | Description
|
||||
/// ------------|-------------
|
||||
/// __ctx__ | Must point to an either stack or heap allocated `nk_context` struct
|
||||
/// __memory__ | Must point to a previously allocated memory block
|
||||
/// __size__ | Must contain the total size of __memory__
|
||||
/// __font__ | Must point to a previously initialized font handle for more info look at font documentation
|
||||
///
|
||||
/// Returns either `false(0)` on failure or `true(1)` on success.
|
||||
*/
|
||||
NK_API int nk_init_fixed(struct nk_context*, void *memory, nk_size size, const struct nk_user_font*);
|
||||
/* nk_init - Initializes a `nk_context` struct with memory allocation callbacks for nuklear to allocate
|
||||
* memory from. Used internally for `nk_init_default` and provides a kitchen sink allocation
|
||||
* interface to nuklear. Can be useful for cases like monitoring memory consumption.
|
||||
* Parameters:
|
||||
* @ctx must point to an either stack or heap allocated `nk_context` struct
|
||||
* @alloc must point to a previously allocated memory allocator
|
||||
* @font must point to a previously initialized font handle for more info look at font documentation
|
||||
* Return values:
|
||||
* true(1) on success
|
||||
* false(0) on failure */
|
||||
/*/// #### nk_init
|
||||
/// Initializes a `nk_context` struct with memory allocation callbacks for nuklear to allocate
|
||||
/// memory from. Used internally for `nk_init_default` and provides a kitchen sink allocation
|
||||
/// interface to nuklear. Can be useful for cases like monitoring memory consumption.
|
||||
///
|
||||
/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
|
||||
/// NK_API int nk_init(struct nk_context *ctx, struct nk_allocator *alloc, const struct nk_user_font *font);
|
||||
/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
///
|
||||
/// Parameter | Description
|
||||
/// ------------|-------------
|
||||
/// __ctx__ | Must point to an either stack or heap allocated `nk_context` struct
|
||||
/// __alloc__ | Must point to a previously allocated memory allocator
|
||||
/// __font__ | Must point to a previously initialized font handle for more info look at font documentation
|
||||
///
|
||||
/// Returns either `false(0)` on failure or `true(1)` on success.
|
||||
*/
|
||||
NK_API int nk_init(struct nk_context*, struct nk_allocator*, const struct nk_user_font*);
|
||||
/* nk_init_custom - Initializes a `nk_context` struct from two different either fixed or growing
|
||||
* buffers. The first buffer is for allocating draw commands while the second buffer is
|
||||
* used for allocating windows, panels and state tables.
|
||||
* Parameters:
|
||||
* @ctx must point to an either stack or heap allocated `nk_context` struct
|
||||
* @cmds must point to a previously initialized memory buffer either fixed or dynamic to store draw commands into
|
||||
* @pool must point to a previously initialized memory buffer either fixed or dynamic to store windows, panels and tables
|
||||
* @font must point to a previously initialized font handle for more info look at font documentation
|
||||
* Return values:
|
||||
* true(1) on success
|
||||
* false(0) on failure */
|
||||
/*/// #### nk_init_custom
|
||||
/// Initializes a `nk_context` struct from two different either fixed or growing
|
||||
/// buffers. The first buffer is for allocating draw commands while the second buffer is
|
||||
/// used for allocating windows, panels and state tables.
|
||||
///
|
||||
/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
|
||||
/// NK_API int nk_init_custom(struct nk_context *ctx, struct nk_buffer *cmds, struct nk_buffer *pool, const struct nk_user_font *font);
|
||||
/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
///
|
||||
/// Parameter | Description
|
||||
/// ------------|-------------
|
||||
/// __ctx__ | Must point to an either stack or heap allocated `nk_context` struct
|
||||
/// __cmds__ | Must point to a previously initialized memory buffer either fixed or dynamic to store draw commands into
|
||||
/// __pool__ | Must point to a previously initialized memory buffer either fixed or dynamic to store windows, panels and tables
|
||||
/// __font__ | Must point to a previously initialized font handle for more info look at font documentation
|
||||
///
|
||||
/// Returns either `false(0)` on failure or `true(1)` on success.
|
||||
*/
|
||||
NK_API int nk_init_custom(struct nk_context*, struct nk_buffer *cmds, struct nk_buffer *pool, const struct nk_user_font*);
|
||||
/* nk_clear - Resets the context state at the end of the frame. This includes mostly
|
||||
* garbage collector tasks like removing windows or table not called and therefore
|
||||
* used anymore.
|
||||
* Parameters:
|
||||
* @ctx must point to a previously initialized `nk_context` struct */
|
||||
/*/// #### nk_clear
|
||||
/// Resets the context state at the end of the frame. This includes mostly
|
||||
/// garbage collector tasks like removing windows or table not called and therefore
|
||||
/// used anymore.
|
||||
///
|
||||
/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
|
||||
/// NK_API void nk_clear(struct nk_context *ctx);
|
||||
/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
///
|
||||
/// Parameter | Description
|
||||
/// ------------|-------------
|
||||
/// __ctx__ | Must point to a previously initialized `nk_context` struct
|
||||
*/
|
||||
NK_API void nk_clear(struct nk_context*);
|
||||
/* nk_free - Frees all memory allocated by nuklear. Not needed if context was
|
||||
* initialized with `nk_init_fixed`.
|
||||
* Parameters:
|
||||
* @ctx must point to a previously initialized `nk_context` struct */
|
||||
/*/// #### nk_free
|
||||
/// Frees all memory allocated by nuklear. Not needed if context was
|
||||
/// initialized with `nk_init_fixed`.
|
||||
///
|
||||
/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
|
||||
/// NK_API void nk_free(struct nk_context *ctx);
|
||||
/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
///
|
||||
/// Parameter | Description
|
||||
/// ------------|-------------
|
||||
/// __ctx__ | Must point to a previously initialized `nk_context` struct
|
||||
*/
|
||||
NK_API void nk_free(struct nk_context*);
|
||||
#ifdef NK_INCLUDE_COMMAND_USERDATA
|
||||
/* nk_set_user_data - Sets the currently passed userdata passed down into each draw command.
|
||||
* Parameters:
|
||||
* @ctx must point to a previously initialized `nk_context` struct
|
||||
* @data handle with either pointer or index to be passed into every draw commands */
|
||||
/*/// #### nk_set_user_data
|
||||
/// Sets the currently passed userdata passed down into each draw command.
|
||||
///
|
||||
/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
|
||||
/// NK_API void nk_set_user_data(struct nk_context *ctx, nk_handle data);
|
||||
/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
///
|
||||
/// Parameter | Description
|
||||
/// ------------|-------------
|
||||
/// __ctx__ | Must point to a previously initialized `nk_context` struct
|
||||
/// __data__ | Handle with either pointer or index to be passed into every draw commands
|
||||
*/
|
||||
NK_API void nk_set_user_data(struct nk_context*, nk_handle handle);
|
||||
#endif
|
||||
/* =============================================================================
|
||||
|
|
Loading…
Reference in New Issue