summaryrefslogtreecommitdiffstats
path: root/examples/vulkan/hellovulkancubes/vulkanwindow.h
blob: e28b62d1174bca67e683b48701cc2a0fed136d8b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause

#ifndef VULKANWINDOW_H
#define VULKANWINDOW_H

#include <QVulkanWindow>

class Renderer;

class VulkanWindow : public QVulkanWindow
{
public:
    VulkanWindow(bool dbg);

    QVulkanWindowRenderer *createRenderer() override;

    bool isDebugEnabled() const { return m_debug; }
    int instanceCount() const;

public slots:
    void addNew();
    void togglePaused();
    void meshSwitched(bool enable);

private:
    void mousePressEvent(QMouseEvent *) override;
    void mouseReleaseEvent(QMouseEvent *) override;
    void mouseMoveEvent(QMouseEvent *) override;
    void keyPressEvent(QKeyEvent *) override;

    bool m_debug;
    Renderer *m_renderer;
    bool m_pressed = false;
    QPoint m_lastPos;
};

#endif