-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
c02b091
commit 4663a9b
Showing
38 changed files
with
6,331 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
if(TARGET SDL2::ttf) | ||
return() | ||
endif() | ||
|
||
set( | ||
INC_SEARCH_PATH | ||
/usr/include/ | ||
) | ||
|
||
set( | ||
LIB_SEARCH_PATH | ||
/usr/lib/ | ||
) | ||
|
||
find_path( | ||
SDL2_TTF_INCLUDE_PATH | ||
SDL2/SDL_ttf.h | ||
${INC_SEARCH_PATH} | ||
) | ||
|
||
find_library( | ||
SDL2_TTF_LIB | ||
SDL2_ttf | ||
${LIB_SEARCH_PATH} | ||
) | ||
|
||
find_package_handle_standard_args( | ||
SDL2_ttf | ||
DEFAULT_MSG | ||
SDL2_TTF_INCLUDE_PATH | ||
SDL2_TTF_LIB | ||
) | ||
|
||
add_library( | ||
SDL2::tff | ||
UNKNOWN | ||
IMPORTED | ||
) | ||
|
||
set_target_properties( | ||
SDL2::tff | ||
PROPERTIES | ||
IMPORTED_LOCATION "${SDL2_TTF_LIB}" | ||
INTERFACE_INCLUDE_DIRECTORIES "${SDL2_TTF_INCLUDE_PATH}" | ||
) | ||
|
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,25 @@ | ||
# ${CMAKE_SOURCE_DIR}/cameras/CMakeLists.txt | ||
find_package(SDL2 REQUIRED) | ||
|
||
add_executable( | ||
mimicOpenGL | ||
mimicOpenGL.cpp | ||
src/Line.cpp | ||
src/Image.cpp | ||
) | ||
|
||
target_link_libraries( | ||
mimicOpenGL | ||
PRIVATE | ||
SDL2::SDL2 | ||
options::options | ||
) | ||
|
||
target_include_directories( | ||
mimicOpenGL | ||
PRIVATE | ||
${CMAKE_CURRENT_SOURCE_DIR}/include/ | ||
) | ||
|
||
add_subdirectory(test) | ||
|
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,7 @@ | ||
[ ] Geomtery processing. | ||
- Vertex Shading | ||
- Geomtery | ||
[ ] Clipping. | ||
[ ] Rasteriztion. | ||
[ ] Pixel processing. | ||
|
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,20 @@ | ||
#pragma once | ||
// STL | ||
#include <string_view> | ||
// Internal | ||
#include "Type.hpp" | ||
|
||
struct Image { | ||
Image(std::uint32_t width, std::uint32_t height); | ||
|
||
std::uint32_t width; | ||
std::uint32_t height; | ||
vec3_8u *m_pData = nullptr; | ||
|
||
auto operator()(std::uint32_t x, std::uint32_t y) -> vec3_8u& { return m_pData[y * width + x]; } | ||
|
||
auto operator()(std::uint32_t x, std::uint32_t y) const -> const vec3_8u& { return m_pData[y * width + x]; } | ||
|
||
auto saveImage(std::string_view outputFileName) -> bool; | ||
}; | ||
|
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,19 @@ | ||
#pragma once | ||
#include "Type.hpp" | ||
#include "Image.hpp" | ||
|
||
namespace mimicOpenGL { | ||
|
||
void line1(int x0, int y0, int x1, int y1, vec3_8u color, Image &output); | ||
|
||
void line2(int x0, int y0, int x1, int y1, vec3_8u color, Image &output); | ||
|
||
void line2a(int x0, int y0, int x1, int y1, vec3_8u color, Image &output); | ||
|
||
void line3(int x0, int y0, int x1, int y1, vec3_8u color, Image &output); | ||
|
||
void line4(int x0, int y0, int x1, int y1, vec3_8u color, Image &output); | ||
|
||
void line5(int x0, int y0, int x1, int y1, vec3_8u color, Image &output); | ||
|
||
} // namespace mimicOpenGL |
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,9 @@ | ||
#pragma once | ||
// STL | ||
#include <optional> | ||
#include <string_view> | ||
|
||
struct Model {}; | ||
|
||
auto loadPlyFile(std::string_view fileName) -> std::optional<Model>; | ||
|
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,14 @@ | ||
#pragma once | ||
// STL | ||
#include <cstdint> | ||
|
||
template<typename T> | ||
struct vec3 { | ||
union { T x, r, s; }; | ||
union { T y, g, t; }; | ||
union { T z, b, p; }; | ||
}; | ||
|
||
using vec3_f = vec3<float>; | ||
using vec3_8u = vec3<std::uint8_t>; | ||
|
Oops, something went wrong.