Commit b5331372 authored by Baldur Paulwitz's avatar Baldur Paulwitz

Working glfw

parent f39f12f2
 mm_raytracer.cpp
mm_raytracer.vcxproj -> C:\Users\eleph\source\repos\mm_raytracer\Debug\mm_raytracer.exe
mm_raytracer.vcxproj -> C:\Users\eleph\Documents\GitHub\mm_raytracer\VisualStudio\Debug\mm_raytracer.exe
B^C:\USERS\ELEPH\SOURCE\REPOS\MM_RAYTRACER\MM_RAYTRACER\MM_RAYTRACER.CPP
......
B^C:\USERS\ELEPH\DOCUMENTS\GITHUB\MM_RAYTRACER\VISUALSTUDIO\MM_RAYTRACER\MM_RAYTRACER.CPP
......
B^C:\USERS\ELEPH\DOCUMENTS\GITHUB\MM_RAYTRACER\VISUALSTUDIO\MM_RAYTRACER\MM_RAYTRACER.CPP
......
B^C:\USERS\ELEPH\SOURCE\REPOS\MM_RAYTRACER\MM_RAYTRACER\DEBUG\MM_RAYTRACER.OBJ
......
B^C:\USERS\ELEPH\DOCUMENTS\GITHUB\MM_RAYTRACER\VISUALSTUDIO\MM_RAYTRACER\DEBUG\MM_RAYTRACER.OBJ
......
B^C:\USERS\ELEPH\DOCUMENTS\GITHUB\MM_RAYTRACER\VISUALSTUDIO\MM_RAYTRACER\DEBUG\MM_RAYTRACER.OBJ
......
#TargetFrameworkVersion=v4.0:PlatformToolSet=v142:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=10.0
Debug|Win32|C:\Users\eleph\source\repos\mm_raytracer\|
Debug|Win32|C:\Users\eleph\Documents\GitHub\mm_raytracer\VisualStudio\|
#include <string.h>
#include <stdio.h>
#include <iostream>
#include "include/glad/glad.h"
#include <GLFW/glfw3.h>
#include "glCalls.h"
void int main(int argc, char const* argv[])
int main(int argc, char const* argv[])
{
GLFWwindow* window;
//TODO register error callback
//glfwSetErrorCallback(error_callback);
//try to init glfw
if (!glfwInit())
{
printf("Failed to initialize GLFW\n");
return -1;
}
//need at least OpenGl 4.3 for compute shader
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
//enable forward-compability and core profile
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
//define depth/stencil buffer
glfwWindowHint(GLFW_DEPTH_BITS, 0);
glfwWindowHint(GLFW_STENCIL_BITS, 0);
//create application window
window = glfwCreateWindow(640, 480, "Raytracer", NULL, NULL);
if (!window)
{
glfwTerminate();
return -1;
}
// makes the context of our window current aka this thread is now OpenGL rendering thread
glfwMakeContextCurrent(window);
//TODO load pointers to OpenGL functions/extensions at runtime
//gladLoadGLLoader((GLADloadproc)glfwGetProcAddress);
//set swap to 1
glfwSwapInterval(1);
//TODO init OpenGL stuff
//TODO register key callback (glfw)
//glfwSetKeyCallback(window, key_callback);
//main loop
while (!glfwWindowShouldClose(window))
{
//TODO do opengl stuff
glfwPollEvents();
}
//TODO clean up
//teardown(window);
//clean up glfw
glfwDestroyWindow(window);
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