polygon filler, rudimentary GL
[gba_blender] / src / xgl.h
diff --git a/src/xgl.h b/src/xgl.h
new file mode 100644 (file)
index 0000000..1e531bb
--- /dev/null
+++ b/src/xgl.h
@@ -0,0 +1,50 @@
+/*
+blender for the Gameboy Advance
+Copyright (C) 2021  John Tsiombikas <nuclear@member.fsf.org>
+
+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 <https://www.gnu.org/licenses/>.
+*/
+#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_ */