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
- Modules
- 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) && !defined(GD_NO_WX_GUI)
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 #include "GDCpp/RuntimeGame.h"
14 namespace gd { class InitialInstancesContainer; }
15 namespace gd { class Project; }
16 namespace gd { class Layout; }
17 namespace gd { class InitialInstance; }
18 namespace gd { class LayoutEditorCanvasOptions; }
19 namespace gd { class MainFrameWrapper; }
20 class wxAuiManager;
21 class DebuggerGUI;
22 class ProfileDlg;
23 class RenderDialog;
24 class InstancesRenderer;
25
29 class GD_API CppLayoutPreviewer : public gd::LayoutEditorPreviewer
30 {
31 public:
32 CppLayoutPreviewer(gd::LayoutEditorCanvas & editor);
33 virtual ~CppLayoutPreviewer();
34
38 RuntimeScene & GetRuntimeScene() { return previewScene; }
39
43 gd::Layout & GetLayout();
44
48 gd::Project & GetProject();
49
54 void ExternalWindowClosed();
55
59 boost::shared_ptr<ProfileDlg> GetProfileDialog() const { return profiler; }
60
61 virtual void SetParentAuiManager(wxAuiManager * parentAuiManager_);
62
63 virtual void CreatePreviewRibbonTools(wxRibbonButtonBar & buttonBar);
64 virtual void ConnectPreviewRibbonToolsEvents();
65
66 virtual void OnUpdate();
67
68 virtual bool LaunchPreview();
69 virtual void StopPreview();
70 virtual void PlayPreview();
71 virtual void PausePreview();
72
73 virtual bool IsPaused() { return !playing; }
74
75
76 private:
77
78 virtual void RefreshFromLayout();
79
80 virtual void OnPreviewPlayBtClick( wxCommandEvent & event );
81 virtual void OnPreviewPlayWindowBtClick( wxCommandEvent & event );
82 virtual void OnPreviewPauseBtClick( wxCommandEvent & event );
83 virtual void OnPreviewDebugBtClick( wxCommandEvent & event );
84 virtual void OnPreviewProfilerBtClick( wxCommandEvent & event );
85
86 void RefreshFromLayoutSecondPart();
87
88 //Rendering methods. The rendering during preview is done by previewScene.
89 void RenderCompilationScreen();
90
91 //Members used during preview or compilation
92 RuntimeGame previewGame;
93 RuntimeScene previewScene;
94 static sf::Texture reloadingIconImage;
95 static sf::Sprite reloadingIconSprite;
96 static sf::Text reloadingText;
97
98 //Editors owned by the previewer
99 boost::shared_ptr<RenderDialog> externalPreviewWindow;
100 boost::shared_ptr<DebuggerGUI> debugger;
101 boost::shared_ptr<ProfileDlg> profiler;
102
103 //Custom ribbons buttons identifiers
104 static const long idRibbonRefresh;
105 static const long idRibbonPlay;
106 static const long idRibbonPlayWin;
107 static const long idRibbonPause;
108 static const long idRibbonResetGlobalVars;
109 static const long idRibbonDebugger;
110 static const long idRibbonProfiler;
111
112 gd::LayoutEditorCanvas & editor;
113 gd::MainFrameWrapper & mainFrameWrapper;
114 wxAuiManager * parentAuiManager;
115
116 //State management
117 bool isReloading;
118 bool playing;
119 };
120
121 #endif // SCENEEDITORCANVAS_H
122 #endif