Testing textures and events

This commit is contained in:
2022-10-20 15:49:25 -07:00
parent 375b25ff59
commit 80d6cba854
27 changed files with 513 additions and 26 deletions

View File

@ -14,9 +14,13 @@ namespace Dawn {
};
class Camera : public SceneItemComponent {
protected:
std::shared_ptr<RenderTarget> target = nullptr;
void onRenderTargetResize(RenderTarget &target, float_t w, float_t h);
public:
glm::mat4 projection;
std::shared_ptr<RenderTarget> target = nullptr;
// Perspective
enum CameraType type = CAMERA_TYPE_PERSPECTIVE;
@ -55,6 +59,13 @@ namespace Dawn {
*/
RenderTarget & getRenderTarget();
/**
* Updates the render target for the camera to use.
*
* @param renderTarget Render target for this camera to draw to.
*/
void setRenderTarget(std::shared_ptr<RenderTarget> renderTarget);
/**
* Returs the aspect ratio of the camera.
*
@ -66,5 +77,10 @@ namespace Dawn {
* Event triggered by the scene item when the item is added to the scene.
*/
void start() override;
/**
* Disposes a previously initialized camera.
*/
~Camera();
};
}