-
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.
Added Models::Static and its decoding
- Loading branch information
1 parent
8f40940
commit 2293033
Showing
19 changed files
with
485 additions
and
247 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
{ | ||
"version": 3, | ||
"cmakeMinimumRequired": { | ||
"major": 3, | ||
"minor": 11, | ||
"patch": 0 | ||
}, | ||
"configurePresets": [ | ||
{ | ||
"name": "gcc-ninja-release", | ||
"description": "Build with GCC and Ninja", | ||
"generator": "Ninja", | ||
"binaryDir": "${sourceDir}/build/gcc-ninja-release", | ||
"cacheVariables": { | ||
"CMAKE_BUILD_TYPE": "Release" | ||
}, | ||
"environment": { | ||
"CC": "gcc", | ||
"CXX": "g++" | ||
} | ||
}, | ||
{ | ||
"name": "clang-ninja-release", | ||
"description": "Build with Clang and Ninja", | ||
"generator": "Ninja", | ||
"binaryDir": "${sourceDir}/build/clang-ninja-release", | ||
"cacheVariables": { | ||
"CMAKE_BUILD_TYPE": "Release" | ||
}, | ||
"environment": { | ||
"CC": "clang", | ||
"CXX": "clang++" | ||
} | ||
}, | ||
{ | ||
"name": "emscripten-ninja-release", | ||
"description": "Build with Emscripten SDK", | ||
"generator": "Ninja", | ||
"binaryDir": "${sourceDir}/build/emscripten-ninja-release", | ||
"cacheVariables": { | ||
"CMAKE_BUILD_TYPE": "Release" | ||
}, | ||
"environment": { | ||
"CC": "emcc", | ||
"CXX": "em++" | ||
} | ||
}, | ||
{ | ||
"name": "emscripten-ninja-debug", | ||
"description": "Build with Emscripten SDK", | ||
"generator": "Ninja", | ||
"binaryDir": "${sourceDir}/build/emscripten-ninja-debug", | ||
"cacheVariables": { | ||
"CMAKE_BUILD_TYPE": "Debug" | ||
}, | ||
"environment": { | ||
"CC": "emcc", | ||
"CXX": "em++" | ||
} | ||
} | ||
], | ||
"buildPresets": [ | ||
{ | ||
"name": "gcc-ninja-release", | ||
"configurePreset": "gcc-ninja-release" | ||
}, | ||
{ | ||
"name": "clang-ninja-release", | ||
"configurePreset": "clang-ninja" | ||
}, | ||
{ | ||
"name": "emscripten-ninja-release", | ||
"configurePreset": "emscripten-ninja" | ||
}, | ||
{ | ||
"name": "emscripten-ninja-debug", | ||
"configurePreset": "emscripten-ninja" | ||
} | ||
] | ||
} |
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 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,90 @@ | ||
#pragma once | ||
|
||
#include <string> | ||
|
||
#include <sstream> | ||
|
||
#include "Config.hpp" | ||
|
||
class AppAnalytics | ||
{ | ||
public: | ||
std::string gpu_info; | ||
|
||
auto get_gpu_info() { | ||
std::ostringstream info_stream; | ||
|
||
// Basic GPU Information | ||
const GLubyte* vendor = glGetString(GL_VENDOR); | ||
const GLubyte* renderer = glGetString(GL_RENDERER); | ||
const GLubyte* version = glGetString(GL_VERSION); | ||
info_stream << "Vendor: " << vendor << "\n" | ||
<< "Renderer: " << renderer << "\n" | ||
<< "OpenGL Version: " << version << "\n"; | ||
|
||
// Additional GPU Capabilities | ||
GLint value; | ||
|
||
// Max Texture Size | ||
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &value); | ||
info_stream << "Max Texture Size: " << value << "\n"; | ||
|
||
// Max Number of Texture Image Units | ||
glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &value); | ||
info_stream << "Max Texture Image Units: " << value << "\n"; | ||
|
||
// Max Cube Map Texture Size | ||
glGetIntegerv(GL_MAX_CUBE_MAP_TEXTURE_SIZE, &value); | ||
info_stream << "Max Cube Map Texture Size: " << value << "\n"; | ||
|
||
// Max Renderbuffer Size | ||
glGetIntegerv(GL_MAX_RENDERBUFFER_SIZE, &value); | ||
info_stream << "Max Renderbuffer Size: " << value << "\n"; | ||
|
||
// Max Viewport Dimensions | ||
GLint maxViewportDims[2]; | ||
glGetIntegerv(GL_MAX_VIEWPORT_DIMS, maxViewportDims); | ||
info_stream << "Max Viewport Dimensions: " << maxViewportDims[0] << " x " << maxViewportDims[1] << "\n"; | ||
|
||
// Max Anisotropy | ||
GLfloat maxAniso = 0.0f; | ||
glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &maxAniso); | ||
info_stream << "Max Texture Anisotropy: " << maxAniso << "\n"; | ||
|
||
// Max Samples in Multisample | ||
glGetIntegerv(GL_MAX_SAMPLES, &value); | ||
info_stream << "Max Samples in Multisample: " << value << "\n"; | ||
|
||
// Max Color Attachments | ||
glGetIntegerv(GL_MAX_COLOR_ATTACHMENTS, &value); | ||
info_stream << "Max Color Attachments: " << value << "\n"; | ||
|
||
// Max Draw Buffers | ||
glGetIntegerv(GL_MAX_DRAW_BUFFERS, &value); | ||
info_stream << "Max Draw Buffers: " << value << "\n"; | ||
|
||
glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &value); | ||
info_stream << "Max Vertex Attributes: " << value << "\n"; | ||
|
||
glGetIntegerv(GL_MAX_VERTEX_UNIFORM_COMPONENTS, &value); | ||
info_stream << "Max Vertex Uniform Components: " << value << "\n"; | ||
|
||
glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS, &value); | ||
info_stream << "Max Fragment Uniform Components: " << value << "\n"; | ||
|
||
glGetIntegerv(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, &value); | ||
info_stream << "Max Vertex Texture Image Units: " << value << "\n"; | ||
|
||
glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &value); | ||
info_stream << "Max Combined Texture Image Units: " << value << "\n"; | ||
|
||
// Fragment Processing | ||
glGetIntegerv(GL_MAX_FRAGMENT_INPUT_COMPONENTS, &value); | ||
info_stream << "Max Fragment Input Components: " << value << "\n"; | ||
|
||
glGetIntegerv(GL_MAX_TEXTURE_LOD_BIAS, &value); | ||
info_stream << "Max Texture LOD Bias: " << value << "\n"; | ||
|
||
gpu_info = info_stream.str(); | ||
} | ||
}; |
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 @@ | ||
#pragma once |
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 @@ | ||
#pragma once |
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,4 +1,6 @@ | ||
#pragma once | ||
|
||
#include "Models/Staging.hpp" | ||
#include "Models/Types.hpp" | ||
#include "Models/Static.hpp" | ||
#include "Models/Animated.hpp" | ||
#include "Models/Dynamic.hpp" |
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 |
---|---|---|
@@ -1,25 +1,19 @@ | ||
#pragma once | ||
|
||
#include <string> | ||
#include <vector> | ||
#include <array> | ||
#include "Models/Types.hpp" | ||
#include "Utily/Utily.hpp" | ||
|
||
#include <glm/vec3.hpp> | ||
#include <glm/vec2.hpp> | ||
namespace Models { | ||
|
||
namespace Models::Static { | ||
struct Vertex { | ||
glm::vec3 position; | ||
glm::vec3 normal; | ||
glm::vec2 uv_coord; | ||
struct Static { | ||
std::array<Vec3, 2> axis_align_bounding_box; | ||
std::unique_ptr<std::byte[]> data; | ||
std::span<Vertex> vertices; | ||
std::span<uint32_t> indices; | ||
}; | ||
|
||
static_assert(sizeof(Models::Static::Vertex) == sizeof(std::array<float,8>)); | ||
|
||
struct Model { | ||
std::string name; | ||
std::vector<Vertex> vertex_data; | ||
std::vector<uint32_t> index_data; | ||
}; | ||
|
||
} // namespace Models::Static | ||
auto decode_as_static_model( | ||
std::span<std::byte> file_data, | ||
Utily::StaticVector<char, 16> file_extension) | ||
-> Utily::Result<Static, Utily::Error>; | ||
} |
Oops, something went wrong.