setting it up for macos

This commit is contained in:
Dynamitos
2025-01-24 09:50:51 +01:00
parent 80cf4f8082
commit 45ed7c75be
6 changed files with 32 additions and 4 deletions
+20
View File
@@ -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"
}
]
}
+3
View File
@@ -0,0 +1,3 @@
{
"cmake.buildDirectory": "${workspaceFolder}/bin/"
}
+4
View File
@@ -21,7 +21,11 @@ add_executable(RayTracer "")
target_include_directories(RayTracer PUBLIC src/)
target_link_libraries(RayTracer PUBLIC assimp::assimp)
target_link_libraries(RayTracer PUBLIC glfw)
if(APPLE)
target_link_libraries(RayTracer PUBLIC GLEW::GLEW)
else()
target_link_libraries(RayTracer PUBLIC GLEW::glew)
endif()
target_link_libraries(RayTracer PUBLIC glm::glm)
target_link_libraries(RayTracer PUBLIC KTX::ktx)
+1 -1
View File
@@ -5,7 +5,7 @@
int main()
{
BVH bvh;
bvh.addModels(ModelLoader::loadModel("../../cube.fbx"), glm::mat4());
bvh.addModels(ModelLoader::loadModel("../cube.fbx"), glm::mat4());
bvh.generate();
Window w(1920, 1080);
std::vector<uint32_t> texture(1920 * 1080);
+1 -1
View File
@@ -1,7 +1,7 @@
#pragma once
#include <array>
#include <glm/glm.hpp>
#include <utility>
#include <algorithm>
struct AABB
{
+3 -2
View File
@@ -9,11 +9,12 @@ Window::Window(int width, int height) : width(width), height(height)
glewExperimental = true;
assert(glfwInit());
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
window = glfwCreateWindow(width, height, "RayTracer", nullptr, nullptr);
glfwMakeContextCurrent(window);
assert(!glewInit());
std::cout << glewInit() <<std::endl;
std::cout <<glewGetErrorString(1) <<std::endl;
glGenVertexArrays(1, &vao);
glBindVertexArray(vao);
glGenTextures(1, &texture);