summaryrefslogtreecommitdiff
path: root/kon/konsofren.h
diff options
context:
space:
mode:
Diffstat (limited to 'kon/konsofren.h')
-rw-r--r--kon/konsofren.h18
1 files changed, 10 insertions, 8 deletions
diff --git a/kon/konsofren.h b/kon/konsofren.h
index d7f3570..4e29e56 100644
--- a/kon/konsofren.h
+++ b/kon/konsofren.h
@@ -26,8 +26,8 @@
#ifndef KONSOFREN_H
#define KONSOFREN_H
-/* define KONSOFREN_NO_3D (in every file that includes this, and where the implementation is) for a 2D game, the cameras,
- triangles, meshes and billboards are left out. 3D is on by default */
+/* the 3D part (cameras, triangles, meshes, billboards, mipmaps, fog) is only there if you ask for it. define KONSOFREN_3D
+ before this header in every file that includes it, and in the one with the implementation. a 2D game compiles without it */
#include <stdint.h>
#include <stdlib.h>
@@ -77,7 +77,9 @@ typedef struct kon_display {
kon_filter_t filter;
} kon_display_t;
-#ifndef KONSOFREN_NO_3D
+#ifdef KONSOFREN_3D
+
+#define KONSOFREN_HAS_3D
typedef enum kon_projection {
KON_PROJECTION_PERSPECTIVE = 0,
@@ -152,7 +154,7 @@ typedef struct kon_mesh {
int triangleCount;
} kon_mesh_t;
-#endif /* KONSOFREN_NO_3D */
+#endif /* KONSOFREN_3D */
/*** 2D declarations ***/
@@ -208,7 +210,7 @@ void kon_presentDisplay(kon_display_t *display);
/* returns 0 if the window position is on a bar, outside the game image */
int kon_windowToGame(const kon_display_t *display, int windowX, int windowY, int *gameX, int *gameY);
-#ifndef KONSOFREN_NO_3D
+#ifdef KONSOFREN_3D
/*** 3D declarations ***/
@@ -250,7 +252,7 @@ int kon_drawBillboard(kon_framebuffer_t *fb, kon_mat4_t viewProjection, kon_vec3
/* cube from -1 to 1 with every face mapped to the whole texture */
extern const kon_mesh_t kon_cubeMesh;
-#endif /* KONSOFREN_NO_3D */
+#endif /* KONSOFREN_3D */
/*** implementation ***/
@@ -996,7 +998,7 @@ int kon_windowToGame(const kon_display_t *display, int windowX, int windowY, int
return 1;
}
-#ifndef KONSOFREN_NO_3D
+#ifdef KONSOFREN_3D
/*** 3D implementation ***/
@@ -1650,7 +1652,7 @@ int kon_drawBillboard(kon_framebuffer_t *fb, kon_mat4_t viewProjection, kon_vec3
return 1;
}
-#endif /* KONSOFREN_NO_3D */
+#endif /* KONSOFREN_3D */
#endif /* end of KONSOFREN_IMPLEMENTATION */
#endif