Files
RedScarfEngine/graphics/src/window.h
T
Piotr Krygier 173a82b9d1 [WIP] Refactor project
There are many problems with the way the current version is provided
and maintained. This commit or series of commits will fix this.
2025-06-20 13:44:33 +02:00

51 lines
1.2 KiB
C

/**
* @file window.h
* @author Piotr Krygier (everyonencancode@gmail.com)
* @brief Window control system
* @version 0.1
* @date 2022-02-15
*
* @copyright Copyright (c) 2022
*
*/
#ifndef WINDOW_H
#define WINDOW_H
#include <vulkan/vulkan.h>
/* Vulkan header MUST be included before glfw */
#include <GLFW/glfw3.h>
#include "utilities/commons.h"
#include "graphics_context.h"
/**
* @brief Initialize window
*
* @param window_handle Pointer to window window_handle, that will be initialized
* @param is_framebuffer_resized Pointer to boolean, that will be set to true if framebuffer was resized
* @return rse_err_t WINDOW_SUCCESS on success. Possible errors:
* WINDOW_VULKAN_NOT_LOADED
* WINDOW_WINDOW_NOT_CREATED
*
*/
rse_err_t window_init(GLFWwindow* window_handle, bool* is_framebuffer_resized);
/**
* @brief Main window loop
*
* @param context Graphics context
* @return rse_err_t WINDOW_SUCCESS or error code
*/
rse_err_t window_loop(struct graphics_context_t* context);
/**
* @brief Closes window and terminates GLFW
*
* @param window_handle Pointer to window window_handle
*/
void window_terminate(GLFWwindow* window_handle);
#endif /* WINDOW_H */