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
- Modules
- 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 "GDCore/Tools/Localization.h"
11 #include "GDCpp/CommonTools.h"
12 #include "GDCpp/IDE/ChangesNotifier.h"
13 namespace gd { class Automatism; }
14 namespace gd { class Object; }
15 class RuntimeObject;
16 class RuntimeScene;
17
18 typedef void (*DestroyRuntimeObjectFunPtr)(RuntimeObject*);
19 typedef RuntimeObject * (*CreateRuntimeObjectFunPtr)(RuntimeScene & scene, const gd::Object & object);
20
27 class GD_API CppPlatform : public gd::Platform
28 {
29 public:
30
31 virtual std::string GetName() const { return "Game Develop C++ platform"; }
32 #if defined(GD_IDE_ONLY)
33 virtual std::string GetFullName() const { return ToString(_("Native platform")); }
34 virtual std::string GetSubtitle() const { return ToString(_("C++ and OpenGL based games for Windows or Linux.")); }
35 virtual std::string GetDescription() const;
36 #endif
37
44 boost::shared_ptr<RuntimeObject> CreateRuntimeObject(RuntimeScene & scene, gd::Object & object);
45
50 bool AddExtension(boost::shared_ptr<gd::PlatformExtension> platformExtension);
51
54 virtual std::string GetExtensionCreateFunctionName() { return "CreateGDExtension"; }
55
58 virtual std::string GetExtensionDestroyFunctionName() { return "DestroyGDExtension"; }
59
60 #if defined(GD_IDE_ONLY)
61 virtual std::string GetIcon() const { return "CppPlatform/icon32.png"; }
62
66 virtual ChangesNotifier & GetChangesNotifier() const { return changesNotifier; };
67
68 #if !defined(GD_NO_WX_GUI)
69
72 virtual boost::shared_ptr<gd::LayoutEditorPreviewer> GetLayoutPreviewer(gd::LayoutEditorCanvas & editor) const;
73 #endif
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 CppPlatform();
99 virtual ~CppPlatform() {};
100 private:
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 #if !defined(GD_NO_WX_GUI)
107 wxBitmap icon32;
108 #endif
109 #endif
110
111 static CppPlatform * singleton;
112 };
113
114 #endif // PLATFORM_H