X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fxgl.h;fp=src%2Fxgl.h;h=1e531bb7452cb728c123bc0f9b87b98f883a076c;hb=5b98299a1aa716cc17cb5f70498c8e23cac945cb;hp=0000000000000000000000000000000000000000;hpb=ca3123df6cd875b1361533020c1f4eebfe9da295;p=gba_blender diff --git a/src/xgl.h b/src/xgl.h new file mode 100644 index 0000000..1e531bb --- /dev/null +++ b/src/xgl.h @@ -0,0 +1,50 @@ +/* +blender for the Gameboy Advance +Copyright (C) 2021 John Tsiombikas + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#ifndef XGL_H_ +#define XGL_H_ + +enum { + XGL_LINES = 2, + XGL_TRIANGLES = 3, + XGL_QUADS = 4 +}; + +struct xvertex { + int32_t x, y, z; + unsigned char cidx; +}; + +void xgl_init(void); + +void xgl_viewport(int x, int y, int w, int h); + +void xgl_push_matrix(void); +void xgl_pop_matrix(void); +void xgl_load_identity(void); +void xgl_load_matrix(const int32_t *m); +void xgl_mult_matrix(const int32_t *m); + +void xgl_translate(int32_t x, int32_t y, int32_t z); +void xgl_rotate_x(int32_t angle); +void xgl_rotate_y(int32_t angle); +void xgl_rotate_z(int32_t angle); +void xgl_scale(int32_t x, int32_t y, int32_t z); + +void xgl_draw(int prim, const struct xvertex *varr, int vcount); + +#endif /* XGL_H_ */