Adding some components.
This commit is contained in:
@ -6,4 +6,5 @@
|
||||
target_sources(${DAWN_TARGET_NAME}
|
||||
PRIVATE
|
||||
Camera.cpp
|
||||
MeshRenderer.cpp
|
||||
)
|
@ -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;
|
||||
}
|
@ -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
|
||||
|
16
src/dawn/component/display/MeshRenderer.cpp
Normal file
16
src/dawn/component/display/MeshRenderer.cpp
Normal 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;
|
||||
}
|
@ -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;
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user