Game Develop C++ Platform: CppPlatform.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
CppPlatform.h
Go to the documentation of this file.
1
6 #ifndef PLATFORM_H
7 #define PLATFORM_H
8 #include "GDCore/PlatformDefinition/Platform.h"
9 #include "GDCore/PlatformDefinition/PlatformExtension.h"
10 #include "GDCpp/CommonTools.h"
11 #include "GDCpp/IDE/ChangesNotifier.h"
12 #if defined(GD_IDE_ONLY)
13 #include <wx/intl.h>
14 #endif
15 namespace gd { class Automatism; }
16 namespace gd { class Object; }
17 class RuntimeObject;
18 class RuntimeScene;
19
20 typedef void (*DestroyRuntimeObjectFunPtr)(RuntimeObject*);
21 typedef RuntimeObject * (*CreateRuntimeObjectFunPtr)(RuntimeScene & scene, const gd::Object & object);
22
29 class GD_API CppPlatform : public gd::Platform
30 {
31 public:
32
33 virtual std::string GetName() const { return "Game Develop C++ platform"; }
34 #if defined(GD_IDE_ONLY)
35 virtual std::string GetFullName() const { return ToString(_("Native platform")); }
36 virtual std::string GetSubtitle() const { return ToString(_("C++ and OpenGL based games for Windows or Linux.")); }
37 virtual std::string GetDescription() const;
38 #endif
39
46 boost::shared_ptr<RuntimeObject> CreateRuntimeObject(RuntimeScene & scene, gd::Object & object);
47
52 bool AddExtension(boost::shared_ptr<gd::PlatformExtension> platformExtension);
53
56 virtual std::string GetExtensionCreateFunctionName() { return "CreateGDExtension"; }
57
60 virtual std::string GetExtensionDestroyFunctionName() { return "DestroyGDExtension"; }
61
62 #if defined(GD_IDE_ONLY)
63 virtual std::string GetIcon() const { return "CppPlatform/icon32.png"; }
64
68 virtual ChangesNotifier & GetChangesNotifier() const { return changesNotifier; };
69
73 virtual boost::shared_ptr<gd::LayoutEditorPreviewer> GetLayoutPreviewer(gd::LayoutEditorCanvas & editor) const;
74
78 virtual boost::shared_ptr<gd::ProjectExporter> GetProjectExporter() const;
79
83 virtual void OnIDEClosed();
84 #endif
85
89 static CppPlatform & Get();
90
96 static void DestroySingleton();
97
98 private:
99 CppPlatform();
100 virtual ~CppPlatform() {};
101
102 std::map < std::string, CreateRuntimeObjectFunPtr > runtimeObjCreationFunctionTable;
103 std::map < std::string, DestroyRuntimeObjectFunPtr > runtimeObjDestroyFunctionTable;
104 #if defined(GD_IDE_ONLY)
105 static ChangesNotifier changesNotifier;
106 wxBitmap icon32;
107 #endif
108
109 static CppPlatform * singleton;
110 };
111
112 #endif // PLATFORM_H