1 /***************************************************************************
3 * Copyright 2010,2011 BMW Car IT GmbH
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
18 ****************************************************************************/
24 #include "LayerType.h"
26 #include "OptimizationType.h"
33 * Abstract Base of all CompositingControllers, ie Renderers.
34 * \defgroup RendererAPI Layer Management Renderer API
40 * \brief default destructor
47 * \brief Start the actual rendering process (render loop)
48 * \ingroup RendererAPI
49 * \param[in] width width of display handled by this renderer
50 * \param[in] height height of display handled by this renderer
51 * \param[in] displayName name of display handled by this renderer
52 * \param[in] maxIterationTimeInMS expected wakup time for health reporting in milliseconds (-1 to disable wakeup)
53 * \return TRUE: renderer was started successfully
54 * \return FALSE: renderer start failed
56 virtual bool start(int width, int height, const char* displayName, int maxIterationDurationInMS) = 0;
59 * \brief Stop rendering process (stop render loop)
60 * \ingroup RendererAPI
62 virtual void stop() = 0;
65 * \brief Switch debug mode of this component on or off
66 * \ingroup RendererAPI
67 * \param[in] onoff TRUE: Turn on debug mode, FALSE: Turn off debug mode
69 virtual void setdebug(bool onoff) = 0;
72 * \brief Store graphical content of screen to bitmap
73 * \ingroup RendererAPI
74 * \param[in] fileToSave path to bitmap file to store the graphical content
76 virtual void doScreenShot(std::string fileToSave) = 0;
79 * \brief Store graphical content of layer to bitmap
80 * \ingroup RendererAPI
81 * \param[in] fileToSave path to bitmap file to store the graphical content
82 * \param[in] id id of layer
84 virtual void doScreenShotOfLayer(std::string fileToSave, const unsigned int id) = 0;
87 * \brief Store graphical content of surface to bitmap
88 * \ingroup RendererAPI
89 * \param[in] fileToSave path to bitmap file to store the graphical content
90 * \param[in] id id of surface
91 * \param[in] layer_id id of layer
93 virtual void doScreenShotOfSurface(std::string fileToSave, const unsigned int id, const unsigned int layer_id) = 0;
96 * \brief Get the capabilies of a layer type
97 * \ingroup RendererAPI
98 * \param[in] layertype type of layer
99 * \return bitset with flags set for capabilities
101 virtual unsigned int getLayerTypeCapabilities(LayerType layertype) = 0;
104 * \brief Get the number of supported hardware layers of the renderer for a screen
105 * \ingroup RendererAPI
106 * \param[in] screenID id of the screen
107 * \return Number of supported hardware layers for screen
109 virtual unsigned int getNumberOfHardwareLayers(unsigned int screenID) = 0;
112 * \brief Get the resolution of a screen handled by this renderer
113 * \ingroup RendererAPI
114 * \param[in] screenID id of the screen
115 * \return array with width and height of screen
117 virtual unsigned int* getScreenResolution(unsigned int screenID) = 0;
120 * \brief Get the list if available screen ids
121 * \ingroup RendererAPI
122 * \param[out] length length of the returned array
123 * \return array containing all available screen ids
125 virtual unsigned int* getScreenIDs(unsigned int* length) = 0;
128 * \brief Create a shader object (that can be applied to surfaces)
129 * \ingroup RendererAPI
130 * \param[in] vertexName filename of vertex shader source code
131 * \param[in] fragmentName filename of fragment shader source code
132 * \return Pointer to created shader object
134 virtual Shader* createShader(const string* vertexName, const string* fragmentName) = 0;
137 * \brief Trigger a redraw for this renderer
138 * \ingroup RendererAPI
140 virtual void signalWindowSystemRedraw() = 0;
143 * \brief Force composition for entire scene
144 * \ingroup RendererAPI
146 virtual void forceCompositionWindowSystem() = 0;
149 * \brief Get the InputManager associated to the Scene
150 * \ingroup RendererAPI
152 virtual InputManager* getInputManager() const = 0;
155 * \brief Set the mode for the specified optimization (e.g. OFF,ON,AUTO)
156 * \ingroup RendererAPI
157 * \param[in] id id of optimization
158 * \param[in] mode mode to set for the optimization
159 * \return TRUE: id and mode are valid and mode was set
160 * \return FALSE: id or mode was invalid and/or mode could not be set
162 virtual bool setOptimizationMode(OptimizationType id, OptimizationModeType mode) = 0;
165 * \brief Get the current mode for the specified optimization
166 * \ingroup RendererAPI
167 * \param[in] id id of optimization
168 * \param[out] mode retrieved mode value
169 * \return TRUE: id is valid and mode was returned
170 * \return FALSE: id was invalid and/or mode was not returned
172 virtual bool getOptimizationMode(OptimizationType id, OptimizationModeType *mode) = 0;
175 #endif /* _IRENDERER_H_ */