Blender V2.61 - r43446

GPC_Engine.h

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