mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-24 04:58:59 -05:00
More callbacks implemented
This commit is contained in:
@@ -25,6 +25,8 @@
|
||||
#include <openspace/engine/gui.h>
|
||||
|
||||
#include <ghoul/opengl/ghoul_gl.h>
|
||||
#include <ghoul/io/texture/texturereader.h>
|
||||
#include <ghoul/opengl/texture.h>
|
||||
|
||||
#include <imgui.h>
|
||||
#include <sgct.h>
|
||||
@@ -47,6 +49,8 @@ namespace {
|
||||
size_t vbo_max_size = 20000;
|
||||
GLuint vao_handle;
|
||||
|
||||
ghoul::opengl::Texture* _texture;
|
||||
|
||||
|
||||
|
||||
static void ImImpl_RenderDrawLists(ImDrawList** const cmd_lists, int cmd_lists_count) {
|
||||
@@ -272,6 +276,15 @@ bool GUI::mouseButtonCallback(int key, int action) {
|
||||
return consumeEvent;
|
||||
}
|
||||
|
||||
bool GUI::mouseWheelCallback(int position) {
|
||||
ImGuiIO& io = ImGui::GetIO();
|
||||
bool consumeEvent = io.WantCaptureMouse;
|
||||
if (consumeEvent)
|
||||
io.MouseWheel = static_cast<float>(position);
|
||||
|
||||
return consumeEvent;
|
||||
}
|
||||
|
||||
bool GUI::keyCallback(int key, int action) {
|
||||
ImGuiIO& io = ImGui::GetIO();
|
||||
bool consumeEvent = io.WantCaptureKeyboard;
|
||||
|
||||
@@ -569,19 +569,21 @@ void OpenSpaceEngine::mousePositionCallback(int x, int y) {
|
||||
}
|
||||
|
||||
void OpenSpaceEngine::mouseScrollWheelCallback(int pos) {
|
||||
bool isConsumed = _gui->mouseWheelCallback(pos);
|
||||
if (isConsumed)
|
||||
return;
|
||||
|
||||
_interactionHandler.mouseScrollWheelCallback(pos);
|
||||
}
|
||||
|
||||
void OpenSpaceEngine::encode()
|
||||
{
|
||||
void OpenSpaceEngine::encode() {
|
||||
if (_syncBuffer) {
|
||||
_renderEngine.serialize(_syncBuffer);
|
||||
_syncBuffer->write();
|
||||
}
|
||||
}
|
||||
|
||||
void OpenSpaceEngine::decode()
|
||||
{
|
||||
void OpenSpaceEngine::decode() {
|
||||
if (_syncBuffer) {
|
||||
_syncBuffer->read();
|
||||
_renderEngine.deserialize(_syncBuffer);
|
||||
|
||||
Reference in New Issue
Block a user