-
Notifications
You must be signed in to change notification settings - Fork 0
Window
Noah Gallo edited this page Mar 12, 2023
·
4 revisions
In every project, the first thing you must create is a window object. Every Window has a Scene associated with it.
In future versions, we intend to create our own callback functionality. For now, however, one can create their own window callbacks using the OpenGL Window callback system and the internal GLFWwindow pointer.
Once you've set up your window and scene, you can call Window.StartApplication() to begin rendering your scene. (Note: Only one Window can be running at a time). This will begin the internal application loop, updating the scene each frame.
While the application is running, you can call Window::main to grab the current running window.
| Name | Type | Description |
|---|---|---|
| main | Window* | A pointer to the current running window |
| Signature | Return Type | Description |
|---|---|---|
| CreateWindow() | Window* | Creates a new Window and returns it to the user. Returns null if it fails to initialize the window. |
| Name | Property? | Type | Description |
|---|---|---|---|
| window | No | GLFWwindow* | A pointer to the GLFW window assciated with this window |
| scene | No | Scene | The scene this window is set to run |
| Resolution | YES | ivec2 | The Resolution of the current window |
| Signature | Return Type | Description |
|---|---|---|
| StartApplication() | void | Begins the main application loop |
| GetTime() | float | Returns the time since the window was created |
| DeltaTime() | float | Returns the amount of time between the current frame and the last frame |