Skip to content
Snippets Groups Projects
Commit 3baef895 authored by Sebastian Gaida's avatar Sebastian Gaida
Browse files

[#8] add CoreManager-Class and basic glfw-Functions

parent b36bc286
No related branches found
No related tags found
1 merge request!9Resolve "Window creation"
This commit is part of merge request !9. Comments created here will be created in the context of that merge request.
......@@ -2,4 +2,6 @@
set(vkcv_sources
${vkcv_source}/vkcv/Context.hpp
${vkcv_source}/vkcv/Context.cpp
${vkcv_source}/vkcv/CoreManager.hpp
${vkcv_source}/vkcv/CoreManager.cpp
)
#define GLFW_INCLUDE_VULKAN
#include "CoreManager.hpp"
namespace vkcv {
int glfwCounter = 0;
void initGLFW() {
if (glfwCounter == 0) {
int glfwSuccess = glfwInit();
if (glfwSuccess == GLFW_FALSE) {
throw std::runtime_error("Could not initialize GLFW");
}
}
glfwCounter++;
}
void terminateGLFW() {
if (glfwCounter == 1) {
glfwTerminate();
}
glfwCounter--;
}
}
\ No newline at end of file
#ifndef VKCV_COREMANAGER_HPP
#define VKCV_COREMANAGER_HPP
#include <GLFW/glfw3.h>
#include <stdexcept>
namespace vkcv {
/**
* initialize GLFW if not initialized
*/
void initGLFW();
/**
* terminate GLFW
*/
void terminateGLFW();
}
#endif //VKCV_COREMANAGER_HPP
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment