1 /***************************************************************************
3 * Copyright 2010,2011 BMW Car IT GmbH
4 * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
19 ****************************************************************************/
21 #ifndef _BASEGRAPHICSYSTEM_H_
22 #define _BASEGRAPHICSYSTEM_H_
24 #include "TextureBinders/ITextureBinder.h"
25 #include "WindowSystems/BaseWindowSystem.h"
26 #include "PlatformSurface.h"
31 template<class DisplayType, class WindowType>
32 class BaseGraphicSystem
35 virtual bool init(DisplayType display, WindowType window)=0;
36 virtual ~BaseGraphicSystem()
43 virtual void beginLayer(Layer* layer) = 0;
44 virtual void endLayer() = 0;
46 virtual bool needsRedraw(Layer *layer) = 0;
47 virtual bool needsRedraw(LayerList layers) = 0;
48 virtual void renderSWLayer(Layer* layer, bool clear) = 0;
49 virtual void renderSWLayers(LayerList layers, bool clear) = 0;
51 virtual void setBaseWindowSystem(BaseWindowSystem* windowSystem)
53 m_baseWindowSystem = windowSystem;
56 virtual void activateGraphicContext() = 0;
57 virtual void releaseGraphicContext() = 0;
58 virtual void clearBackground() = 0;
59 virtual void swapBuffers() = 0;
60 virtual void saveScreenShotOfFramebuffer(std::string fileToSave) = 0;
61 virtual bool setOptimizationMode(unsigned int id, unsigned int mode)
67 virtual bool getOptimizationMode(unsigned int id, unsigned int *mode)
74 virtual void setTextureBinder(ITextureBinder* binder)
78 virtual ITextureBinder* getTextureBinder()
82 virtual void renderSurface(Surface*)=0;
84 virtual void updateScreenList(LmScreenList& screenList)
89 virtual void switchScreen(uint screenID)
95 BaseWindowSystem* m_baseWindowSystem;
96 ITextureBinder* m_binder;
99 #endif /* _BASEGRAPHICSYSTEM_H_ */