adding editor
This commit is contained in:
28
editor/include/view_layer.hpp
Normal file
28
editor/include/view_layer.hpp
Normal file
@@ -0,0 +1,28 @@
|
||||
#ifndef VIEW_LAYER_HPP
|
||||
#define VIEW_LAYER_HPP
|
||||
|
||||
#include <open_engine.hpp>
|
||||
|
||||
class ViewLayer : public OpenEngine::Layer
|
||||
{
|
||||
public:
|
||||
ViewLayer(const char* layer_name, float ratio, float zoom_level)
|
||||
: OpenEngine::Layer(layer_name),
|
||||
camera(ratio, zoom_level)
|
||||
{
|
||||
}
|
||||
|
||||
OpenEngine::Ref<OpenEngine::FrameBuffer>& GetFramebuffer() { return framebuffer; };
|
||||
OpenEngine::OrthographicCameraController& GetCamera() { return camera; };
|
||||
|
||||
void SetCursorPos(const glm::vec2& pos) { cursor_position = pos; };
|
||||
const glm::vec2& GetCursorPos() { return cursor_position; };
|
||||
|
||||
private:
|
||||
OpenEngine::Ref<OpenEngine::FrameBuffer> framebuffer;
|
||||
OpenEngine::OrthographicCameraController camera;
|
||||
|
||||
glm::vec2 cursor_position = { 0.0f, 0.0f };
|
||||
};
|
||||
|
||||
#endif // VIEW_LAYER_HPP
|
||||
Reference in New Issue
Block a user