Commit 1ea02492 authored by Robert Scott James's avatar Robert Scott James

Initial commit

parents
Pipeline #135 skipped
cmake_minimum_required(VERSION 3.5)
project(worldGenerator)
set(VERBOSE 1)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
add_subdirectory(glfw-3.1.2)
include_directories(glfw-3.1.2/include)
set(SOURCE_FILES main.cpp)
add_executable(worldGenerator ${SOURCE_FILES})
target_link_libraries(worldGenerator glfw ${GLFW_LIBRARIES})
\ No newline at end of file
#include <iostream>
#include <GLFW/glfw3.h>
using namespace std;
int main() {
if (!glfwInit()) {
cerr << "GLFW Failed" << endl;
exit(EXIT_FAILURE);
}
GLFWwindow* window;
window = glfwCreateWindow(640, 640, "Planet Generator", NULL, NULL);
if (!window){
glfwTerminate();
exit(EXIT_FAILURE);
}
/* Make the window's context current */
glfwMakeContextCurrent(window);
/* Loop until the user closes the window */
while (!glfwWindowShouldClose(window)){
/* Render here */
/* Swap front and back buffers */
glfwSwapBuffers(window);
/* Poll for and process events */
glfwPollEvents();
}
glfwTerminate();
return 0;
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment