🎥 Windowing and Rendering Module¶
The main modules of Vuelto: the main window and the main renderer. Your entire project depends on these.
🌆 Overview¶
This module allows you to manage the main window and rendering operations, essential for any Vuelto project.
🏠 Window¶
To create a window, initialize a new instance and store it in a variable. Pass the following arguments: - Title: The title of your window. - Width: The width of the window in pixels. - Height: The height of the window in pixels. - Resizable: A boolean indicating whether the window can be resized.
Example¶
The renderer depends on this window to function.
🌈 Renderer¶
The renderer is responsible for drawing content onto the screen. To use it, initialize it using the window instance and store it in a variable.
Example¶
All drawing and rendering operations rely on this renderer.
♻️ Game Loop¶
Rendering operations should be performed within the game loop. This ensures that the application continues to respond to user input and updates the display correctly.
Structure of the Game Loop¶
window.Close()
: This function returnstrue
when the window is closed andfalse
when it is active. Use it to control the loop's execution.
Example Usage¶
Ensure all rendering tasks are enclosed within this loop to maintain smooth operation.