Files
Seele/src/Engine/Graphics/View.h
T

31 lines
808 B
C++
Raw Normal View History

#pragma once
2020-03-02 19:07:49 +01:00
#include "RenderPath.h"
namespace Seele
{
2020-04-15 02:03:56 +02:00
DECLARE_REF(Window);
2020-04-12 15:47:19 +02:00
// A view is a part of the window, which can be anything from a viewport to an editor
class View
{
public:
2020-05-05 01:51:13 +02:00
View(Gfx::PGraphics graphics, PWindow window, const ViewportCreateInfo &createInfo);
2020-04-12 15:47:19 +02:00
virtual ~View();
void beginFrame();
2020-04-15 02:03:56 +02:00
void render();
2020-04-12 15:47:19 +02:00
void endFrame();
2020-05-05 01:51:13 +02:00
void applyArea(URect area);
2020-10-29 02:22:01 +01:00
void setFocused();
2020-03-02 19:07:49 +01:00
2020-04-12 15:47:19 +02:00
protected:
Gfx::PGraphics graphics;
2020-04-15 02:03:56 +02:00
Gfx::PViewport viewport;
PWindow owner;
2020-04-12 15:47:19 +02:00
PRenderPath renderer;
2020-10-29 02:22:01 +01:00
virtual void keyCallback(KeyCode code, InputAction action, KeyModifier modifier) = 0;
virtual void mouseMoveCallback(double xPos, double yPos) = 0;
virtual void mouseButtonCallback(MouseButton button, InputAction action, KeyModifier modifier) = 0;
2020-10-29 02:22:01 +01:00
friend class Window;
2020-04-12 15:47:19 +02:00
};
DEFINE_REF(View)
} // namespace Seele