00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef CGRAPHICCORE_HPP_INCLUDED
00020 #define CGRAPHICCORE_HPP_INCLUDED
00021
00022 #include "start_code.hpp"
00023 #include "SINGLETON.hpp"
00024 #include "cSprite.hpp"
00025 #include "cCamera.hpp"
00026
00027 #undef AFX_EXT_CLASS
00028 #undef AFX_EXT_API
00029 #undef AFX_EXT_DATA
00030 #define AFX_EXT_CLASS AFX_CLASS_IMPORT
00031 #define AFX_EXT_API AFX_API_IMPORT
00032 #define AFX_EXT_DATA AFX_DATA_IMPORT
00033
00034 #include <SDL.h>
00035 #include <sdl_image.h>
00036
00037 #undef AFX_EXT_CLASS
00038 #undef AFX_EXT_API
00039 #undef AFX_EXT_DATA
00040 #define AFX_EXT_CLASS AFX_CLASS_EXPORT
00041 #define AFX_EXT_API AFX_API_EXPORT
00042 #define AFX_EXT_DATA AFX_DATA_EXPORT
00043
00044
00045
00046 #define g_pcGraphicCore cGraphicCore::Get()
00048 namespace SPACE
00049 {
00050 namespace Graphic
00051 {
00056 class DLL_EXPORT cGraphicCore : public SPACE::Core::TSingleton<cGraphicCore>
00057 {
00058 public:
00059 cGraphicCore();
00060 ~cGraphicCore();
00061
00076 bool Init(const int _ScreenWidth, const int _ScreenHeight, const bool _bFullScreen = false, const int _ColorDepth = 32, const bool _bDoubleBuffer = true,
00077 const char* _ScreenTitle = "Build with SPACE Engine", const char* _IconPath = 0, const bool _bResizeable = true, const bool _bShowBorder = true);
00078
00080 SDL_Surface* GetScreen() {return m_pScreen;}
00081
00087 bool SetCursorImage(cSprite* _Image);
00088
00093 void RenderAll(int _R = 0, int _G = 0, int _B = 0);
00094
00096 cCamera* GetCamera() {return m_pCamera;}
00097
00098 bool RenderCursor();
00099 bool FlipBuffer();
00100
00101 private:
00103 void Quit();
00104
00105
00106 private:
00107 SDL_Surface* m_pScreen;
00108 cSprite* m_pCursor;
00109 cCamera* m_pCamera;
00110 };
00111 }
00112 }
00113 #endif // CGRAPHICCORE_HPP_INCLUDED