From 7543350dfd86bd244e0b7e68483d475ae7594ff4 Mon Sep 17 00:00:00 2001 From: s473577 Date: Wed, 7 Feb 2024 13:34:39 +0100 Subject: [PATCH] Change window size to 1920x1080 --- grk/project/src/ex_9_1.hpp | 10 +++++++++- grk/project/src/main.cpp | 9 +++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/grk/project/src/ex_9_1.hpp b/grk/project/src/ex_9_1.hpp index 6ae33b0..cf1f207 100644 --- a/grk/project/src/ex_9_1.hpp +++ b/grk/project/src/ex_9_1.hpp @@ -27,9 +27,17 @@ #include "../ParticleSystem.h" #include "Camera.h" +#ifndef EX_9_1_HPP +#define EX_9_1_HPP + +extern int WIDTH; +extern int HEIGHT; + +#endif + const unsigned int SHADOW_WIDTH = 1024, SHADOW_HEIGHT = 1024; -int WIDTH = 500, HEIGHT = 500; +//int WIDTH = 1920, HEIGHT = 1080; namespace models { Core::RenderContext marbleBustContext; Core::RenderContext spaceshipContext; diff --git a/grk/project/src/main.cpp b/grk/project/src/main.cpp index 1bf7d23..18d7c5d 100644 --- a/grk/project/src/main.cpp +++ b/grk/project/src/main.cpp @@ -8,10 +8,11 @@ #include "ex_9_1.hpp" - +int WIDTH = 1920, HEIGHT = 1080; int main(int argc, char** argv) -{ +{ + // inicjalizacja glfw glfwInit(); glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); @@ -23,7 +24,7 @@ int main(int argc, char** argv) #endif // tworzenie okna za pomoca glfw - GLFWwindow* window = glfwCreateWindow(500, 500, "FirstWindow", NULL, NULL); + GLFWwindow* window = glfwCreateWindow(WIDTH, HEIGHT, "FirstWindow", NULL, NULL); if (window == NULL) { std::cout << "Failed to create GLFW window" << std::endl; @@ -34,7 +35,7 @@ int main(int argc, char** argv) // ladowanie OpenGL za pomoca glew glewInit(); - glViewport(0, 0, 500, 500); + glViewport(0, 0, WIDTH, HEIGHT); init(window);