Shkyera Engine
Easy to use, game engine for Python
SceneWidget.hpp
Go to the documentation of this file.
1
7
#pragma once
8
9
#include "
renderer/Renderer.hpp
"
10
#include "
ui/Widget.hpp
"
11
12
namespace
shkyera
{
13
20
class
SceneWidget
:
public
Widget
{
21
public
:
22
using
Widget::Widget
;
23
27
virtual
void
draw
()
override
;
28
32
void
adjustSize
();
33
39
void
setRenderer
(std::shared_ptr<Renderer> renderer);
40
41
private
:
45
void
drawRuntime
()
const
;
46
50
void
drawScene
();
51
55
void
readInput
()
const
;
56
57
std::shared_ptr<Renderer>
_renderer
;
58
ImVec2
_renderSize
;
59
};
60
61
}
// namespace shkyera
Renderer.hpp
Widget.hpp
Contains the declaration of the Widget class, an abstract base class for GUI widgets.
shkyera::SceneWidget
A user interface widget for rendering scenes.
Definition:
SceneWidget.hpp:20
shkyera::SceneWidget::draw
virtual void draw() override
Implementation of the abstract draw method to render the scene widget.
Definition:
SceneWidget.cpp:19
shkyera::SceneWidget::readInput
void readInput() const
Read the user input from the keyboard and notify the Python intepreter of it.
Definition:
SceneWidget.cpp:72
shkyera::SceneWidget::drawRuntime
void drawRuntime() const
Draw the runtime rendered scene.
Definition:
SceneWidget.cpp:41
shkyera::SceneWidget::_renderer
std::shared_ptr< Renderer > _renderer
A shared pointer to the renderer used for scene rendering.
Definition:
SceneWidget.hpp:57
shkyera::SceneWidget::adjustSize
void adjustSize()
Adjust the size of the scene widget.
Definition:
SceneWidget.cpp:33
shkyera::SceneWidget::_renderSize
ImVec2 _renderSize
The size of the rendered scene area.
Definition:
SceneWidget.hpp:58
shkyera::SceneWidget::drawScene
void drawScene()
Draw the empty scene when it is not running.
Definition:
SceneWidget.cpp:59
shkyera::SceneWidget::setRenderer
void setRenderer(std::shared_ptr< Renderer > renderer)
Set the renderer to use for rendering the scene.
Definition:
SceneWidget.cpp:14
shkyera::Widget
An abstract base class representing a GUI widget.
Definition:
Widget.hpp:21
shkyera::Widget::Widget
Widget(std::string name)
Constructor to create a widget with a specified name.
Definition:
Widget.cpp:5
shkyera
Definition:
Entity.cpp:3
src
ui
widgets
SceneWidget.hpp
Generated by
1.9.1
Franciszek Szewczyk © 2023