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); }
86 color.
r = color.
g = color.
b = color.
a = 255;
88 button = gf_gui_create_button(draw->
gui, 0, 0, 200, 100,
"\"Test\" text");
91 gf_graphic_draw_texture_polygon(draw, test_texture, color,
GF_GRAPHIC_3D, 4,
107 gf_gui_render(draw->
gui);
111 int ret = gf_draw_platform_step(draw);
112 if(ret != 0)
return ret;
119 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.
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.