Added abstracted window
Added Lua interpreter
This commit is contained in:
		@ -16,7 +16,9 @@ class BarinkWindow{
 | 
			
		||||
        BarinkWindow(const int width, const int height);
 | 
			
		||||
        ~BarinkWindow();
 | 
			
		||||
 | 
			
		||||
        void EnterLoop();
 | 
			
		||||
        bool WindowShouldClose();
 | 
			
		||||
 | 
			
		||||
        void Poll();
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
};
 | 
			
		||||
@ -1,6 +1,7 @@
 | 
			
		||||
#include "MyGraphicsEngine/Window.h"
 | 
			
		||||
#include <spdlog/spdlog.h>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
bool BarinkWindow::InitGLFW(){
 | 
			
		||||
	if(!glfwInit())
 | 
			
		||||
	{
 | 
			
		||||
@ -31,6 +32,8 @@ Width(width), Height(height), FullScreen(false){
 | 
			
		||||
	glViewport(0,0, Width, Height);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -39,13 +42,12 @@ BarinkWindow::~BarinkWindow(){
 | 
			
		||||
	glfwTerminate();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void BarinkWindow::EnterLoop(){
 | 
			
		||||
	while(!glfwWindowShouldClose(window))
 | 
			
		||||
	{
 | 
			
		||||
		glClear(GL_COLOR_BUFFER_BIT);
 | 
			
		||||
bool BarinkWindow::WindowShouldClose(){
 | 
			
		||||
	return glfwWindowShouldClose(window);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		glfwSwapBuffers(window);
 | 
			
		||||
		glfwPollEvents();
 | 
			
		||||
 | 
			
		||||
	}
 | 
			
		||||
void BarinkWindow::Poll()
 | 
			
		||||
{
 | 
			
		||||
	glfwSwapBuffers(window);
 | 
			
		||||
	glfwPollEvents();
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user