Handle keyboard in QML

This commit is contained in:
2020-06-23 16:29:36 -06:00
parent af761ca337
commit 82ff240cfd
5 changed files with 80 additions and 33 deletions

View File

@@ -45,6 +45,7 @@ public:
m_count(count) {}
void draw(const Matrix4 &transformation, SceneGraph::Camera3D &camera);
void count(int count);
void hue(float hue);
void t(float t);
@@ -62,6 +63,9 @@ public:
MagnumRenderer();
~MagnumRenderer();
/**
* @brief Called when Qt needs to resize/re-create FBO.
*/
void reset(Platform::GLContext *ctx,
GL::Framebuffer fbo,
Vector2i windowSize,
@@ -72,16 +76,25 @@ public:
void t(float t);
void hue(float hue);
void count(int count);
Containers::Optional<ArcBallCamera> camera();
Containers::Optional<ArcBallCamera>& camera();
void lagging(float lagging);
float lagging();
private:
/**
* @brief We need to delay initialization until we have valid OpenGL context.
*/
void lazyInitialize();
/**
* @brief Reset OpenGL state to our desired state.
*/
void prepGLState();
bool m_init;
int m_count;
Platform::GLContext *m_ctx;
Platform::GLContext *m_ctx{nullptr};
GL::Framebuffer m_FBO{NoCreate};
Scene3D m_scene;