Adding some components.

This commit is contained in:
2023-11-15 22:14:53 -06:00
parent 21fccefcba
commit 99e8c4b5d8
18 changed files with 428 additions and 12 deletions

View File

@ -6,4 +6,5 @@
target_sources(${DAWN_TARGET_NAME}
PRIVATE
Camera.cpp
MeshRenderer.cpp
)

View File

@ -3,6 +3,7 @@
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
#include "assert/assert.hpp"
#include "Camera.hpp"
using namespace Dawn;
@ -11,6 +12,11 @@ void Camera::onInit() {
std::cout << "Camera" << std::endl;
}
void Camera::onDispose() {
std::cout << "~Camera" << std::endl;
// renderTarget = nullptr;
}
glm::mat4 Camera::getProjection() {
switch(this->type) {
case CameraType::ORTHOGONAL:
@ -34,4 +40,8 @@ glm::mat4 Camera::getProjection() {
assertUnreachable("Invalid Camera Type!");
return glm::mat4(1.0f);
}
float_t Camera::getAspect() {
return 1.0f;
}

View File

@ -28,6 +28,7 @@ namespace Dawn {
// std::shared_ptr<RenderTarget> renderTarget;
void onInit() override;
void onDispose() override;
/**
* Returns the aspect ratio that the camera is using. In future I may

View File

@ -0,0 +1,16 @@
// Copyright (c) 2023 Dominic Masters
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
#include "MeshRenderer.hpp"
using namespace Dawn;
void MeshRenderer::onInit() {
}
void MeshRenderer::onDispose() {
mesh = nullptr;
}

View File

@ -4,6 +4,7 @@
// https://opensource.org/licenses/MIT
#pragma once
#include "display/mesh/Mesh.hpp"
#include "scene/SceneItem.hpp"
namespace Dawn {
@ -12,5 +13,6 @@ namespace Dawn {
std::shared_ptr<Mesh> mesh;
void onInit() override;
void onDispose() override;
};
}