nds_test2

view src/ds3.h @ 2:dd8c9847bae9

cube
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 29 Jan 2018 14:40:45 +0200
parents d625ba001a62
children
line source
1 #ifndef DS3_H_
2 #define DS3_H_
4 #include <stdint.h>
6 #define RGB15(r, g, b) (((r) & 0x1f) | (((g) & 0x1f) << 5) | (((b) & 0x1f) << 10))
8 #define DS3_TEXTURE_2D 0x0001
9 #define DS3_SPECULAR 0x0002
10 #define DS3_ALPHA_TEST 0x0004
11 #define DS3_BLEND 0x0008
12 #define DS3_POLYGON_SMOOTH 0x0010
13 #define DS3_EDGE 0x0020
14 #define DS3_FOG_ALPHA 0x0040
15 #define DS3_FOG 0x0080
16 #define DS3_CLEAR_BM 0x4000
18 #define DS3_TRIANGLES 0
19 #define DS3_QUADS 1
20 #define DS3_TRIANGLE_STRIP 2
21 #define DS3_QUAD_STRIP 3
23 #define DS3_PROJECTION 0
24 #define DS3_MODELVIEW 1
25 #define DS3_TEXTURE 2
27 void ds3_enable(unsigned int x);
28 void ds3_disable(unsigned int x);
30 void ds3_clear_color(uint16_t color, int a);
31 void ds3_clear_depth(int z);
33 void ds3_viewport(int x, int y, int w, int h);
35 void ds3_matrix_mode(int mmode);
36 void ds3_load_identity(void);
37 void ds3_load_matrix(int32_t *m);
38 void ds3_load_matrix4x3(int32_t *m);
39 void ds3_mult_matrix(int32_t *m);
40 void ds3_mult_matrix4x3(int32_t *m);
41 void ds3_mult_matrix3x3(int32_t *m);
42 void ds3_push_matrix(void);
43 void ds3_pop_matrix(void);
44 void ds3_translate(int32_t x, int32_t y, int32_t z);
45 void ds3_scale(int32_t x, int32_t y, int32_t z);
47 void ds3_swap_buffers(void);
49 void ds3_begin(int prim);
50 void ds3_end(void);
52 void ds3_vertex3(int32_t x, int32_t y, int32_t z);
53 void ds3_vertex3f(float x, float y, float z);
54 void ds3_vertex2(int32_t x, int32_t y);
55 void ds3_vertex2f(float x, float y);
56 void ds3_color(uint16_t color);
57 void ds3_color3b(unsigned char r, unsigned char g, unsigned char b);
58 void ds3_color3f(float r, float g, float b);
59 void ds3_normal(int32_t x, int32_t y, int32_t z);
60 void ds3_normal3f(float x, float y, float z);
61 void ds3_texcoord2(int32_t s, int32_t t);
62 void ds3_texcoord2f(float s, float t);
64 void ds3_ortho(int32_t left, int32_t right, int32_t top, int32_t bottom, int32_t znear, int32_t zfar);
65 void ds3_orthof(float left, float right, float top, float bottom, float znear, float zfar);
67 void ds3_frustum(int32_t left, int32_t right, int32_t top, int32_t bottom, int32_t znear, int32_t zfar);
69 void ds3_perspectivef(float vfov_deg, float aspect, float znear, float zfar);
71 int32_t x16div(int32_t a, int32_t b);
73 #endif /* DS3_H_ */