Blender  V2.59
GPC_Engine.h
Go to the documentation of this file.
00001 /*
00002  * $Id: GPC_Engine.h 35063 2011-02-22 10:33:14Z jesterking $
00003  *
00004  * ***** BEGIN GPL LICENSE BLOCK *****
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * as published by the Free Software Foundation; either version 2
00009  * of the License, or (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software Foundation,
00018  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019  *
00020  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
00021  * All rights reserved.
00022  *
00023  * The Original Code is: all of this file.
00024  *
00025  * Contributor(s): none yet.
00026  *
00027  * ***** END GPL LICENSE BLOCK *****
00028  */
00029 
00034 #ifndef __GPC_ENGINE_H
00035 #define __GPC_ENGINE_H
00036 
00037 #include "GPC_Canvas.h"
00038 #include "GPC_System.h"
00039 
00040 class GPC_KeyboardDevice;
00041 class GPC_MouseDevice;
00042 
00043 class RAS_IRenderTools;
00044 class KetsjiPortal;
00045 class KX_ISceneConverter;
00046 class NG_LoopBackNetworkDeviceInterface;
00047 class GPC_RawImage;
00048 
00049 
00050 class GPC_Engine
00051 {
00052 //protected:
00053 public:
00055         bool m_initialized;
00057         bool m_running;
00060         bool m_loading;
00061 
00062         bool m_customLoadingAnimation;
00063 
00065         float m_previousProgress;
00066 
00068         GPC_System* m_system;
00070         GPC_KeyboardDevice* m_keyboarddev;
00072         GPC_MouseDevice* m_mousedev;
00074         GPC_Canvas* m_canvas;
00076         RAS_IRenderTools* m_rendertools;
00078         KetsjiPortal* m_portal;
00080         KX_ISceneConverter* m_sceneconverter;
00082         NG_LoopBackNetworkDeviceInterface* m_networkdev;
00083         
00084         struct ScrArea *m_curarea;  // for future use, not used yet
00085 
00086         char *m_customLoadingAnimationURL;
00087         int m_foregroundColor;
00088         int m_backgroundColor;
00089         int m_frameRate;
00090 
00091         GPC_RawImage *m_BlenderLogo;
00092         GPC_Canvas::TBannerId m_BlenderLogoId;
00093         GPC_RawImage *m_Blender3DLogo;
00094         GPC_Canvas::TBannerId m_Blender3DLogoId;
00095 #if 0
00096         GPC_RawImage *m_NaNLogo;
00097         GPC_Canvas::TBannerId m_NaNLogoId;
00098 #endif
00099 
00100 public:
00101         GPC_Engine(char *customLoadingAnimation,
00102                         int foregroundColor, int backgroundColor, int frameRate);
00103         virtual ~GPC_Engine();
00104         // Initialize() functions are not put here since they have
00105         // different prototypes for Unix and Windows
00106         void StartLoadingAnimation();
00107         bool Start(char *filename);  // file-on-disk starter
00108         bool Start(unsigned char *blenderDataBuffer,
00109                         unsigned int blenderDataBufferSize);  // file-in-memory starter
00110 
00111         void Stop();
00112         virtual void Exit();
00113 
00114         bool Initialized(void) {return m_initialized;}
00115         bool Loading(void) {return m_loading;}
00116         bool Running(void) const {return m_running;}
00117 
00118         virtual float DetermineProgress(void);  // will be platform dependant
00119         void UpdateLoadingAnimation(void);
00120 
00121 private:
00122         bool StartKetsji(void);
00123 
00124 };
00125 
00126 #endif  // __GPC_ENGINE_H
00127