setting it up for macos
This commit is contained in:
Vendored
+20
@@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
// Use IntelliSense to learn about possible attributes.
|
||||||
|
// Hover to view descriptions of existing attributes.
|
||||||
|
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"name": "(lldb) Launch",
|
||||||
|
"type": "cppdbg",
|
||||||
|
"request": "launch",
|
||||||
|
"program": "${workspaceFolder}/bin/RayTracer",
|
||||||
|
"args": [],
|
||||||
|
"stopAtEntry": false,
|
||||||
|
"cwd": "${workspaceFolder}/bin/",
|
||||||
|
"environment": [],
|
||||||
|
"externalConsole": false,
|
||||||
|
"MIMode": "lldb"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Vendored
+3
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"cmake.buildDirectory": "${workspaceFolder}/bin/"
|
||||||
|
}
|
||||||
@@ -21,7 +21,11 @@ add_executable(RayTracer "")
|
|||||||
target_include_directories(RayTracer PUBLIC src/)
|
target_include_directories(RayTracer PUBLIC src/)
|
||||||
target_link_libraries(RayTracer PUBLIC assimp::assimp)
|
target_link_libraries(RayTracer PUBLIC assimp::assimp)
|
||||||
target_link_libraries(RayTracer PUBLIC glfw)
|
target_link_libraries(RayTracer PUBLIC glfw)
|
||||||
|
if(APPLE)
|
||||||
|
target_link_libraries(RayTracer PUBLIC GLEW::GLEW)
|
||||||
|
else()
|
||||||
target_link_libraries(RayTracer PUBLIC GLEW::glew)
|
target_link_libraries(RayTracer PUBLIC GLEW::glew)
|
||||||
|
endif()
|
||||||
target_link_libraries(RayTracer PUBLIC glm::glm)
|
target_link_libraries(RayTracer PUBLIC glm::glm)
|
||||||
target_link_libraries(RayTracer PUBLIC KTX::ktx)
|
target_link_libraries(RayTracer PUBLIC KTX::ktx)
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@
|
|||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
BVH bvh;
|
BVH bvh;
|
||||||
bvh.addModels(ModelLoader::loadModel("../../cube.fbx"), glm::mat4());
|
bvh.addModels(ModelLoader::loadModel("../cube.fbx"), glm::mat4());
|
||||||
bvh.generate();
|
bvh.generate();
|
||||||
Window w(1920, 1080);
|
Window w(1920, 1080);
|
||||||
std::vector<uint32_t> texture(1920 * 1080);
|
std::vector<uint32_t> texture(1920 * 1080);
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <glm/glm.hpp>
|
#include <glm/glm.hpp>
|
||||||
#include <utility>
|
#include <algorithm>
|
||||||
|
|
||||||
struct AABB
|
struct AABB
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -9,11 +9,12 @@ Window::Window(int width, int height) : width(width), height(height)
|
|||||||
glewExperimental = true;
|
glewExperimental = true;
|
||||||
assert(glfwInit());
|
assert(glfwInit());
|
||||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
|
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
|
||||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 5);
|
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
|
||||||
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); // We don't want the old OpenGL
|
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); // We don't want the old OpenGL
|
||||||
window = glfwCreateWindow(width, height, "RayTracer", nullptr, nullptr);
|
window = glfwCreateWindow(width, height, "RayTracer", nullptr, nullptr);
|
||||||
glfwMakeContextCurrent(window);
|
glfwMakeContextCurrent(window);
|
||||||
assert(!glewInit());
|
std::cout << glewInit() <<std::endl;
|
||||||
|
std::cout <<glewGetErrorString(1) <<std::endl;
|
||||||
glGenVertexArrays(1, &vao);
|
glGenVertexArrays(1, &vao);
|
||||||
glBindVertexArray(vao);
|
glBindVertexArray(vao);
|
||||||
glGenTextures(1, &texture);
|
glGenTextures(1, &texture);
|
||||||
|
|||||||
Reference in New Issue
Block a user