Main - VictorAlvizo/Ventura GitHub Wiki
Main is landing point of the Ventura and mainly initializes GLFW, GLAD and ImGui. However, Main controls various features regarding the settings of the the window.
Gravity
Inital gravity value can be changed through the 3rd parameter in ventura = new Game(windowWidth, windowHeight, 50.0f);
. By default it's set to 50.0
Window size
By default, the window size will begin at 800x600. If you're not planning on going full screen but wanting to change the default window size the variables windowWidth
and windowHeight
must be changed to the desired value.
Example:
float windowWidth = 500, windowHeight = 315;
Full Screen
When going into full screen mode, uncomment the large block of code, and delete the uncommented line of code window = glfwCreateWindow(windowWidth, windowHeight, "Ventura", nullptr, nullptr);
. To control what window Ventura spawn on modify const GLFWvidmode * currentMode = glfwGetVideoMode(moniters[0]);
the 0 represents the primary moniter and allows you to choose what moniter the window should be opened on. To clarify, this line of code gets the information of the moniter wanted such as the moniter size. For example If the user has a second monitor you can spawn the window there by changing the 0 to a 1. You can tell how many monitors the user has connected through moniterCount
. If the number put in the array is larger than moniterCount the program will throw an exception. After choosing what moniter you want to get the information on there change the number in window = glfwCreateWindow(windowWidth, windowHeight, "Ventura", moniters[0], nullptr);
to the same as well; otherwise the dimensions of the window may be wrong.
Window Title
The default window title is Ventura, in order to change this. Modify window = glfwCreateWindow(windowWidth, windowHeight, "Ventura", nullptr, nullptr);
(as well as the other similar one when using fullscreen) by changing the "Ventura" part changing it to the desired title.
Favicon
When not in fullscreen, an icon will appear on the top left of the window. In order to change this icon, modify the "ProductImages/VenturaLogo.png"
in images[0].pixels = stbi_load("ProductImages/VenturaLogo.png", &images[0].width, &images[0].height, 0, 4);
to the file path of the desired image.