created basic GLFW window
This commit is contained in:
parent
ea33054175
commit
2f8e8a0a91
2
Makefile
2
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)))
|
||||
|
22
src/main.cpp
22
src/main.cpp
@ -1,6 +1,28 @@
|
||||
#include <iostream>
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user