Browse Source

Fixed platform differences and switched windows size values from hard coded to use a common set of variables

David Wimsey 11 years ago
parent
commit
711b3db78f
1 changed files with 11 additions and 1 deletions
  1. 11 1
      Samples/tutorial/datagrid/src/main.cpp

+ 11 - 1
Samples/tutorial/datagrid/src/main.cpp

@@ -47,11 +47,21 @@ int main(int ROCKET_UNUSED_PARAMETER(argc), char** ROCKET_UNUSED_PARAMETER(argv)
 	ROCKET_UNUSED(argv);
 #endif
 
+#ifdef ROCKET_PLATFORM_LINUX
+#define APP_PATH "../Samples/tutorial/datagrid/"
+#else
+#define APP_PATH "../../Samples/tutorial/datagrid/"
+#endif
+
+#ifdef ROCKET_PLATFORM_WIN32
+        DoAllocConsole();
+#endif
+
 	ShellRenderInterfaceOpenGL opengl_renderer;
 	shell_renderer = &opengl_renderer;
 
 	// Generic OS initialisation, creates a window and attaches OpenGL.
-	if (!Shell::Initialise("../Samples/tutorial/datagrid/") ||
+	if (!Shell::Initialise(APP_PATH) ||
 		!Shell::OpenWindow("Datagrid Tutorial", shell_renderer, 1024, 768, true))
 	{
 		Shell::Shutdown();