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()
39 virtual void beginLayer(Layer* layer) = 0;
40 virtual void endLayer() = 0;
42 virtual bool needsRedraw(Layer *layer) = 0;
43 virtual bool needsRedraw(LayerList layers) = 0;
44 virtual void renderSWLayer(Layer* layer, bool clear) = 0;
45 virtual void renderSWLayers(LayerList layers, bool clear) = 0;
47 virtual void setBaseWindowSystem(BaseWindowSystem* windowSystem)
49 m_baseWindowSystem = windowSystem;
52 virtual void activateGraphicContext() = 0;
53 virtual void releaseGraphicContext() = 0;
54 virtual void clearBackground() = 0;
55 virtual void swapBuffers() = 0;
56 virtual void saveScreenShotOfFramebuffer(std::string fileToSave) = 0;
57 virtual bool setOptimizationMode(unsigned int id, unsigned int mode)
63 virtual bool getOptimizationMode(unsigned int id, unsigned int *mode)
70 virtual void setTextureBinder(ITextureBinder* binder)
74 virtual ITextureBinder* getTextureBinder()
78 virtual void renderSurface(Surface*)=0;
80 virtual void updateScreenList(LmScreenList& screenList)
85 virtual void switchScreen(uint screenID)
91 BaseWindowSystem* m_baseWindowSystem;
92 ITextureBinder* m_binder;
95 #endif /* _BASEGRAPHICSYSTEM_H_ */