Game Develop C++ Platform: CppLayoutPreviewer.h Source File

| Game Develop C++ Platform Platform for developing native games based on OpenGL and SFML with Game Develop

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Groups Pages
CppLayoutPreviewer.h
Go to the documentation of this file.
1
5 #if defined(GD_IDE_ONLY)
6 #ifndef SCENEEDITORCANVAS_H
7 #define SCENEEDITORCANVAS_H
8 #include <boost/shared_ptr.hpp>
9 #include <SFML/Graphics.hpp>
10 #include "GDCore/PlatformDefinition/LayoutEditorPreviewer.h"
11 #include "GDCore/PlatformDefinition/Project.h"
12 #include "GDCpp/RuntimeScene.h"
13 namespace gd { class InitialInstancesContainer; }
14 namespace gd { class Project; }
15 namespace gd { class Layout; }
16 namespace gd { class InitialInstance; }
17 namespace gd { class LayoutEditorCanvasOptions; }
18 namespace gd { class MainFrameWrapper; }
19 class wxAuiManager;
20 class DebuggerGUI;
21 class ProfileDlg;
22 class RenderDialog;
23 class InstancesRenderer;
24
28 class GD_API CppLayoutPreviewer : public gd::LayoutEditorPreviewer
29 {
30 public:
31 CppLayoutPreviewer(gd::LayoutEditorCanvas & editor);
32 virtual ~CppLayoutPreviewer();
33
37 RuntimeScene & GetRuntimeScene() { return previewScene; }
38
42 gd::Layout & GetLayout();
43
47 gd::Project & GetProject();
48
53 void ExternalWindowClosed();
54
58 boost::shared_ptr<ProfileDlg> GetProfileDialog() const { return profiler; }
59
60 virtual void SetParentAuiManager(wxAuiManager * parentAuiManager_);
61
62 virtual void CreatePreviewRibbonTools(wxRibbonButtonBar & buttonBar);
63 virtual void ConnectPreviewRibbonToolsEvents();
64
65 virtual void OnUpdate();
66
67 virtual bool LaunchPreview();
68 virtual void StopPreview();
69 virtual void PlayPreview();
70 virtual void PausePreview();
71
72 virtual bool IsPaused() { return !playing; }
73
74
75 private:
76
77 virtual void RefreshFromLayout();
78
79 virtual void OnPreviewPlayBtClick( wxCommandEvent & event );
80 virtual void OnPreviewPlayWindowBtClick( wxCommandEvent & event );
81 virtual void OnPreviewPauseBtClick( wxCommandEvent & event );
82 virtual void OnPreviewDebugBtClick( wxCommandEvent & event );
83 virtual void OnPreviewProfilerBtClick( wxCommandEvent & event );
84
85 void RefreshFromLayoutSecondPart();
86
87 //Rendering methods. The rendering during preview is done by previewScene.
88 void RenderCompilationScreen();
89
90 //Members used during preview or compilation
91 gd::Project previewGame;
92 RuntimeScene previewScene;
93 static sf::Texture reloadingIconImage;
94 static sf::Sprite reloadingIconSprite;
95 static sf::Text reloadingText;
96
97 //Editors owned by the previewer
98 boost::shared_ptr<RenderDialog> externalPreviewWindow;
99 boost::shared_ptr<DebuggerGUI> debugger;
100 boost::shared_ptr<ProfileDlg> profiler;
101
102 //Custom ribbons buttons identifiers
103 static const long idRibbonRefresh;
104 static const long idRibbonPlay;
105 static const long idRibbonPlayWin;
106 static const long idRibbonPause;
107 static const long idRibbonResetGlobalVars;
108 static const long idRibbonDebugger;
109 static const long idRibbonProfiler;
110
111 gd::LayoutEditorCanvas & editor;
112 gd::MainFrameWrapper & mainFrameWrapper;
113 wxAuiManager * parentAuiManager;
114
115 //State management
116 bool isReloading;
117 bool playing;
118 };
119
120 #endif // SCENEEDITORCANVAS_H
121 #endif