Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

app_beos.cpp

Go to the documentation of this file.
00001 /*
00002         $Id: app_beos.cpp,v 1.2 2000/07/18 17:04:27 sphair Exp $
00003 
00004         ------------------------------------------------------------------------
00005         ClanLib, the platform independent game SDK.
00006 
00007         This library is distributed under the GNU LIBRARY GENERAL PUBLIC LICENSE
00008         version 2. See COPYING for details.
00009 
00010         For a total list of contributers see CREDITS.
00011 
00012         ------------------------------------------------------------------------
00013 
00014         File purpose:
00015                 main. Initialization of the BeOS version of ClanLib.
00016 
00017 */
00018 
00019 #include "app_beos.h"
00020 #include "API/Core/System/clanapp.h"
00021 #include "Core/Display/Be/clanwindowscreen.h"
00022 
00023 #include <OS.h>
00024 #include <Alert.h>
00025 
00026 extern "C"
00027 {
00028         #include <Hermes/Hermes.h>
00029 }
00030 
00031 // Minor hack. The datafile compiler calls this function. Under win32 it will
00032 // create a console window for cout.
00033 void redirect_to_console(const char *title)
00034 {
00035 }
00036 
00037 int main()
00038 {
00039         DBG("initializing Hermes...");
00040         Hermes_Init();
00041         
00042         LibApplication* lapp = new LibApplication();
00043         lapp->Run();
00044         delete lapp;
00045 }
00046 
00047 LibApplication::LibApplication() : BApplication("application/x-vnd.ClanSoft-ClanLib")
00048 {
00049 }
00050 
00051 void LibApplication::ReadyToRun()
00052 {
00053         if (CL_ClanApplication::app == NULL)
00054         {
00055                 BAlert* noProgram = new BAlert("ClanLib", "No program instance found", "Kick ass!", "Use Be!", "Have fun!", B_WIDTH_AS_USUAL, B_STOP_ALERT);
00056                 noProgram->Go();
00057                 PostMessage(B_QUIT_REQUESTED);
00058                 return;
00059         }
00060 
00061         DBG("starting app's main");
00062         CL_ClanApplication::app->main(largc, largv);
00063 
00064         DBG("quitting");
00065         PostMessage(B_QUIT_REQUESTED);
00066 }
00067 
00068 void LibApplication::ArgvReceived(int32 argc, char **argv)
00069 {
00070         largc = argc;
00071         largv = new char*[argc];
00072         for (int i=0; i<argc; i++)
00073         {
00074                 largv[i] = new char[strlen(argv[i])];
00075                 strcpy( largv[i], argv[i] );
00076         }
00077 }
00078 
00079 bool LibApplication::QuitRequested()
00080 {
00081         DBG("QuitRequested()");
00082         is_quitting = true;
00083         return true;
00084 }

Generated at Wed Apr 4 19:53:58 2001 for ClanLib by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001