mirror of
https://github.com/nishiowo/nishbox
synced 2025-04-21 20:24:39 +00:00
write documents about graphic
This commit is contained in:
parent
5ec1b39979
commit
f59fb78500
@ -43,24 +43,71 @@
|
||||
*/
|
||||
#define GF_GRAPHIC_3D 3
|
||||
|
||||
/**
|
||||
* @~english
|
||||
* @brief Macro to set color safely and shorter
|
||||
* @param color gf_color_t
|
||||
*/
|
||||
#define GF_SET_COLOR(color, red, green, blue, alpha) \
|
||||
color.r = (red); \
|
||||
color.g = (green); \
|
||||
color.b = (blue); \
|
||||
color.a = (alpha)
|
||||
|
||||
/**
|
||||
* @~english
|
||||
* @brief Clear the screen
|
||||
*/
|
||||
GF_EXPORT void gf_graphic_clear(gf_draw_t* draw);
|
||||
|
||||
/**
|
||||
* @~english
|
||||
* @brief Start 2D mode
|
||||
*/
|
||||
GF_EXPORT void gf_graphic_begin_2d(gf_draw_t* draw);
|
||||
|
||||
/**
|
||||
* @~english
|
||||
* @brief End 2D mode
|
||||
*/
|
||||
GF_EXPORT void gf_graphic_end_2d(gf_draw_t* draw);
|
||||
|
||||
/**
|
||||
* @~english
|
||||
* @brief Draw polygon with texture
|
||||
*/
|
||||
GF_EXPORT void gf_graphic_draw_texture_polygon(gf_draw_t* draw, gf_texture_t* texture, gf_color_t color, int dim, int npair, ...);
|
||||
|
||||
/**
|
||||
* @~english
|
||||
* @brief Draw polygon
|
||||
*/
|
||||
GF_EXPORT void gf_graphic_fill_polygon(gf_draw_t* draw, gf_color_t color, int dim, int npair, ...);
|
||||
|
||||
/* Common */
|
||||
|
||||
/**
|
||||
* @~english
|
||||
* @brief Calculate text width
|
||||
*/
|
||||
GF_EXPORT float gf_graphic_text_width(gf_draw_t* draw, float size, const char* text);
|
||||
|
||||
/**
|
||||
* @~english
|
||||
* @brief Draw text
|
||||
*/
|
||||
GF_EXPORT void gf_graphic_text(gf_draw_t* draw, float x, float y, float size, const char* text, gf_color_t color);
|
||||
|
||||
/**
|
||||
* @~english
|
||||
* @brief Draw filled rectangle
|
||||
*/
|
||||
GF_EXPORT void gf_graphic_fill_rect(gf_draw_t* draw, float x, float y, float w, float h, gf_color_t color);
|
||||
|
||||
/**
|
||||
* @~english
|
||||
* @brief Draw rectangle with texture
|
||||
*/
|
||||
GF_EXPORT void gf_graphic_draw_texture_2d(gf_draw_t* draw, float x, float y, float w, float h, gf_texture_t* texture, gf_color_t color);
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user