211 void setEditorAddElementsCallback(
void (*)());
286#ifdef ENABLE_VULKAN_VALIDATION_LAYERS
295 VkDebugUtilsMessengerEXT debugMessenger;
358#ifdef ENABLE_VULKAN_VALIDATION_LAYERS
365 void setupDebugMessenger();
392#ifdef CHRONOS_PROFILING
402 static float prevTime = 0.0f;
403 float current_time =
static_cast<float>(glfwGetTime());
404 float fps = 1.0f / (current_time - prevTime);
405 prevTime = current_time;
409 float getWaitTime() {
return waitTime; }
410 float getUpdateTime() {
return updateTime; }
411 float getCpuTime() {
return cpuTime; }
412 float getTotalTime() {
return totalTime; }
413 float getPresentTime() {
return presentTime; }
416 float waitTime = 0.0f;
417 float updateTime = 0.0f;
418 float cpuTime = 0.0f;
419 float totalTime = 0.0f;
420 float presentTime = 0.0f;
This initializes, manages and destroys the logical and physical devices(GPU).
uint32_t currentFrame
The current frame to be rendered to.
Chronos::Engine::Device device
This is the object that manages the device.
VkCommandPool commandPool
The command Pool.
void initVulkan()
The complicated process of initalizing the vulkan API is done here.
std::vector< VkSemaphore > imageAvailableSemaphores
VkInstance instance
The Vulkan instance.
void resizeFrameBuffer()
Tells the engine that the window has to be resized. This is called by GLFW.
void createSurface()
Creates the surface to render to.
std::vector< VkSemaphore > renderFinishedSemaphores
std::vector< VkFence > inFlightFences
void drawFrame()
Main draw call. Its responsible for drawing frames and resizing the window. To be added to the main g...
void initWindow()
This function initializes the GLFW window.
Chronos::Engine::ObjectManager objectManager
void cleanup()
Cleans up vulkan objects.
void createSyncObjects()
Creates sync objects for rendering.
GLFWwindow * window
This is the GLFW window reference that is used by the engine.
void createInstance()
Creates a vulkan instance.
float bgColor[3]
This is the background color of the window.
~Engine()
This is the destructor of the engine.
Engine()
Initlizes the engine.
void changeMSAASettings()
int height
This is the initial width of the window. It can be changed later just by changing this directly.
VkSampleCountFlagBits newMSAAMode
Chronos::Engine::TextureManager textureManager
Used to create and manage textures.
void setPresentMode(std::string mode)
Changes the present mode of the swapchain.
bool framebufferResized
Does the framebuffer need to be resized?
void changeMSAA(std::string)
std::vector< std::string > getAvailableMSAAModes()
VkSurfaceKHR surface
The surface to render to.
int width
This is the initial width of the window. It can be changed later just by changing this directly.
Chronos::Engine::SwapChain swapChain
This is the object that manages the swapchain.
This is the texture manager for Chronos. It handles creation, modification, updating and desrtuction ...
Defines the ObjectManager class for managing objects in the Chronos::Engine namespace.
Contains the swapChain class along with all the swapChain related functions.
Contains the class for managing textures in the Chronos::Engine namespace.