Add project files.
This commit is contained in:
parent
1201064a60
commit
bc7ef93844
|
|
@ -0,0 +1,40 @@
|
||||||
|
#pragma once
|
||||||
|
#include <algorithm>
|
||||||
|
#include <tuple>
|
||||||
|
#include <SFML/Graphics.hpp>
|
||||||
|
#include <imgui-SFML.h>
|
||||||
|
#include <imgui.h>
|
||||||
|
|
||||||
|
#include "Random.h"
|
||||||
|
|
||||||
|
template<typename T, typename U, typename V>
|
||||||
|
T getRandomNumber(U min, V max)
|
||||||
|
{
|
||||||
|
return static_cast<T>(Random::get(min, max));
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T, typename U, typename V, typename W>
|
||||||
|
inline sf::Color createColor(T r, U g, V b, W a)
|
||||||
|
{
|
||||||
|
return sf::Color(static_cast<std::uint8_t>(r), static_cast<std::uint8_t>(g), static_cast<std::uint8_t>(b), static_cast<std::uint8_t>(a));
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T, typename U, typename V>
|
||||||
|
inline sf::Color createColor(T r, U g, V b, std::uint8_t a = 255u)
|
||||||
|
{
|
||||||
|
return sf::Color(static_cast<std::uint8_t>(r), static_cast<std::uint8_t>(g), static_cast<std::uint8_t>(b), a);
|
||||||
|
}
|
||||||
|
|
||||||
|
sf::Color getRandomColor()
|
||||||
|
{
|
||||||
|
return sf::Color(getRandomNumber<std::uint8_t>(0u, 255u), getRandomNumber<std::uint8_t>(0u, 255u), getRandomNumber<std::uint8_t>(0u, 255u));
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
T signage(T in)
|
||||||
|
{
|
||||||
|
T zero{};
|
||||||
|
if (in > zero) return ++zero;
|
||||||
|
if (in < zero) return --zero;
|
||||||
|
return zero;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,77 @@
|
||||||
|
#pragma once
|
||||||
|
#ifndef RANDOM_MT_H
|
||||||
|
#define RANDOM_MT_H
|
||||||
|
|
||||||
|
#include <chrono>
|
||||||
|
#include <random>
|
||||||
|
|
||||||
|
// This header-only Random namespace implements a self-seeding Mersenne Twister
|
||||||
|
// It can be included into as many code files as needed (The inline keyword avoids ODR violations)
|
||||||
|
// Freely redistributable, courtesy of learncpp.com
|
||||||
|
namespace Random
|
||||||
|
{
|
||||||
|
// Returns a seeded Mersenne Twister
|
||||||
|
// Note: we'd prefer to return a std::seed_seq (to initialize a std::mt19937), but std::seed can't be copied, so it can't be returned by value.
|
||||||
|
// Instead, we'll create a std::mt19937, seed it, and then return the std::mt19937 (which can be copied).
|
||||||
|
inline std::mt19937 generate()
|
||||||
|
{
|
||||||
|
std::random_device rd{};
|
||||||
|
|
||||||
|
// Create seed_seq with clock and 7 random numbers from std::random_device
|
||||||
|
std::seed_seq ss{
|
||||||
|
static_cast<std::seed_seq::result_type>(std::chrono::steady_clock::now().time_since_epoch().count()),
|
||||||
|
rd(), rd(), rd(), rd(), rd(), rd(), rd() };
|
||||||
|
|
||||||
|
return std::mt19937{ ss };
|
||||||
|
}
|
||||||
|
|
||||||
|
// Here's our global std::mt19937 object.
|
||||||
|
// The inline keyword means we only have one global instance for our whole program.
|
||||||
|
inline std::mt19937 mt{ generate() }; // generates a seeded std::mt19937 and copies it into our global object
|
||||||
|
|
||||||
|
// Generate a random int between [min, max] (inclusive)
|
||||||
|
inline int get(int min, int max)
|
||||||
|
{
|
||||||
|
return std::uniform_int_distribution{ min, max }(mt);
|
||||||
|
}
|
||||||
|
|
||||||
|
// The following function templates can be used to generate random numbers
|
||||||
|
// when min and/or max are not type int
|
||||||
|
// See https://www.learncpp.com/cpp-tutorial/function-template-instantiation/
|
||||||
|
// You can ignore these if you don't understand them
|
||||||
|
|
||||||
|
// Generate a random value between [min, max] (inclusive)
|
||||||
|
// * min and max have same type
|
||||||
|
// * Return value has same type as min and max
|
||||||
|
// * Supported types:
|
||||||
|
// * short, int, long, long long
|
||||||
|
// * unsigned short, unsigned int, unsigned long, or unsigned long long
|
||||||
|
// Sample call: Random::get(1L, 6L); // returns long
|
||||||
|
// Sample call: Random::get(1u, 6u); // returns unsigned int
|
||||||
|
template <typename T>
|
||||||
|
T get(T min, T max)
|
||||||
|
{
|
||||||
|
return std::uniform_int_distribution<T>{min, max}(mt);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Generate a random value between [min, max] (inclusive)
|
||||||
|
// * min and max can have different types
|
||||||
|
// * Must explicitly specify return type as template type argument
|
||||||
|
// * min and max will be converted to the return type
|
||||||
|
// Sample call: Random::get<std::size_t>(0, 6); // returns std::size_t
|
||||||
|
// Sample call: Random::get<std::size_t>(0, 6u); // returns std::size_t
|
||||||
|
// Sample call: Random::get<std::int>(0, 6u); // returns int
|
||||||
|
template <typename R, typename S, typename T>
|
||||||
|
R get(S min, T max)
|
||||||
|
{
|
||||||
|
return get<R>(static_cast<R>(min), static_cast<R>(max));
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T, typename U, typename V>
|
||||||
|
T getRandomNumber(U min, V max)
|
||||||
|
{
|
||||||
|
return static_cast<T>(get(min, max));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
[Window][Debug##Default]
|
||||||
|
Pos=60,60
|
||||||
|
Size=400,400
|
||||||
|
|
||||||
|
[Window][Config]
|
||||||
|
Pos=60,60
|
||||||
|
Size=395,254
|
||||||
|
|
||||||
|
|
@ -0,0 +1,302 @@
|
||||||
|
#include <SFML/Graphics.hpp>
|
||||||
|
#include <imgui-SFML.h>
|
||||||
|
#include <imgui.h>
|
||||||
|
#include <cmath>
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <vector>
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
|
#include "Helper.hpp"
|
||||||
|
|
||||||
|
struct LineSegment
|
||||||
|
{
|
||||||
|
sf::Vector2f a{};
|
||||||
|
|
||||||
|
sf::Vector2f b{};
|
||||||
|
};
|
||||||
|
|
||||||
|
struct Intersect { bool result{}; sf::Vector2f pos{}; };
|
||||||
|
|
||||||
|
struct imguiColor
|
||||||
|
{
|
||||||
|
float r{};
|
||||||
|
float g{};
|
||||||
|
float b{};
|
||||||
|
float a{1.f};
|
||||||
|
|
||||||
|
sf::Color asSfColor()
|
||||||
|
{
|
||||||
|
return sf::Color(std::uint8_t(r * 255.f), std::uint8_t(g * 255.f), std::uint8_t(b * 255.f), std::uint8_t(a * 255.f));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
imguiColor constructImguiColor(sf::Color color)
|
||||||
|
{
|
||||||
|
return imguiColor((float)color.r / 255.f, (float)color.g / 255.f, (float)color.b / 255.f, (float)color.a / 255.f);
|
||||||
|
}
|
||||||
|
|
||||||
|
Intersect lineIntersect(LineSegment first, LineSegment second)
|
||||||
|
{
|
||||||
|
sf::Vector2f firstVector = (first.b - first.a);
|
||||||
|
sf::Vector2f secondVector = (second.b - second.a);
|
||||||
|
|
||||||
|
float lengthCrossProduct = firstVector.cross(secondVector);
|
||||||
|
|
||||||
|
sf::Vector2f fms = second.a - first.a; //first line start point minus second
|
||||||
|
|
||||||
|
float firstScalar = fms.cross(secondVector) / lengthCrossProduct;
|
||||||
|
float secondScalar = fms.cross(firstVector) / lengthCrossProduct;
|
||||||
|
|
||||||
|
if ((firstScalar >= 0 and firstScalar <= 1) and (secondScalar >= 0 and secondScalar <= 1))
|
||||||
|
return{ true, sf::Vector2f(first.a.x + (firstScalar * firstVector.x), first.a.y + (firstScalar * firstVector.y)) };
|
||||||
|
else
|
||||||
|
return{ false, sf::Vector2f(0,0) };
|
||||||
|
}
|
||||||
|
|
||||||
|
sf::VertexArray constructRectangle(sf::Vector2f center, sf::Vector2f size, sf::Color color = sf::Color::Black)
|
||||||
|
{
|
||||||
|
sf::VertexArray rectangle(sf::PrimitiveType::LineStrip, 5);
|
||||||
|
rectangle[0].color = color;
|
||||||
|
rectangle[1].color = color;
|
||||||
|
rectangle[2].color = color;
|
||||||
|
rectangle[3].color = color;
|
||||||
|
rectangle[4].color = color;
|
||||||
|
|
||||||
|
rectangle[0].position = { center.x - size.x, center.y - size.y };
|
||||||
|
rectangle[1].position = { center.x + size.x, center.y - size.y };
|
||||||
|
rectangle[2].position = { center.x + size.x, center.y + size.y };
|
||||||
|
rectangle[3].position = { center.x - size.x, center.y + size.y };
|
||||||
|
rectangle[4].position = { center.x - size.x, center.y - size.y };
|
||||||
|
|
||||||
|
return rectangle;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
sf::Vector2f constructVector(sf::Vector2f startPoint, sf::Angle angle, float length)
|
||||||
|
{
|
||||||
|
return { startPoint.x + (length * std::cos(angle.asRadians())), startPoint.y + (length * std::sin(angle.asRadians())) };
|
||||||
|
}
|
||||||
|
|
||||||
|
sf::VertexArray constructRandomPolygon(sf::Vector2f center, int vertexLowerBound, int vertexUpperBound, int averageSize, sf::Color color = sf::Color::Black)
|
||||||
|
{
|
||||||
|
size_t vertexCount = getRandomNumber<size_t>(vertexLowerBound, vertexUpperBound);
|
||||||
|
sf::VertexArray polygon(sf::PrimitiveType::LineStrip, vertexCount);
|
||||||
|
|
||||||
|
float angleIncrement = 360.f / (float)(vertexCount - 1);
|
||||||
|
float angleStart = getRandomNumber<float>(0, 360);
|
||||||
|
|
||||||
|
for (int i = 0; i < vertexCount - 1; i++)
|
||||||
|
{
|
||||||
|
float angleOffset = getRandomNumber<float>(-(90 / (int)vertexCount), (90 / (int)vertexCount));
|
||||||
|
polygon[i].color = color;
|
||||||
|
polygon[i].position = constructVector(center, sf::degrees(angleStart + (angleIncrement * i) + angleOffset), getRandomNumber<float>((averageSize - 50), (averageSize + 50)));
|
||||||
|
}
|
||||||
|
polygon[vertexCount - 1].position = polygon[0].position;
|
||||||
|
polygon[vertexCount - 1].color = color;
|
||||||
|
return polygon;
|
||||||
|
}
|
||||||
|
|
||||||
|
sf::VertexArray constructRay(sf::Vector2f start, float length, sf::Angle angle, sf::Color color = sf::Color::Red)
|
||||||
|
{
|
||||||
|
sf::VertexArray ray(sf::PrimitiveType::Lines, 2);
|
||||||
|
|
||||||
|
ray[0].position = start;
|
||||||
|
ray[0].color = color;
|
||||||
|
ray[1].position = constructVector(start, angle, length);
|
||||||
|
ray[1].color = color;
|
||||||
|
|
||||||
|
return ray;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
sf::Vector2f center{ 1920.f / 2.f, 1080.f / 2.f };
|
||||||
|
|
||||||
|
//sfml setup
|
||||||
|
auto window = sf::RenderWindow(sf::VideoMode({ 1920u, 1080u }), "Ray Casting Test");
|
||||||
|
|
||||||
|
window.setFramerateLimit(144);
|
||||||
|
if (!ImGui::SFML::Init(window))
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
sf::Clock clock;
|
||||||
|
sf::Vector2f mousePos = center;
|
||||||
|
|
||||||
|
//imGui Variables
|
||||||
|
float polySize[2] = { 100.f, 100.f };
|
||||||
|
int numRays{ 10 };
|
||||||
|
int vertexBounds[2] = { 3u, 10u };
|
||||||
|
int averageSize{ 100u };
|
||||||
|
float rayLength{ 5000.f };
|
||||||
|
imguiColor rayColor = constructImguiColor(sf::Color::Red);
|
||||||
|
|
||||||
|
|
||||||
|
//initalize vectors
|
||||||
|
std::vector<sf::VertexArray> rays;
|
||||||
|
|
||||||
|
{
|
||||||
|
float i = 0.f, angleIncrement = 360.f / (float)numRays;
|
||||||
|
for (int i = 0; i < numRays; i++) rays.push_back(constructRay(mousePos, 5000.f, sf::degrees(angleIncrement * i), rayColor.asSfColor()));
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<sf::VertexArray> polygons;
|
||||||
|
polygons.push_back(constructRectangle(center, center));//outer bounds of the window
|
||||||
|
|
||||||
|
|
||||||
|
//main game loop
|
||||||
|
while (window.isOpen())
|
||||||
|
{
|
||||||
|
|
||||||
|
//handle input
|
||||||
|
while (const std::optional event = window.pollEvent())
|
||||||
|
{
|
||||||
|
ImGui::SFML::ProcessEvent(window, *event);
|
||||||
|
|
||||||
|
if (event->is<sf::Event::Closed>())
|
||||||
|
{
|
||||||
|
window.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (const auto* buttonPressed = event->getIf<sf::Event::KeyPressed>())
|
||||||
|
{
|
||||||
|
switch (buttonPressed->scancode)
|
||||||
|
{
|
||||||
|
case sf::Keyboard::Scancode::C:
|
||||||
|
polygons.clear();
|
||||||
|
polygons.push_back(constructRectangle(center, center));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case sf::Keyboard::Scancode::R:
|
||||||
|
polygons.push_back(constructRandomPolygon(mousePos, vertexBounds[0] + 1, vertexBounds[1] + 1, averageSize));
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (const auto* mousePressed = event->getIf<sf::Event::MouseButtonPressed>())
|
||||||
|
{
|
||||||
|
switch (mousePressed->button)
|
||||||
|
{
|
||||||
|
case sf::Mouse::Button::Right:
|
||||||
|
polygons.push_back(constructRectangle((sf::Vector2f)mousePressed->position, { polySize[0], polySize[1] }, sf::Color::Black));
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rays.empty()) continue;
|
||||||
|
if (const auto* mouseMoved = event->getIf<sf::Event::MouseMoved>())
|
||||||
|
{
|
||||||
|
mousePos = (sf::Vector2f)mouseMoved->position;
|
||||||
|
for (auto& ray : rays) ray[0].position = mousePos;
|
||||||
|
}
|
||||||
|
}// end user input loop
|
||||||
|
|
||||||
|
{
|
||||||
|
float i = 0, angleIncrement = 360.f / (float)rays.size();
|
||||||
|
for (auto& ray : rays)
|
||||||
|
{
|
||||||
|
ray[1].position = constructVector(ray[0].position, sf::degrees(i * angleIncrement), rayLength);
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (auto& ray : rays)
|
||||||
|
{
|
||||||
|
|
||||||
|
sf::Vector2f closestIntersection = ray[1].position;
|
||||||
|
Intersect currentIntersect{};
|
||||||
|
for (auto& poly : polygons)
|
||||||
|
{
|
||||||
|
for (int i = 1; i <= poly.getVertexCount() - 1; i++) {
|
||||||
|
currentIntersect = lineIntersect({ ray[0].position, ray[1].position }, { poly[i - 1].position , poly[i].position });
|
||||||
|
if (currentIntersect.result)
|
||||||
|
{
|
||||||
|
if ((closestIntersection - ray[0].position).length() > (currentIntersect.pos - ray[0].position).length())
|
||||||
|
{
|
||||||
|
closestIntersection = currentIntersect.pos;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ray[1].position = closestIntersection;
|
||||||
|
}
|
||||||
|
|
||||||
|
ImGui::SFML::Update(window, clock.restart());
|
||||||
|
|
||||||
|
ImGui::Begin("Config");
|
||||||
|
ImGui::Text("Controls:");
|
||||||
|
ImGui::Indent();
|
||||||
|
ImGui::Text("Right Click: place rectangle at mouse position");
|
||||||
|
ImGui::Text("R: place a randomly sized polygon at mouse position");
|
||||||
|
ImGui::Text("C: clear all polygons");
|
||||||
|
ImGui::Unindent();
|
||||||
|
if (ImGui::SliderInt("number of rays", &numRays, 0, 50))
|
||||||
|
{
|
||||||
|
rays.clear();
|
||||||
|
|
||||||
|
{
|
||||||
|
float i = 0.f, angleIncrement = 360.f / (float)numRays;
|
||||||
|
for (int i = 0; i < numRays; i++) rays.push_back(constructRay(mousePos, rayLength, sf::degrees(angleIncrement * i), rayColor.asSfColor()));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
ImGui::InputFloat("Ray Length", &rayLength);
|
||||||
|
if (ImGui::ColorEdit3("Ray color", &rayColor.r))
|
||||||
|
{
|
||||||
|
for (auto& ray : rays)
|
||||||
|
{
|
||||||
|
ray[0].color = rayColor.asSfColor();
|
||||||
|
ray[1].color = rayColor.asSfColor();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ImGui::InputFloat2("rectangle Size (X,Y)", polySize, "%.1f");
|
||||||
|
ImGui::Text("Random polygon config: ");
|
||||||
|
if (ImGui::SliderInt2("vertex count lower/upper bounds", vertexBounds, 3, 20))
|
||||||
|
{
|
||||||
|
if (vertexBounds[0] > vertexBounds[1])
|
||||||
|
vertexBounds[0] = vertexBounds[1];
|
||||||
|
|
||||||
|
if (vertexBounds[1] < vertexBounds[0])
|
||||||
|
vertexBounds[0] = vertexBounds[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
if(ImGui::InputInt("Average size", &averageSize))
|
||||||
|
{
|
||||||
|
if (averageSize < 20)
|
||||||
|
{
|
||||||
|
averageSize = 20;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ImGui::End();
|
||||||
|
|
||||||
|
window.clear(sf::Color::White);
|
||||||
|
|
||||||
|
//render entities
|
||||||
|
for (auto& poly : polygons)
|
||||||
|
window.draw(poly);
|
||||||
|
|
||||||
|
for (auto& ray : rays)
|
||||||
|
{
|
||||||
|
sf::CircleShape endPoint(5.f, 20u);
|
||||||
|
endPoint.setOrigin({ 5, 5 });
|
||||||
|
endPoint.setFillColor(rayColor.asSfColor());
|
||||||
|
endPoint.setPosition(ray[1].position);
|
||||||
|
window.draw(ray);
|
||||||
|
window.draw(endPoint);
|
||||||
|
}
|
||||||
|
|
||||||
|
ImGui::SFML::Render(window);
|
||||||
|
|
||||||
|
window.display();
|
||||||
|
}
|
||||||
|
|
||||||
|
ImGui::SFML::Shutdown();
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio Version 17
|
||||||
|
VisualStudioVersion = 17.13.35919.96 d17.13
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ray-casting-demos", "ray-casting-demos.vcxproj", "{87FCE63B-6FB0-41AF-9DDA-1D3A9D26BA8A}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|x64 = Debug|x64
|
||||||
|
Debug|x86 = Debug|x86
|
||||||
|
Release|x64 = Release|x64
|
||||||
|
Release|x86 = Release|x86
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{87FCE63B-6FB0-41AF-9DDA-1D3A9D26BA8A}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
|
{87FCE63B-6FB0-41AF-9DDA-1D3A9D26BA8A}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{87FCE63B-6FB0-41AF-9DDA-1D3A9D26BA8A}.Debug|x86.ActiveCfg = Debug|Win32
|
||||||
|
{87FCE63B-6FB0-41AF-9DDA-1D3A9D26BA8A}.Debug|x86.Build.0 = Debug|Win32
|
||||||
|
{87FCE63B-6FB0-41AF-9DDA-1D3A9D26BA8A}.Release|x64.ActiveCfg = Release|x64
|
||||||
|
{87FCE63B-6FB0-41AF-9DDA-1D3A9D26BA8A}.Release|x64.Build.0 = Release|x64
|
||||||
|
{87FCE63B-6FB0-41AF-9DDA-1D3A9D26BA8A}.Release|x86.ActiveCfg = Release|Win32
|
||||||
|
{87FCE63B-6FB0-41AF-9DDA-1D3A9D26BA8A}.Release|x86.Build.0 = Release|Win32
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
SolutionGuid = {2124D0EB-5864-4A34-B80A-25A316955369}
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
||||||
|
|
@ -0,0 +1,154 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
|
<ProjectConfiguration Include="Debug|Win32">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|Win32">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Debug|x64">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|x64">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
</ItemGroup>
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<VCProjectVersion>17.0</VCProjectVersion>
|
||||||
|
<Keyword>Win32Proj</Keyword>
|
||||||
|
<ProjectGuid>{87fce63b-6fb0-41af-9dda-1d3a9d26ba8a}</ProjectGuid>
|
||||||
|
<RootNamespace>ray_casting_demos</RootNamespace>
|
||||||
|
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v143</PlatformToolset>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v143</PlatformToolset>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v143</PlatformToolset>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v143</PlatformToolset>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||||
|
<ImportGroup Label="ExtensionSettings">
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="Shared">
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<PropertyGroup Label="UserMacros" />
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
<AdditionalIncludeDirectories>$(SFML_DIR)\include;$(IMGUI_SFML_DIR);C:\dev\libraries\opengl\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<LanguageStandard>stdcpp20</LanguageStandard>
|
||||||
|
<AssemblerOutput>AssemblyCode</AssemblerOutput>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<AdditionalLibraryDirectories>$(SFML_DIR)\lib;C:\dev\libraries\opengl\lib-vc2022;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<AdditionalDependencies>sfml-graphics-d.lib;sfml-system-d.lib;sfml-window-d.lib;sfml-audio-d.lib;sfml-network-d.lib;opengl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
<AdditionalIncludeDirectories>C:\dev\libraries\SFML-3.0.0\include;C:\dev\libraries\imgui;C:\dev\libraries\opengl\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<LanguageStandard>stdcpp20</LanguageStandard>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<AdditionalLibraryDirectories>C:\dev\libraries\SFML-3.0.0\lib;C:\dev\libraries\opengl\lib-vc2022;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<AdditionalDependencies>sfml-graphics.lib;sfml-system.lib;sfml-window.lib;sfml-audio.lib;sfml-network.lib;opengl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="..\..\..\..\..\dev\libraries\imgui\imgui-SFML.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\dev\libraries\imgui\imgui.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\dev\libraries\imgui\imgui_draw.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\dev\libraries\imgui\imgui_tables.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\dev\libraries\imgui\imgui_widgets.cpp" />
|
||||||
|
<ClCompile Include="main.cpp" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="Helper.hpp" />
|
||||||
|
<ClInclude Include="Random.h" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
</ImportGroup>
|
||||||
|
</Project>
|
||||||
|
|
@ -0,0 +1,48 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup>
|
||||||
|
<Filter Include="Source Files">
|
||||||
|
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||||
|
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Header Files">
|
||||||
|
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||||
|
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Resource Files">
|
||||||
|
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||||
|
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Source Files\Imgui-sfml Files">
|
||||||
|
<UniqueIdentifier>{20b9a3b4-eb7c-4baa-be0b-c6e0d295c347}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="main.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\..\..\..\..\dev\libraries\imgui\imgui.cpp">
|
||||||
|
<Filter>Source Files\Imgui-sfml Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\..\..\..\..\dev\libraries\imgui\imgui_draw.cpp">
|
||||||
|
<Filter>Source Files\Imgui-sfml Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\..\..\..\..\dev\libraries\imgui\imgui_tables.cpp">
|
||||||
|
<Filter>Source Files\Imgui-sfml Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\..\..\..\..\dev\libraries\imgui\imgui_widgets.cpp">
|
||||||
|
<Filter>Source Files\Imgui-sfml Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\..\..\..\..\dev\libraries\imgui\imgui-SFML.cpp">
|
||||||
|
<Filter>Source Files\Imgui-sfml Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="Helper.hpp">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="Random.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
Loading…
Reference in New Issue