26void gf_draw_begin(
void) { gf_draw_platform_begin(); }
28void gf_draw_end(
void) { gf_draw_platform_end(); }
34 memset(draw, 0,
sizeof(*draw));
43 strcpy(draw->
title, title);
44 draw->
platform = gf_draw_platform_create(engine, draw);
46 draw->
driver = gf_draw_driver_create(engine, draw);
47 gf_draw_reshape(draw);
51 draw->
light[1] = 10.0;
63 draw->
font = gf_font_create(draw,
"font/helvR24.bdf");
65 draw->
gui = gf_gui_create(engine, draw);
68 unsigned char* d = stbi_load(
"texture/test.bmp", &w, &h, &c, 4);
69 test_texture = gf_texture_create(draw, w, h, d);
73 gf_draw_destroy(draw);
79void gf_draw_reshape(
gf_draw_t* draw) { gf_draw_driver_reshape(draw); }
85 if(type == GF_GUI_PRESS_EVENT) {
93 color.
r = color.
g = color.
b = color.
a = 255;
95 button1 = gf_gui_create_button(draw->
gui, 0, 0, 200, 50,
"\"Test\" text");
96 gf_gui_set_callback(draw->
gui, button1, gf_button_callback);
99 button2 = gf_gui_create_button(draw->
gui, 100, 25, 200, 50,
"\"Test\" text");
100 gf_gui_set_callback(draw->
gui, button2, gf_button_callback);
103 gf_graphic_draw_texture_polygon(draw, test_texture, color,
GF_GRAPHIC_3D, 4,
119 gf_gui_render(draw->
gui);
123 int ret = gf_draw_platform_step(draw);
124 if(ret != 0)
return ret;
131 if(draw->
font != NULL) {
132 gf_font_destroy(draw->
font);
134 if(draw->
driver != NULL) gf_draw_driver_destroy(draw->
driver);
#define GF_GRAPHIC_3D
Dimension parameter for 3D.
#define gf_log_function(engine, fmt,...)
Output log with line number and function name.
Required headers before anything.
int gf_gui_id_t
Component ID.
Type definitions related to math.
gf_font_t * font
Current font.
gf_math_vector_t light
Light location.
gf_input_t * input
Input interface.
char title[128]
Window title.
gf_math_vector_t lookat
Where to look at.
int draw_3d
1 if engine should start rendering 3D stuffs, otherwise 0
gf_draw_driver_t * driver
Drawing driver.
int running
1 if running, otherwise 0
gf_engine_t * engine
Engine instance.
int close
1 if it was requested to be closed, otherwise 0
gf_draw_platform_t * platform
Platform-dependent part of drawing driver.
gf_math_vector_t camera
Camera location.
int width
Width of window.
int height
Height of window.