Upload all my tests

- Add Count<> to AssetManager
- Initialize pCode in Shader
- Rename linearAllocator to LinearAllocator
- Add Construct and destroy to linear allocator
- Add Shader unloader (fixes atexit crash i guess)
-
This commit is contained in:
2025-11-30 21:57:01 +01:00
parent febf506a5e
commit 078af99ae5
16 changed files with 389 additions and 151 deletions

View File

@@ -40,7 +40,13 @@ void C3D::DeleteScreen(C3D::Screen* screen) { delete screen; }
C3D::Shader::Shader(const std::string& path) { Load(path); }
C3D::Shader::~Shader() {}
C3D::Shader::~Shader() {
if (pCode) {
shaderProgramFree(&pProgram);
DVLB_Free(pCode);
pCode = nullptr;
}
}
void C3D::Shader::Load(const std::string& path) {
auto code = Utils::LoadFile2Mem(path);
@@ -66,7 +72,7 @@ void C3D::Shader::Compile(const std::string& code) {
}
void C3D::Shader::Use() {
C3D_BindProgram(&pProgram);
// C3D_BindProgram(&pProgram);
// for some reason i need both ???
// code works perfectly without C3D_BindProgram
// but nor withour shaderProgramUse ...