Skip to content

Commit

Permalink
Merge pull request #5 from vsg-dev/VsgNativeWindow
Browse files Browse the repository at this point in the history
Replaced vsgQt::ProxyWindow & vsgQt::ProxySurface with vsg::WindowAdapter and vsg::Surface.
  • Loading branch information
robertosfield authored Sep 23, 2021
2 parents 888545a + 751c05e commit 5157b5e
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 251 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(QT_PACKAGE_NAME Qt5 CACHE STRING "Set Qt package name, i.e. Qt5 or Qt6.")
set(QT_PACKAGE_VERSION 5.10 CACHE STRING "Set minimum Qt package version.")

find_package(vsg 0.1.6 REQUIRED)
find_package(vsg 0.1.7 REQUIRED)
find_package(vsgXchange) # only used by exanples
find_package(${QT_PACKAGE_NAME} ${QT_PACKAGE_VERSION} COMPONENTS Widgets REQUIRED)

Expand Down
2 changes: 1 addition & 1 deletion examples/vsgqtviewer/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ int main(int argc, char* argv[])
// provide the calls to set up the vsg::Viewer that will be used to render to the QWindow subclass vsgQt::ViewerWindow
viewerWindow->initializeCallback = [&](vsgQt::ViewerWindow& vw) {

auto& window = vw.proxyWindow;
auto& window = vw.windowAdapter;
if (!window) return false;

auto& viewer = vw.viewer;
Expand Down
30 changes: 0 additions & 30 deletions include/vsgQt/ProxySurface.h

This file was deleted.

54 changes: 0 additions & 54 deletions include/vsgQt/ProxyWindow.h

This file was deleted.

10 changes: 6 additions & 4 deletions include/vsgQt/ViewerWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
#include <QVulkanInstance>
#include <QWindow>

#include <vsg/viewer/WindowAdapter.h>
#include <vsg/viewer/WindowAdapter.h>

#include <vsgQt/KeyboardMap.h>
#include <vsgQt/ProxySurface.h>
#include <vsgQt/ProxyWindow.h>

namespace vsgQt
{
Expand All @@ -33,8 +34,7 @@ namespace vsgQt
vsg::ref_ptr<vsg::Instance> instance;
vsg::ref_ptr<vsg::Viewer> viewer;

vsg::ref_ptr<ProxySurface> proxySurface;
vsg::ref_ptr<ProxyWindow> proxyWindow;
vsg::ref_ptr<vsg::WindowAdapter> windowAdapter;
vsg::ref_ptr<KeyboardMap> keyboardMap;

using InitialCallback = std::function<void(ViewerWindow&)>;
Expand All @@ -50,6 +50,8 @@ namespace vsgQt
bool event(QEvent* e) override;

void exposeEvent(QExposeEvent*) override;
void hideEvent(QHideEvent *ev) override;

void keyPressEvent(QKeyEvent*) override;
void keyReleaseEvent(QKeyEvent*) override;
void mouseMoveEvent(QMouseEvent*) override;
Expand Down
4 changes: 0 additions & 4 deletions src/vsgQt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,11 @@ endmacro()

set(SOURCES
KeyboardMap.cpp
ProxySurface.cpp
ProxyWindow.cpp
ViewerWindow.cpp
)

set(HEADERS
../../include/vsgQt/KeyboardMap.h
../../include/vsgQt/ProxySurface.h
../../include/vsgQt/ProxyWindow.h
../../include/vsgQt/ViewerWindow.h
)

Expand Down
31 changes: 0 additions & 31 deletions src/vsgQt/ProxySurface.cpp

This file was deleted.

91 changes: 0 additions & 91 deletions src/vsgQt/ProxyWindow.cpp

This file was deleted.

Loading

0 comments on commit 5157b5e

Please sign in to comment.