From 3a93f2410fdb27149044c4e643bcdda85ebeede3 Mon Sep 17 00:00:00 2001 From: karl Date: Sun, 13 Dec 2020 21:55:18 +0100 Subject: [PATCH] Add AA samples as command line argument --- main.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/main.cpp b/main.cpp index 5a491b1..dbfc343 100644 --- a/main.cpp +++ b/main.cpp @@ -38,7 +38,14 @@ static void mouse_callback(GLFWwindow* window, double xpos, double ypos) { world->emit({xpos, ypos}); } -int main() { +int main(int argc, char **argv) { + // Parse command line parameters + int aa_samples = 4; + + for (int i = 0; i < argc; ++i) { + if (strcmp(argv[i], "-a") == 0) aa_samples = std::stoi(argv[i + 1]); + } + // TODO: Move this to RenderSystem? GLFWwindow *window; @@ -47,7 +54,7 @@ int main() { return -1; // Anti Aliasing - glfwWindowHint(GLFW_SAMPLES, 4); + glfwWindowHint(GLFW_SAMPLES, aa_samples); /* Create a windowed mode window and its OpenGL context */ window = glfwCreateWindow(1280, 720, "ECSGame", NULL, NULL);