]> git.cworth.org Git - vogl/blob - src/vogleditor/vogleditor_qframebufferexplorer.h
UI: Improved support for shared contexts and viewing shared state objects
[vogl] / src / vogleditor / vogleditor_qframebufferexplorer.h
1 #ifndef VOGLEDITOR_QFRAMEBUFFEREXPLORER_H
2 #define VOGLEDITOR_QFRAMEBUFFEREXPLORER_H
3
4 #include <QWidget>
5 #include <QVBoxLayout>
6
7 #include "vogl_core.h"
8
9 class QTextureViewer;
10 class vogleditor_QTextureExplorer;
11 class vogl_context_snapshot;
12 class vogl_default_framebuffer_state;
13 class vogl_gl_object_state;
14 class vogl_renderbuffer_state;
15 class vogl_texture_state;
16 typedef vogl::vector<vogl_gl_object_state *> vogl_gl_object_state_ptr_vec;
17
18 class vogl_framebuffer_state;
19
20 namespace Ui {
21 class vogleditor_QFramebufferExplorer;
22 }
23
24 class vogleditor_QFramebufferExplorer : public QWidget
25 {
26     Q_OBJECT
27
28 public:
29     explicit vogleditor_QFramebufferExplorer(QWidget *parent = 0);
30     ~vogleditor_QFramebufferExplorer();
31
32     uint set_framebuffer_objects(vogl_context_snapshot* pContext, vogl::vector<vogl_context_snapshot*> sharingContexts, vogl_default_framebuffer_state *pDefaultFramebufferState);
33
34     bool set_active_framebuffer(unsigned long long framebufferHandle);
35
36     void clear();
37
38 private:
39     Ui::vogleditor_QFramebufferExplorer *ui;
40     vogl_gl_object_state_ptr_vec m_objects;
41     vogl::vector<vogleditor_QTextureExplorer*> m_viewers;
42     QVBoxLayout* m_colorExplorerLayout;
43     QVBoxLayout* m_depthExplorerLayout;
44     QVBoxLayout* m_stencilExplorerLayout;
45     vogleditor_QTextureExplorer* m_depthExplorer;
46     vogleditor_QTextureExplorer* m_stencilExplorer;
47     vogl::vector<vogl_context_snapshot*> m_sharing_contexts;
48     vogl_default_framebuffer_state* m_pDefaultFramebufferState;
49
50     void clearViewers();
51
52     uint set_default_framebuffer(vogl_default_framebuffer_state* pDefaultFramebufferState);
53     uint add_framebuffer_objects(vogl::vector<vogl_context_snapshot*> sharingContexts, vogl_gl_object_state_ptr_vec objects);
54
55     vogl_texture_state* get_texture_attachment(vogl_context_snapshot& context, unsigned int handle);
56     vogl_renderbuffer_state* get_renderbuffer_attachment(vogl_context_snapshot &context, unsigned int handle);
57
58 private slots:
59     void selectedFramebufferIndexChanged(int index);
60     void slot_zoomFactorChanged(double zoomFactor);
61 };
62
63 #endif // VOGLEDITOR_QFRAMEBUFFEREXPLORER_H