Kore 3
Loading...
Searching...
No Matches
2d.h
1#ifndef KORE_2D_HEADER
2#define KORE_2D_HEADER
3
4#include <kore3/global.h>
5
6#if 0
7
8#include <kore3/graphics4/texture.h>
9#include <kore3/math/matrix.h>
10
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
19#ifdef KORE_KONG
20
21typedef enum kore_g2_image_scale_quality {
22 KORE_G2_IMAGE_SCALE_QUALITY_LOW, // usually point filter
23 KORE_G2_IMAGE_SCALE_QUALITY_HIGH // usually bilinear filter
24} kore_g2_image_scale_quality;
25
26// enum HorTextAlignment { TextLeft, TextCenter, TextRight };
27// enum VerTextAlignment { TextTop, TextMiddle, TextBottom };
28
29void kore_g2_init(void);
30void kore_g2_draw_image(kore_g4_texture_t *img, float x, float y);
31void kore_g2_draw_scaled_sub_image(kore_g4_texture_t *img, float sx, float sy, float sw, float sh, float dx, float dy, float dw, float dh);
32void kore_g2_draw_sub_image(kore_g4_texture_t *img, float x, float y, float sx, float sy, float sw, float sh);
33void kore_g2_draw_scaled_image(kore_g4_texture_t *img, float dx, float dy, float dw, float dh);
34uint32_t kore_g2_get_color(void);
35void kore_g2_set_color(uint32_t color);
36void kore_g2_draw_rect(float x, float y, float width, float height, float strength /*= 1.0*/);
37void kore_g2_fill_rect(float x, float y, float width, float height);
38void kore_g2_draw_line(float x1, float y1, float x2, float y2, float strength /*= 1.0*/);
39void kore_g2_fill_triangle(float x1, float y1, float x2, float y2, float x3, float y3);
40kore_g2_image_scale_quality kore_g2_get_image_scale_quality(void);
41void kore_g2_set_image_scale_quality(kore_g2_image_scale_quality value);
42kore_g2_image_scale_quality kore_g2_get_mipmap_scale_quality(void);
43void kore_g2_set_mipmap_scale_quality(kore_g2_image_scale_quality value);
44void kore_g2_scissor(int x, int y, int width, int height);
45void kore_g2_disable_scissor(void);
46void kore_g2_begin(int width, int height, bool clear /*= true*/, uint32_t clear_color);
47void kore_g2_clear(uint32_t color);
48void kore_g2_flush(void);
49void kore_g2_end(void);
50kore_matrix3x3_t kore_g2_get_transformation(void);
51void kore_g2_set_transformation(kore_matrix3x3_t transformation);
52void kore_g2_push_transformation(kore_matrix3x3_t trans);
53kore_matrix3x3_t kore_g2_pop_transformation(void);
54void kore_g2_scale(float x, float y);
55void kore_g2_push_scale(float x, float y);
56kore_matrix3x3_t kore_g2_translation(float tx, float ty);
57void kore_g2_translate(float tx, float ty);
58void kore_g2_push_translation(float tx, float ty);
59kore_matrix3x3_t kore_g2_rotation(float angle, float centerx, float centery);
60void kore_g2_rotate(float angle, float centerx, float centery);
61void kore_g2_push_rotation(float angle, float centerx, float centery);
62void kore_g2_push_opacity(float opacity);
63float kore_g2_pop_opacity(void);
64float kore_g2_get_opacity(void);
65void kore_g2_set_opacity(float opacity);
66
67#else
68
69void kore_g2_init(int screen_width, int screen_height);
70void kore_g2_begin(void);
71void kore_g2_end(void);
72void kore_g2_clear(float r, float g, float b);
73void kore_g2_draw_image(kore_image_t *img, float x, float y);
74// void drawScaledSubImage(Graphics4::Texture *img, float sx, float sy, float sw, float sh, float dx, float dy, float dw, float dh);
75void kore_g2_set_rotation(float angle, float centerx, float centery);
76
77#endif
78
79#ifdef __cplusplus
80}
81#endif
82
83#endif
84
85#endif
Provides basic functionality that's used all over the place. There's usually no need to manually incl...
Provides basic matrix types and a few functions which create transformation-matrices....