summaryrefslogtreecommitdiff
path: root/sim.h
diff options
context:
space:
mode:
Diffstat (limited to 'sim.h')
-rw-r--r--sim.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/sim.h b/sim.h
index e52023a..124efe5 100644
--- a/sim.h
+++ b/sim.h
@@ -90,12 +90,19 @@ typedef struct {
typedef GLuint VertexAttributeLocation;
typedef GLint UniformLocation;
+// shader for platforms
typedef struct {
ShaderBase base;
- VertexAttributeLocation vertex_p1, vertex_p2;
- UniformLocation uniform_thickness;
+ VertexAttributeLocation vertex_p1, vertex_p2; // endpoints of platform
+ UniformLocation uniform_thickness; // this is half the "width" of the platform
+ UniformLocation uniform_transform; // 4x4 matrix position is multiplied by
} ShaderPlatform;
+typedef struct {
+ ShaderBase base;
+ UniformLocation uniform_transform, uniform_center, uniform_radius;
+} ShaderBall;
+
typedef struct {
v2 center;
float size;
@@ -104,10 +111,16 @@ typedef struct {
typedef struct {
bool initialized;
+
i32 win_width, win_height; // width,height of window
+ float gl_width; // width of window in GL coordinates; height is always 1
+
+ float dt; // time in seconds since last frame
+ m4 transform; // the transform for converting our coordinates to GL coordinates
GL gl; // gl functions
ShaderPlatform shader_platform;
+ ShaderBall shader_ball;
u32 nplatforms;
Platform platforms[1000];