small update

master
vurtun 2015-05-11 12:45:22 +02:00
parent 19ce2c227c
commit 807c4b631f
4 changed files with 20 additions and 2 deletions

View File

@ -15,10 +15,17 @@ possible with fast streamlined development speed in mind.
- No direct dependencies (not even libc!)
- Full memory management control
- Renderer and platform independent
- Configurable
- Configurable style and colors
- UTF-8 support
## Target Audience
- Graphical tools/editors
- Library testbed UI
- Game engine debugging UI
- Graphical overlays
## Limitations
- Is NOT a layered Framework it is a component
- Does NOT provide os window/input management
- Does NOT provide a renderer backend
- Does NOT implement a font library
@ -27,7 +34,6 @@ Summary: It is only responsible for the actual user interface
## Gallery
![gui screenshot](/screen/demo.png?raw=true)
![gui screenshot](/screen/config.png?raw=true)
![gui screenshot](/screen/config2.png?raw=true)
## Example
```c

12
gui.h
View File

@ -10,6 +10,7 @@
extern "C" {
#endif
/* Constants */
#define GUI_UTF_SIZE 4
#define GUI_INPUT_MAX 16
#define GUI_UTF_INVALID 0xFFFD
@ -18,6 +19,7 @@ extern "C" {
#define GUI_HOOK_ATTR(T, name) struct T name
#define GUI_HOOK_OUT gui_command_list
/* Types */
#ifdef GUI_USE_FIXED_TYPES
#include <stdint.h>
typedef int32_t gui_int;
@ -49,6 +51,7 @@ typedef unsigned int gui_flag;
typedef unsigned long gui_size;
#endif
/* Utilities */
enum {gui_false, gui_true};
enum gui_heading {GUI_UP, GUI_RIGHT, GUI_DOWN, GUI_LEFT};
struct gui_color {gui_byte r,g,b,a;};
@ -57,6 +60,7 @@ struct gui_rect {gui_float x,y,w,h;};
struct gui_key {gui_bool down, clicked;};
struct gui_font;
/* Callbacks */
typedef void* gui_image;
typedef gui_char gui_glyph[GUI_UTF_SIZE];
typedef gui_bool(*gui_filter)(gui_long unicode);
@ -71,6 +75,8 @@ typedef void(*gui_draw_triangle)(void*, gui_float, gui_float, gui_float, gui_flo
typedef void(*gui_draw_text)(void*, gui_float, gui_float, gui_float, gui_float,
const gui_char*, gui_size, const struct gui_font*,
struct gui_color, struct gui_color);
/* Input */
enum gui_keys {
GUI_KEY_SHIFT,
GUI_KEY_CTRL,
@ -94,6 +100,8 @@ struct gui_input {
struct gui_vec2 mouse_clicked_pos;
};
/* Widgets */
enum gui_text_align {
GUI_TEXT_LEFT,
GUI_TEXT_CENTERED,
@ -207,6 +215,8 @@ struct gui_canvas {
gui_draw_text draw_text;
};
/* Buffer */
struct gui_memory {
void *memory;
gui_size size;
@ -329,6 +339,8 @@ struct gui_command_list {
gui_size count;
};
/* Panel */
enum gui_panel_colors {
GUI_COLOR_TEXT,
GUI_COLOR_PANEL,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB