Add AA samples as command line argument

This commit is contained in:
karl 2020-12-13 21:55:18 +01:00
parent 53810dd99f
commit 3a93f2410f

View File

@ -38,7 +38,14 @@ static void mouse_callback(GLFWwindow* window, double xpos, double ypos) {
world->emit<MouseMoveEvent>({xpos, ypos}); world->emit<MouseMoveEvent>({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? // TODO: Move this to RenderSystem?
GLFWwindow *window; GLFWwindow *window;
@ -47,7 +54,7 @@ int main() {
return -1; return -1;
// Anti Aliasing // Anti Aliasing
glfwWindowHint(GLFW_SAMPLES, 4); glfwWindowHint(GLFW_SAMPLES, aa_samples);
/* Create a windowed mode window and its OpenGL context */ /* Create a windowed mode window and its OpenGL context */
window = glfwCreateWindow(1280, 720, "ECSGame", NULL, NULL); window = glfwCreateWindow(1280, 720, "ECSGame", NULL, NULL);