tyrav2 init

This commit is contained in:
h4570
2022-07-17 10:21:35 +02:00
parent 44c1ee4fe8
commit c8b22ff331
249 changed files with 18187 additions and 0 deletions
@@ -0,0 +1,44 @@
/*
# ______ ____ ___
# | \/ ____| |___|
# | | | \ | |
#-----------------------------------------------------------------------
# Copyright 2020, tyra - https://github.com/h4570/tyra
# Licenced under Apache License 2.0
# Sandro Sobczyński <sandro.sobczynski@gmail.com>
*/
#pragma once
#include "./mesh_builder_material_data.hpp"
#include "./mesh_builder_frame_data.hpp"
namespace Tyra {
class MeshBuilderData {
public:
MeshBuilderData();
/**
* Frames array and materials array will be deallocated, but
* data (vert,st, ...) inside it not.
* Data ownership is transferred to
* the Mesh class.
*/
~MeshBuilderData();
MeshBuilderFrameData** frames;
u32 framesCount;
MeshBuilderMaterialData** materials;
u32 materialsCount;
bool textureCoordsEnabled, normalsEnabled, manyColorsEnabled;
void allocateFrames(const u32& count);
void allocateMaterials(const u32& count);
void allocate(const u32& framesCount, const u32& materialsCount);
};
} // namespace Tyra
@@ -0,0 +1,39 @@
/*
# ______ ____ ___
# | \/ ____| |___|
# | | | \ | |
#-----------------------------------------------------------------------
# Copyright 2020, tyra - https://github.com/h4570/tyra
# Licenced under Apache License 2.0
# Sandro Sobczyński <sandro.sobczynski@gmail.com>
*/
#pragma once
#include <tamtypes.h>
#include "math/vec4.hpp"
#include "renderer/models/color.hpp"
namespace Tyra {
/**
* Data is not deallocated here.
* Ownership is moved to Mesh class.
*/
class MeshBuilderFrameData {
public:
MeshBuilderFrameData();
~MeshBuilderFrameData();
Vec4 *vertices, *normals, *textureCoords;
Color* colors;
u32 verticesCount, textureCoordsCount, normalsCount, colorsCount;
void allocateTextureCoords(const u32& count);
void allocateVertices(const u32& count);
void allocateNormals(const u32& count);
void allocateColors(const u32& count);
};
} // namespace Tyra
@@ -0,0 +1,35 @@
/*
# ______ ____ ___
# | \/ ____| |___|
# | | | \ | |
#-----------------------------------------------------------------------
# Copyright 2020, tyra - https://github.com/h4570/tyra
# Licenced under Apache License 2.0
# Sandro Sobczyński <sandro.sobczynski@gmail.com>
*/
#pragma once
#include <tamtypes.h>
#include <string>
namespace Tyra {
/**
* Data is not deallocated here.
* Ownership is moved to Mesh class.
*/
class MeshBuilderMaterialData {
public:
MeshBuilderMaterialData();
~MeshBuilderMaterialData();
std::string name;
u32 *vertexFaces, *textureCoordFaces, *normalFaces, *colorFaces;
u32 count;
void allocateFaces(const u32& count);
};
} // namespace Tyra