GoldFish Engine
Quite simple and lightweight game engine
Loading...
Searching...
No Matches
gf_graphic.h
Go to the documentation of this file.
1
7#ifndef __GF_GRAPHIC_H__
8#define __GF_GRAPHIC_H__
9
10#include <gf_pre.h>
11#include <gf_macro.h>
12
13/* Type */
14#include <gf_type/graphic.h>
15
16/* Engine */
17#include <gf_type/draw.h>
18#include <gf_type/texture.h>
19
20/* Standard */
21
26#define GF_GRAPHIC_2D 2
27
32#define GF_GRAPHIC_3D 3
33
39#define GF_SET_COLOR(color, red, green, blue, alpha) \
40 color.r = (red); \
41 color.g = (green); \
42 color.b = (blue); \
43 color.a = (alpha)
44
50
56
62
67GF_EXPORT void gf_graphic_draw_texture_polygon(gf_draw_t* draw, gf_texture_t* texture, gf_graphic_color_t color, int dim, int npair, ...);
68
73GF_EXPORT void gf_graphic_fill_polygon(gf_draw_t* draw, gf_graphic_color_t color, int dim, int npair, ...);
74
83GF_EXPORT void gf_graphic_perspective(gf_draw_t* draw, double fovy, double znear, double zfar);
84
91
92/* Common */
93
99GF_EXPORT double gf_graphic_text_width(gf_draw_t* draw, double size, const char* text);
100
105GF_EXPORT void gf_graphic_text(gf_draw_t* draw, double x, double y, double size, const char* text, gf_graphic_color_t color);
106
111GF_EXPORT void gf_graphic_fill_rect(gf_draw_t* draw, double x, double y, double w, double h, gf_graphic_color_t color);
112
117GF_EXPORT void gf_graphic_draw_texture_2d(gf_draw_t* draw, double x, double y, double w, double h, gf_texture_t* texture, gf_graphic_color_t color);
118
119#endif
Type definitions related to drawing interface.
void gf_graphic_draw_texture_2d(gf_draw_t *draw, double x, double y, double w, double h, gf_texture_t *texture, gf_graphic_color_t color)
Draw rectangle with texture.
void gf_graphic_draw_texture_polygon(gf_draw_t *draw, gf_texture_t *texture, gf_graphic_color_t color, int dim, int npair,...)
Draw polygon with texture.
Definition gf_graphic.c:28
void gf_graphic_fill_rect(gf_draw_t *draw, double x, double y, double w, double h, gf_graphic_color_t color)
Draw filled rectangle.
void gf_graphic_clear(gf_draw_t *draw)
Clear the screen.
Definition gf_graphic.c:26
void gf_graphic_fill_polygon(gf_draw_t *draw, gf_graphic_color_t color, int dim, int npair,...)
Draw polygon.
Definition gf_graphic.c:30
void gf_graphic_perspective(gf_draw_t *draw, double fovy, double znear, double zfar)
Set perspective.
Definition gf_graphic.c:32
void gf_graphic_text(gf_draw_t *draw, double x, double y, double size, const char *text, gf_graphic_color_t color)
Draw text.
double gf_graphic_text_width(gf_draw_t *draw, double size, const char *text)
Calculate text width.
void gf_graphic_end_2d(gf_draw_t *draw)
End 2D mode.
Definition gf_graphic.c:24
void gf_graphic_begin_2d(gf_draw_t *draw)
Start 2D mode.
Definition gf_graphic.c:22
void gf_graphic_set_camera(gf_draw_t *draw)
Set camera.
Definition gf_graphic.c:34
#define GF_EXPORT
Macro for platform-dependent symbol export/import.
Definition gf_macro.h:190
Required headers before anything.
Type definitions related to graphic interface.
Drawing interface.
Definition draw.h:108
Texture.
Definition texture.h:49
Type definitions related to texture.