Beginning writing gui and window wrapper for GLFW
This commit is contained in:
		
					parent
					
						
							
								10cb797084
							
						
					
				
			
			
				commit
				
					
						9dfe0faa56
					
				
			
		
					 8 changed files with 141 additions and 4 deletions
				
			
		
							
								
								
									
										5
									
								
								src/gui.cpp
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								src/gui.cpp
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,5 @@
 | 
			
		|||
#include "gui.hpp"
 | 
			
		||||
 | 
			
		||||
gui::Gui::~Gui() noexcept {
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										5
									
								
								src/gui_data.cpp
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								src/gui_data.cpp
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,5 @@
 | 
			
		|||
//
 | 
			
		||||
// Created by postaron on 08/01/2022.
 | 
			
		||||
//
 | 
			
		||||
 | 
			
		||||
#include "gui_data.hpp"
 | 
			
		||||
| 
						 | 
				
			
			@ -1,6 +1,10 @@
 | 
			
		|||
#include <iostream>
 | 
			
		||||
#include <spdlog/spdlog.h>
 | 
			
		||||
#include <spdlog/sinks/stdout_sinks.h>
 | 
			
		||||
 | 
			
		||||
int main() {
 | 
			
		||||
	std::cout << "Hello, World!" << std::endl;
 | 
			
		||||
	std::ios::sync_with_stdio(false);
 | 
			
		||||
	spdlog::set_default_logger(spdlog::stdout_logger_st("console"));
 | 
			
		||||
	SPDLOG_WARN("Hello world !");
 | 
			
		||||
	return EXIT_SUCCESS;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										13
									
								
								src/window.cpp
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								src/window.cpp
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,13 @@
 | 
			
		|||
#include <stdexcept>
 | 
			
		||||
#include "window.hpp"
 | 
			
		||||
 | 
			
		||||
gui::Window::Window() {
 | 
			
		||||
	glfwSetErrorCallback(nullptr);
 | 
			
		||||
	if (glfwInit() == GLFW_FALSE) {
 | 
			
		||||
		throw std::runtime_error("GLFW init failed.");
 | 
			
		||||
	}
 | 
			
		||||
	glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
 | 
			
		||||
	glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
 | 
			
		||||
	wwindow = std::unique_ptr<GLFWwindow, decltype(&delete_glfw_window)>(glfwCreateWindow(600, 800, "Billy Sheet tracker", nullptr, nullptr),
 | 
			
		||||
																		 delete_glfw_window);
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue