diff --git a/Makefile b/Makefile index d4a3567..9957b5e 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ CXX := g++ CXXFLAGS := -std=c++11 -c LDFLAGS := -g -LDLIBS= +LDLIBS= -lglfw srcfiles := $(wildcard */*.cpp) objfiles := $(subst src,obj,$(subst .cpp,.o,$(srcfiles))) diff --git a/src/main.cpp b/src/main.cpp index 1e0ca28..cdbf967 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,6 +1,28 @@ #include +#include int main(){ std::cout << "Testing from work" << std::endl; + if(!glfwInit()){ + std::cerr << "Unable to initialize GLFW. Terminating." << std::endl; + return 0; + } + + GLFWwindow* window = glfwCreateWindow(800, 600, "Test Window", NULL, NULL); + if(!window){ + std::cerr << "Window creation failed. Terminating." << std::endl; + glfwTerminate(); + return 0; + } + glfwMakeContextCurrent(window); + while(!glfwWindowShouldClose(window)){ + // Game Loop + glfwSwapBuffers(window); + glfwPollEvents(); + } + + glfwDestroyWindow(window); + + glfwTerminate(); return 0; }