summary refs log tree commit diff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorMel <einebeere@gmail.com>2023-07-07 23:05:14 +0200
committerMel <einebeere@gmail.com>2023-07-07 23:14:59 +0200
commit129f2e421e16bd008cdca8713cc91f67d103d94e (patch)
treea4d3e1005c57591b44fd57be4c1b00441512e36d /src/main.cpp
parentf1fc192ddc4c739fa8b4b376c759b7d3218a34eb (diff)
downloadmeowcraft-129f2e421e16bd008cdca8713cc91f67d103d94e.tar.zst
meowcraft-129f2e421e16bd008cdca8713cc91f67d103d94e.zip
Fix minor quality issues
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/main.cpp b/src/main.cpp
index a264f3e..0995b5b 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -13,17 +13,17 @@
 
 #define APP_NAME "Meowcraft"
 
-#define WINDOW_WIDTH 1000
-#define WINDOW_HEIGHT 800
-#define ASPECT static_cast<float>(WINDOW_WIDTH) / WINDOW_HEIGHT
+#define WINDOW_WIDTH 800
+#define WINDOW_HEIGHT 600
+#define ASPECT (static_cast<float>(WINDOW_WIDTH) / WINDOW_HEIGHT)
 
 #define FOV 90
 
 void run();
-void render(MC::GFX::BindableMesh&, MC::GFX::Texture&);
+void render(const MC::GFX::BindableMesh&, const MC::GFX::Texture&);
 void process_input(MC::GFX::Window&, MC::GFX::Camera&);
 void setup_gl();
-void fix_macos_render(MC::GFX::Window&);
+void fix_macos_render(const MC::GFX::Window&);
 
 int main() {
     glfwInit();
@@ -45,7 +45,7 @@ void run() {
     setup_gl();
 
     glViewport(0, 0, WINDOW_WIDTH, WINDOW_HEIGHT);
-    window.on_size_change([](GLFWwindow* window, int w, int h) {
+    window.on_size_change([](GLFWwindow* _, int w, int h) {
         glViewport(0, 0, w, h);
     });
 
@@ -112,7 +112,7 @@ void run() {
     }
 }
 
-void render(MC::GFX::BindableMesh& mesh, MC::GFX::Texture& texture) {
+void render(const MC::GFX::BindableMesh& mesh, const MC::GFX::Texture& texture) {
     texture.bind();
     mesh.bind();
     glDrawElements(GL_TRIANGLES, mesh.size(), GL_UNSIGNED_INT, nullptr);
@@ -127,7 +127,7 @@ void process_input(MC::GFX::Window& window, MC::GFX::Camera& camera) {
 
     auto r = window.mouse_delta();
 
-    auto key = [&](int key) -> float { return window.key(key, GLFW_PRESS); };
+    auto key = [&](int k) -> float { return window.key(k, GLFW_PRESS); };
 
     float x = key(GLFW_KEY_D) - key(GLFW_KEY_A);
     float y = key(GLFW_KEY_SPACE) - key(GLFW_KEY_LEFT_SHIFT);
@@ -150,7 +150,7 @@ void setup_gl() {
     }
 }
 
-void fix_macos_render(MC::GFX::Window& window) {
+void fix_macos_render(const MC::GFX::Window& window) {
     static bool moved = false;
 
     if(!moved) {