Nigel
dab01f1541
Correctly linking glfw and spdlog... Linking could be improved by not needing the sandbox application to also be linked with glfw
47 lines
749 B
C++
47 lines
749 B
C++
#include "MyGraphicsEngine/window.h"
|
|
|
|
|
|
bool BarinkWindow::InitGLFW(){
|
|
if(!glfwInit()){
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
BarinkWindow::BarinkWindow(const int width, const int height) :
|
|
Width(width), Height(height), FullScreen(false){
|
|
InitGLFW();
|
|
|
|
window = glfwCreateWindow(Width, Height, "BarinkEngine", NULL, NULL);
|
|
|
|
if( !window){
|
|
glfwTerminate();
|
|
return;
|
|
}
|
|
|
|
glfwMakeContextCurrent(window);
|
|
|
|
VulkanSupported = glfwVulkanSupported();
|
|
|
|
glfwGetFramebufferSize(window, &Width, &Height);
|
|
glViewport(0,0, Width, Height);
|
|
|
|
|
|
}
|
|
|
|
|
|
BarinkWindow::~BarinkWindow(){
|
|
|
|
glfwTerminate();
|
|
}
|
|
|
|
void BarinkWindow::EnterLoop(){
|
|
while(!glfwWindowShouldClose(window))
|
|
{
|
|
glClear(GL_COLOR_BUFFER_BIT);
|
|
|
|
glfwSwapBuffers(window);
|
|
glfwPollEvents();
|
|
|
|
}
|
|
} |