MyGUI  3.2.0
MyGUI_RenderManager.h
Go to the documentation of this file.
00001 
00006 /*
00007     This file is part of MyGUI.
00008 
00009     MyGUI is free software: you can redistribute it and/or modify
00010     it under the terms of the GNU Lesser General Public License as published by
00011     the Free Software Foundation, either version 3 of the License, or
00012     (at your option) any later version.
00013 
00014     MyGUI is distributed in the hope that it will be useful,
00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017     GNU Lesser General Public License for more details.
00018 
00019     You should have received a copy of the GNU Lesser General Public License
00020     along with MyGUI.  If not, see <http://www.gnu.org/licenses/>.
00021 */
00022 #ifndef __MYGUI_RENDER_MANAGER_H__
00023 #define __MYGUI_RENDER_MANAGER_H__
00024 
00025 #include "MyGUI_Prerequest.h"
00026 #include "MyGUI_Singleton.h"
00027 #include "MyGUI_RenderFormat.h"
00028 #include "MyGUI_ITexture.h"
00029 #include "MyGUI_IVertexBuffer.h"
00030 #include "MyGUI_IRenderTarget.h"
00031 
00032 namespace MyGUI
00033 {
00034 
00035     class MYGUI_EXPORT RenderManager :
00036         public Singleton<RenderManager>
00037     {
00038     public:
00039 
00044         virtual IVertexBuffer* createVertexBuffer() = 0;
00046         virtual void destroyVertexBuffer(IVertexBuffer* _buffer) = 0;
00047 
00049         virtual ITexture* createTexture(const std::string& _name) = 0;
00051         virtual void destroyTexture(ITexture* _texture) = 0;
00053         virtual ITexture* getTexture(const std::string& _name) = 0;
00054 
00055         //FIXME возможно перенести в структуру о рендер таргете
00056         virtual const IntSize& getViewSize() const = 0;
00057 
00059         virtual VertexColourType getVertexFormat() = 0;
00060 
00062         virtual bool isFormatSupported(PixelFormat _format, TextureUsage _usage);
00063 
00064 #if MYGUI_DEBUG_MODE == 1
00065 
00066         virtual bool checkTexture(ITexture* _texture);
00067 #endif
00068 
00069     protected:
00070         virtual void onResizeView(const IntSize& _viewSize);
00071         virtual void onRenderToTarget(IRenderTarget* _target, bool _update);
00072         virtual void onFrameEvent(float _time);
00073     };
00074 
00075 } // namespace MyGUI
00076 
00077 #endif // __MYGUI_RENDER_MANAGER_H__