#define outputGamma 2.2
// Macros.
-#define TEX2D(c) pow(texture(u_texture, (c)), vec4(inputGamma))
+#define TEX2D(c) ((((c).x < 0.0f) || ((c).y < 0.0f) || ((c).x > 1.0f) || ((c).y) > 1.0f) ? vec4(0, 0, 0, 1) : pow(texture(u_texture, (c)), vec4(inputGamma)))
#define PI 3.141592653589
// Apply radial distortion to the given coordinate.
immediate_flush();
#if DEBUG {
- font_set_color(.{1,0,0});
+ font_set_color(.{1,1,0});
font_print(debug_font, 0, 16, "FPS: {}", game_fps);
font_print(debug_font, 0, 32, "HEAP: {b16}", alloc.heap.get_watermark());
font_print(debug_font, 0, 48, "FREE: {}KB", alloc.heap.get_freed_size() / 1024);
+
version_buf : [32] u8;
version_str := conv.format(version_buf, "Version: {}.{}", runtime.vars.MAJOR_VERSION, runtime.vars.MINOR_VERSION);
font_print(debug_font, ~~window_width - font_get_width(debug_font, version_str), 16, version_str);
main :: (args) => {
random.set_seed(os.time());
- debug_set_level(.Debug);
+ debug_set_level(.Info);
if !glfwInit() {
debug_log(.Critical, "Failed to initialize GLFW!");
os.exit(1);