|
@@ -63,19 +63,32 @@ int main(int ROCKET_UNUSED_PARAMETER(argc), char** ROCKET_UNUSED_PARAMETER(argv)
|
|
|
ROCKET_UNUSED(argv);
|
|
ROCKET_UNUSED(argv);
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
|
|
+#ifdef ROCKET_PLATFORM_LINUX
|
|
|
|
|
+#define APP_PATH "../Samples/basic/treeview/"
|
|
|
|
|
+#else
|
|
|
|
|
+#define APP_PATH "../../Samples/basic/treeview/"
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
|
|
+#ifdef ROCKET_PLATFORM_WIN32
|
|
|
|
|
+ DoAllocConsole();
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
|
|
+ int window_width = 1024;
|
|
|
|
|
+ int window_height = 768;
|
|
|
|
|
+
|
|
|
ShellRenderInterfaceOpenGL opengl_renderer;
|
|
ShellRenderInterfaceOpenGL opengl_renderer;
|
|
|
shell_renderer = &opengl_renderer;
|
|
shell_renderer = &opengl_renderer;
|
|
|
|
|
|
|
|
// Generic OS initialisation, creates a window and attaches OpenGL.
|
|
// Generic OS initialisation, creates a window and attaches OpenGL.
|
|
|
- if (!Shell::Initialise("../Samples/basic/treeview/") ||
|
|
|
|
|
- !Shell::OpenWindow("Tree View Sample", shell_renderer, 1024, 768, true))
|
|
|
|
|
|
|
+ if (!Shell::Initialise(APP_PATH) ||
|
|
|
|
|
+ !Shell::OpenWindow("Tree View Sample", shell_renderer, window_width, window_height, true))
|
|
|
{
|
|
{
|
|
|
Shell::Shutdown();
|
|
Shell::Shutdown();
|
|
|
return -1;
|
|
return -1;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Rocket initialisation.
|
|
// Rocket initialisation.
|
|
|
- opengl_renderer.SetViewport(1024,768);
|
|
|
|
|
|
|
+ opengl_renderer.SetViewport(window_width, window_height);
|
|
|
Rocket::Core::SetRenderInterface(&opengl_renderer);
|
|
Rocket::Core::SetRenderInterface(&opengl_renderer);
|
|
|
|
|
|
|
|
ShellSystemInterface system_interface;
|
|
ShellSystemInterface system_interface;
|
|
@@ -84,7 +97,7 @@ int main(int ROCKET_UNUSED_PARAMETER(argc), char** ROCKET_UNUSED_PARAMETER(argv)
|
|
|
Rocket::Core::Initialise();
|
|
Rocket::Core::Initialise();
|
|
|
|
|
|
|
|
// Create the main Rocket context and set it on the shell's input layer.
|
|
// Create the main Rocket context and set it on the shell's input layer.
|
|
|
- context = Rocket::Core::CreateContext("main", Rocket::Core::Vector2i(1024, 768));
|
|
|
|
|
|
|
+ context = Rocket::Core::CreateContext("main", Rocket::Core::Vector2i(window_width, window_height));
|
|
|
if (context == NULL)
|
|
if (context == NULL)
|
|
|
{
|
|
{
|
|
|
Rocket::Core::Shutdown();
|
|
Rocket::Core::Shutdown();
|