diff --git a/engine/gf__draw_8h.html b/engine/gf__draw_8h.html index 9830e3f..d4a8210 100644 --- a/engine/gf__draw_8h.html +++ b/engine/gf__draw_8h.html @@ -246,7 +246,7 @@ Functions -

Definition at line 125 of file gf_draw_common.c.

+

Definition at line 131 of file gf_draw_common.c.

@@ -312,7 +312,7 @@ Functions -

Definition at line 95 of file gf_draw_common.c.

+

Definition at line 97 of file gf_draw_common.c.

@@ -385,7 +385,7 @@ Functions
Returns
0 if successful, otherwise if failed
-

Definition at line 117 of file gf_draw_common.c.

+

Definition at line 123 of file gf_draw_common.c.

diff --git a/engine/gf__draw_8h_source.html b/engine/gf__draw_8h_source.html index 7a861fc..4ec3617 100644 --- a/engine/gf__draw_8h_source.html +++ b/engine/gf__draw_8h_source.html @@ -133,9 +133,9 @@ $(document).ready(function(){initNavTree('gf__draw_8h_source.html',''); initResi
draw.h
Type definitions related to drawing interface.
gf_draw_end
void gf_draw_end(void)
Cleanup drawing stuffs.
Definition gf_draw_common.c:28
gf_draw_begin
void gf_draw_begin(void)
Initialize drawing stuffs.
Definition gf_draw_common.c:26
-
gf_draw_step
int gf_draw_step(gf_draw_t *draw)
Do drawing single step.
Definition gf_draw_common.c:117
-
gf_draw_frame
void gf_draw_frame(gf_draw_t *draw)
Draw frame (common part)
Definition gf_draw_common.c:95
-
gf_draw_destroy
void gf_draw_destroy(gf_draw_t *draw)
Destroy drawing interface.
Definition gf_draw_common.c:125
+
gf_draw_step
int gf_draw_step(gf_draw_t *draw)
Do drawing single step.
Definition gf_draw_common.c:123
+
gf_draw_frame
void gf_draw_frame(gf_draw_t *draw)
Draw frame (common part)
Definition gf_draw_common.c:97
+
gf_draw_destroy
void gf_draw_destroy(gf_draw_t *draw)
Destroy drawing interface.
Definition gf_draw_common.c:131
gf_draw_reshape
void gf_draw_reshape(gf_draw_t *draw)
Do stuffs required on resizing window.
Definition gf_draw_common.c:92
gf_draw_create
gf_draw_t * gf_draw_create(gf_engine_t *engine, const char *title)
Create drawing interface.
Definition gf_draw_common.c:32
gf_macro.h
Macro.
diff --git a/engine/gf__draw__common_8c_source.html b/engine/gf__draw__common_8c_source.html index f0d06a7..4330bba 100644 --- a/engine/gf__draw__common_8c_source.html +++ b/engine/gf__draw__common_8c_source.html @@ -194,54 +194,60 @@ $(document).ready(function(){initNavTree('gf__draw__common_8c_source.html','');
91
92void gf_draw_reshape(gf_draw_t* draw) { gf_draw_driver_reshape(draw); }
93
-
94/* Runs every frame */
-
-
95void gf_draw_frame(gf_draw_t* draw) {
-
96 gf_graphic_color_t color;
-
97 color.r = color.g = color.b = color.a = 255;
-
98 if(!draw->draw_3d) {
-
99 gf_graphic_draw_texture_polygon(draw, test_texture, color, GF_GRAPHIC_3D, 4,
-
100 /* clang-format off */
-
101 0.0, 0.0,
-
102 -1.0, 0.0, -1.0,
-
103
-
104 0.0, 4.0,
-
105 -1.0, 0.0, 1.0,
-
106
-
107 4.0, 4.0,
-
108 1.0, 0.0, 1.0,
-
109
-
110 4.0, 0.0,
-
111 1.0, 0.0, -1.0
-
112 /* clang-format on */
-
113 );
-
114 }
-
115}
+
94gf_gui_id_t button = -1;
+
95
+
96/* Runs every frame */
+
+
97void gf_draw_frame(gf_draw_t* draw) {
+ +
99 color.r = color.g = color.b = color.a = 255;
+
100 if(button == -1) {
+
101 button = gf_gui_create_button(draw->gui, 0, 0, 200, 100, "Test");
+
102 }
+
103 if(draw->draw_3d) {
+
104 gf_graphic_draw_texture_polygon(draw, test_texture, color, GF_GRAPHIC_3D, 4,
+
105 /* clang-format off */
+
106 0.0, 0.0,
+
107 -1.0, 0.0, -1.0,
+
108
+
109 0.0, 4.0,
+
110 -1.0, 0.0, 1.0,
+
111
+
112 4.0, 4.0,
+
113 1.0, 0.0, 1.0,
+
114
+
115 4.0, 0.0,
+
116 1.0, 0.0, -1.0
+
117 /* clang-format on */
+
118 );
+
119 }
+
120 gf_gui_render(draw->gui);
+
121}
-
116
-
-
117int gf_draw_step(gf_draw_t* draw) {
-
118 int ret = gf_draw_platform_step(draw);
-
119 if(ret != 0) return ret;
-
120 draw->close = 0;
-
121
-
122 return 0;
-
123}
+
122
+
+
123int gf_draw_step(gf_draw_t* draw) {
+
124 int ret = gf_draw_platform_step(draw);
+
125 if(ret != 0) return ret;
+
126 draw->close = 0;
+
127
+
128 return 0;
+
129}
-
124
-
-
125void gf_draw_destroy(gf_draw_t* draw) {
-
126 if(draw->running) {
-
127 int i;
-
128 for(i = 0; i < sizeof(gf_font) / sizeof(gf_font[0]); i++) {
-
129 gf_texture_destroy(draw->font[i]);
-
130 }
-
131 }
-
132 if(draw->driver != NULL) gf_draw_driver_destroy(draw->driver);
-
133 if(draw->platform != NULL) gf_draw_platform_destroy(draw->platform);
-
134 gf_log_function(draw->engine, "Destroyed drawing interface", "");
-
135 free(draw);
-
136}
+
130
+
+
131void gf_draw_destroy(gf_draw_t* draw) {
+
132 if(draw->running) {
+
133 int i;
+
134 for(i = 0; i < sizeof(gf_font) / sizeof(gf_font[0]); i++) {
+
135 gf_texture_destroy(draw->font[i]);
+
136 }
+
137 }
+
138 if(draw->driver != NULL) gf_draw_driver_destroy(draw->driver);
+
139 if(draw->platform != NULL) gf_draw_platform_destroy(draw->platform);
+
140 gf_log_function(draw->engine, "Destroyed drawing interface", "");
+
141 free(draw);
+
142}
Drawing interface.
@@ -255,6 +261,7 @@ $(document).ready(function(){initNavTree('gf__draw__common_8c_source.html','');
#define gf_log_function(engine, fmt,...)
Output log with line number and function name.
Definition gf_log.h:26
Required headers before anything.
Texture.
+
int gf_gui_id_t
Component ID.
Definition gui.h:17
Type definitions related to math.
Drawing interface.
Definition draw.h:100
gf_texture_t * font[128]
Array of texture of glyphs.
Definition draw.h:100