34 lines
959 B
C++
34 lines
959 B
C++
#include <iostream>
|
|
#include <fstream>
|
|
#include "RaycasterConfig.h"
|
|
#define GLAD_GL_IMPLEMENTATION
|
|
#include <glad/glad.h>
|
|
#define GLFW_INCLUDE_NONE
|
|
#include <GLFW/glfw3.h>
|
|
#include "Renderer.h"
|
|
|
|
int main(int argc, char *argv[]){
|
|
std::cout << Raycaster_VERSION_MAJOR << "." << Raycaster_VERSION_MINOR << std::endl;
|
|
if(!glfwInit()){
|
|
std::cout << "GLFW Init failed" << std::endl;
|
|
return -1;
|
|
}
|
|
GLFWwindow* window = glfwCreateWindow(640, 480, "My Title", NULL, NULL);
|
|
if (!window){
|
|
std::cout << "GLFW Window creation failed" << std::endl;
|
|
return -1;
|
|
}
|
|
glfwMakeContextCurrent(window);
|
|
gladLoadGL();
|
|
glViewport(0, 0, 640, 480);
|
|
Renderer::InitRenderer();
|
|
while(!glfwWindowShouldClose(window)){
|
|
Renderer::StartFrame();
|
|
Renderer::DrawTriangle();
|
|
Renderer::EndFrame();
|
|
glfwPollEvents();
|
|
glfwSwapBuffers(window);
|
|
}
|
|
glfwTerminate();
|
|
return 0;
|
|
} |