|
@@ -28,6 +28,7 @@
|
|
|
#include <Rocket/Core.h>
|
|
#include <Rocket/Core.h>
|
|
|
#include <Rocket/Core/Input.h>
|
|
#include <Rocket/Core/Input.h>
|
|
|
#include <Rocket/Debugger/Debugger.h>
|
|
#include <Rocket/Debugger/Debugger.h>
|
|
|
|
|
+#include <Shell.h>
|
|
|
#include <ShellFileInterface.h>
|
|
#include <ShellFileInterface.h>
|
|
|
|
|
|
|
|
#include "SystemInterfaceSDL2.h"
|
|
#include "SystemInterfaceSDL2.h"
|
|
@@ -39,16 +40,6 @@
|
|
|
|
|
|
|
|
int main(int argc, char **argv)
|
|
int main(int argc, char **argv)
|
|
|
{
|
|
{
|
|
|
-#ifdef ROCKET_PLATFORM_LINUX
|
|
|
|
|
-#define APP_PATH "../Samples/basic/sdl2/"
|
|
|
|
|
-#else
|
|
|
|
|
-#ifdef ROCKET_PLATFORM_MACOSX
|
|
|
|
|
-#define APP_PATH "../../../../../Samples/basic/sdl2/"
|
|
|
|
|
-#else
|
|
|
|
|
-#define APP_PATH "../../Samples/basic/sdl2/"
|
|
|
|
|
-#endif
|
|
|
|
|
-#endif
|
|
|
|
|
-
|
|
|
|
|
#ifdef ROCKET_PLATFORM_WIN32
|
|
#ifdef ROCKET_PLATFORM_WIN32
|
|
|
DoAllocConsole();
|
|
DoAllocConsole();
|
|
|
#endif
|
|
#endif
|
|
@@ -86,7 +77,9 @@ int main(int argc, char **argv)
|
|
|
|
|
|
|
|
RocketSDL2Renderer Renderer(renderer, screen);
|
|
RocketSDL2Renderer Renderer(renderer, screen);
|
|
|
RocketSDL2SystemInterface SystemInterface;
|
|
RocketSDL2SystemInterface SystemInterface;
|
|
|
- ShellFileInterface FileInterface("../Samples/assets/");
|
|
|
|
|
|
|
+
|
|
|
|
|
+ Rocket::Core::String root = Shell::FindSamplesRoot();
|
|
|
|
|
+ ShellFileInterface FileInterface(root);
|
|
|
|
|
|
|
|
Rocket::Core::SetFileInterface(&FileInterface);
|
|
Rocket::Core::SetFileInterface(&FileInterface);
|
|
|
Rocket::Core::SetRenderInterface(&Renderer);
|
|
Rocket::Core::SetRenderInterface(&Renderer);
|
|
@@ -95,17 +88,17 @@ int main(int argc, char **argv)
|
|
|
if(!Rocket::Core::Initialise())
|
|
if(!Rocket::Core::Initialise())
|
|
|
return 1;
|
|
return 1;
|
|
|
|
|
|
|
|
- Rocket::Core::FontDatabase::LoadFontFace("Delicious-Bold.otf");
|
|
|
|
|
- Rocket::Core::FontDatabase::LoadFontFace("Delicious-BoldItalic.otf");
|
|
|
|
|
- Rocket::Core::FontDatabase::LoadFontFace("Delicious-Italic.otf");
|
|
|
|
|
- Rocket::Core::FontDatabase::LoadFontFace("Delicious-Roman.otf");
|
|
|
|
|
|
|
+ Rocket::Core::FontDatabase::LoadFontFace("assets/Delicious-Bold.otf");
|
|
|
|
|
+ Rocket::Core::FontDatabase::LoadFontFace("assets/Delicious-BoldItalic.otf");
|
|
|
|
|
+ Rocket::Core::FontDatabase::LoadFontFace("assets/Delicious-Italic.otf");
|
|
|
|
|
+ Rocket::Core::FontDatabase::LoadFontFace("assets/Delicious-Roman.otf");
|
|
|
|
|
|
|
|
Rocket::Core::Context *Context = Rocket::Core::CreateContext("default",
|
|
Rocket::Core::Context *Context = Rocket::Core::CreateContext("default",
|
|
|
Rocket::Core::Vector2i(window_width, window_height));
|
|
Rocket::Core::Vector2i(window_width, window_height));
|
|
|
|
|
|
|
|
Rocket::Debugger::Initialise(Context);
|
|
Rocket::Debugger::Initialise(Context);
|
|
|
|
|
|
|
|
- Rocket::Core::ElementDocument *Document = Context->LoadDocument("demo.rml");
|
|
|
|
|
|
|
+ Rocket::Core::ElementDocument *Document = Context->LoadDocument("assets/demo.rml");
|
|
|
|
|
|
|
|
if(Document)
|
|
if(Document)
|
|
|
{
|
|
{
|