-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
697 additions
and
537 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,49 @@ | ||
add_library( | ||
renderer | ||
renderer_interface | ||
STATIC | ||
src/renderer.cpp | ||
src/renderer_interface.cpp | ||
) | ||
target_include_directories(renderer PUBLIC | ||
target_include_directories(renderer_interface PUBLIC | ||
${CMAKE_CURRENT_SOURCE_DIR} | ||
${CMAKE_CURRENT_SOURCE_DIR}/include | ||
) | ||
target_link_libraries( | ||
renderer | ||
renderer_interface | ||
PUBLIC | ||
camera | ||
scene | ||
texture_manager | ||
navigation_manager | ||
SDL2 | ||
SDL2_image | ||
SDL2_ttf | ||
) | ||
|
||
add_library( | ||
renderer_2d | ||
STATIC | ||
src/renderer_2d.cpp | ||
) | ||
target_include_directories(renderer_2d PUBLIC | ||
${CMAKE_CURRENT_SOURCE_DIR} | ||
${CMAKE_CURRENT_SOURCE_DIR}/include | ||
) | ||
target_link_libraries( | ||
renderer_2d | ||
PUBLIC | ||
renderer_interface | ||
) | ||
|
||
add_library( | ||
renderer_3d | ||
STATIC | ||
src/renderer_3d.cpp | ||
) | ||
target_include_directories(renderer_3d PUBLIC | ||
${CMAKE_CURRENT_SOURCE_DIR} | ||
${CMAKE_CURRENT_SOURCE_DIR}/include | ||
) | ||
target_link_libraries( | ||
renderer_3d | ||
PUBLIC | ||
renderer_interface | ||
) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/** | ||
* @file renderer_2d.h | ||
* @author Bilal Kahraman ([email protected]) | ||
* @brief | ||
* @version 0.1 | ||
* @date 2024-12-01 | ||
* | ||
* @copyright Copyright (c) 2024 | ||
* | ||
*/ | ||
|
||
#ifndef GRAPHICS_INCLUDE_GRAPHICS_RENDERER_2D_H_ | ||
#define GRAPHICS_INCLUDE_GRAPHICS_RENDERER_2D_H_ | ||
|
||
#include "Graphics/renderer_interface.h" | ||
|
||
namespace wolfenstein { | ||
|
||
class Renderer2D : public IRenderer | ||
{ | ||
public: | ||
using IRenderer::IRenderer; | ||
~Renderer2D() = default; | ||
void RenderScene(const std::shared_ptr<Scene>& scene_ptr) override; | ||
|
||
private: | ||
void RenderMap(const std::shared_ptr<Map> map_ptr); | ||
void RenderPlayer(const std::shared_ptr<Player> player_ptr); | ||
void RenderObjects( | ||
const std::vector<std::shared_ptr<IGameObject>>& objects); | ||
void RenderPaths(const std::vector<std::shared_ptr<Enemy>>& enemies); | ||
void RenderCrosshairs(const std::vector<std::shared_ptr<Enemy>>& enemies); | ||
|
||
void SetDrawColor(SDL_Color color); | ||
void DrawFilledRectangle(vector2i start, vector2i end); | ||
void DrawLine(vector2i start, vector2i end); | ||
|
||
}; // class Renderer2D | ||
|
||
} // namespace wolfenstein | ||
|
||
#endif // GRAPHICS_INCLUDE_GRAPHICS_RENDERER_2D_H_ |
Oops, something went wrong.