diff options
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 18 |
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) { |
