Skip to content
This repository has been archived by the owner on May 29, 2024. It is now read-only.

Commit

Permalink
[FEAT]: init renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
bobis33 committed Apr 12, 2024
1 parent 4e8c5d9 commit 4f5c56f
Show file tree
Hide file tree
Showing 8 changed files with 91 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#include <utility>

#include "../../../App/include/RayTracer/Parser.hpp"
#include "RayTracer/Parser.hpp"

namespace RayTracer {

Expand Down
34 changes: 34 additions & 0 deletions App/include/RayTracer/RuntimeException.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
** EPITECH PROJECT, 2024
** Raytracer | RunTimeException
** File description:
** RunTimeException.hpp
*/

#ifndef RAYTRACER_RUNTIME_EXCEPTION_HPP
#define RAYTRACER_RUNTIME_EXCEPTION_HPP

#include <iostream>

namespace RayTracer {

class RunTimeException : public std::exception
{
public:
explicit RunTimeException(std::string msg) : m_msg{std::move(msg)} {}
~RunTimeException() override = default;

RunTimeException(const RunTimeException &) = delete;
RunTimeException &operator=(const RunTimeException &) = delete;
RunTimeException(const RunTimeException &&) = delete;
RunTimeException &operator=(const RunTimeException &&) = delete;

[[nodiscard]] const char *what() const noexcept override { return m_msg.c_str(); };

private:
std::string m_msg{0};

}; // RendererException
} // namespace RayTracer

#endif //RAYTRACER_RUNTIME_EXCEPTION_HPP
22 changes: 22 additions & 0 deletions App/include/RayTracer/abstraction/IRenderer.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
** EPITECH PROJECT, 2024
** Raytracer
** File description:
** IRenderer.cpp
*/

#ifndef RAYTRACER_ILIGHTS_HPP
#define RAYTRACER_ILIGHTS_HPP

namespace RayTracer {

class IRenderer {

public:
virtual ~IRenderer() = default;

}; // IRenderer

} // namespace RayTracer

#endif //RAYTRACER_IRENDERER_HPP
24 changes: 24 additions & 0 deletions App/plugins/Renderer/include/RayTracer/renderer.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
** EPITECH PROJECT, 2024
** Raytracer | renderer
** File description:
** renderer.hpp
*/

#ifndef RAYTRACER_RENDERER_HPP
#define RAYTRACER_RENDERER_HPP

#include "RayTracer/abstraction/IRenderer.hpp"

namespace RayTracer {

class Renderer : IRenderer {

public:
~Renderer() override = default;

}; // Renderer

} // namespace RayTracer

#endif // RAYTRACER_RENDERER_HPP
8 changes: 8 additions & 0 deletions App/plugins/Renderer/src/renderer.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
** EPITECH PROJECT, 2024
** Raytracer | renderer
** File description:
** renderer.cpp
*/

#include "RayTracer/renderer.hpp"
2 changes: 1 addition & 1 deletion Core/src/core.cpp → App/src/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
int RayTracer::Core::runRayTracer(const Scene &scene)
{
(void) scene;
std::cout << "RayTracer is running" << std::endl;
std::cout << "RayTracer is running" << '\n';
return SUCCESS;
}
2 changes: 1 addition & 1 deletion App/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ int main(int argc, const char * argv[])
try {
if (argc != 2) {
throw Parser::ParserException{USAGE_MSG};
} else if (Parser::parseArgs(argv[1]) == ERROR) {
} if (Parser::parseArgs(argv[1]) == ERROR) {
return SUCCESS;
}
Scene scene = Parser::parseFile(argv[1]);
Expand Down
Binary file modified doc/RayTracer.pdf
Binary file not shown.

0 comments on commit 4f5c56f

Please sign in to comment.