51 lines
1.2 KiB
C++
Executable File
51 lines
1.2 KiB
C++
Executable File
#pragma once
|
|
#include "Deer/Components.h"
|
|
|
|
#include "DeerRender/Mesh.h"
|
|
#include "DeerRender/Shader.h"
|
|
#include "DeerRender/Texture.h"
|
|
|
|
#define GLM_ENABLE_EXPERIMENTAL
|
|
#include "glm/glm.hpp"
|
|
#include "glm/gtc/matrix_transform.hpp"
|
|
#include "glm/gtc/quaternion.hpp"
|
|
#define MAX_TEXTURE_BINDINGS 4
|
|
|
|
namespace Deer {
|
|
struct MeshComponent {
|
|
MeshComponent() = default;
|
|
MeshComponent(Resource<GPUMesh> _mesh) : mesh(_mesh) {}
|
|
MeshComponent(const MeshComponent&) = default;
|
|
|
|
Resource<GPUMesh> mesh;
|
|
bool active = true;
|
|
};
|
|
|
|
struct ShaderComponent {
|
|
ShaderComponent() = default;
|
|
ShaderComponent(Resource<Shader> _shader) : shader(_shader) {}
|
|
ShaderComponent(const ShaderComponent&) = default;
|
|
|
|
Resource<Shader> shader;
|
|
Resource<Texture> texture;
|
|
};
|
|
|
|
struct CameraComponent {
|
|
CameraComponent() = default;
|
|
CameraComponent(const CameraComponent&) = default;
|
|
|
|
float fov = glm::radians(50.0f);
|
|
float aspect = 16 / 9;
|
|
float nearZ = 0.1f;
|
|
float farZ = 1000;
|
|
|
|
inline glm::mat4 getMatrix() const { return glm::perspective(fov, aspect, nearZ, farZ); }
|
|
};
|
|
|
|
struct TextureComponent {
|
|
TextureComponent() = default;
|
|
TextureComponent(const TextureComponent&) = default;
|
|
|
|
Resource<Texture> texture;
|
|
};
|
|
} // namespace Deer
|