Changeset View
Changeset View
Standalone View
Standalone View
platformsupport/scenes/opengl/backend.h
Show First 20 Lines • Show All 119 Lines • ▼ Show 20 Line(s) | 54 | public: | |||
---|---|---|---|---|---|
120 | * returns @c true, the SceneOpenGL should not try to start the rendering. | 120 | * returns @c true, the SceneOpenGL should not try to start the rendering. | ||
121 | * | 121 | * | ||
122 | * @return bool @c true if the creation of the Backend failed, @c false otherwise. | 122 | * @return bool @c true if the creation of the Backend failed, @c false otherwise. | ||
123 | */ | 123 | */ | ||
124 | bool isFailed() const { | 124 | bool isFailed() const { | ||
125 | return m_failed; | 125 | return m_failed; | ||
126 | } | 126 | } | ||
127 | /** | 127 | /** | ||
128 | * @brief Whether the Backend provides VSync. | | |||
129 | * | | |||
130 | * Currently only the GLX backend can provide VSync. | | |||
131 | * | | |||
132 | * @return bool @c true if VSync support is available, @c false otherwise | | |||
133 | */ | | |||
134 | bool syncsToVBlank() const { | | |||
135 | return m_syncsToVBlank; | | |||
136 | } | | |||
137 | /** | | |||
138 | * @brief Whether VSync blocks execution until the screen is in the retrace | 128 | * @brief Whether VSync blocks execution until the screen is in the retrace | ||
139 | * | 129 | * | ||
140 | * Case for waitVideoSync and non triple buffering buffer swaps (triple buffering support | 130 | * Case for waitVideoSync and non triple buffering buffer swaps (triple buffering support | ||
141 | * has been removed). | 131 | * has been removed). | ||
142 | * | 132 | * | ||
143 | */ | 133 | */ | ||
144 | bool blocksForRetrace() const { | 134 | bool blocksForRetrace() const { | ||
145 | return m_blocksForRetrace; | 135 | return m_blocksForRetrace; | ||
▲ Show 20 Lines • Show All 62 Lines • ▼ Show 20 Line(s) | 191 | protected: | |||
208 | * | 198 | * | ||
209 | * This method should be called by the concrete subclass in case the initialization failed. | 199 | * This method should be called by the concrete subclass in case the initialization failed. | ||
210 | * The given @p reason is logged as a warning. | 200 | * The given @p reason is logged as a warning. | ||
211 | * | 201 | * | ||
212 | * @param reason The reason why the initialization failed. | 202 | * @param reason The reason why the initialization failed. | ||
213 | */ | 203 | */ | ||
214 | void setFailed(const QString &reason); | 204 | void setFailed(const QString &reason); | ||
215 | /** | 205 | /** | ||
216 | * @brief Sets whether the backend provides VSync. | | |||
217 | * | | |||
218 | * Should be called by the concrete subclass once it is determined whether VSync is supported. | | |||
219 | * If the subclass does not call this method, the backend defaults to @c false. | | |||
220 | * @param enabled @c true if VSync support available, @c false otherwise. | | |||
221 | */ | | |||
222 | void setSyncsToVBlank(bool enabled) { | | |||
223 | m_syncsToVBlank = enabled; | | |||
224 | } | | |||
225 | /** | | |||
226 | * @brief Sets whether the VSync iplementation blocks | 206 | * @brief Sets whether the VSync iplementation blocks | ||
227 | * | 207 | * | ||
228 | * Should be called by the concrete subclass once it is determined how VSync works. | 208 | * Should be called by the concrete subclass once it is determined how VSync works. | ||
229 | * If the subclass does not call this method, the backend defaults to @c false. | 209 | * If the subclass does not call this method, the backend defaults to @c false. | ||
230 | * @param enabled @c true if VSync blocks, @c false otherwise. | 210 | * @param enabled @c true if VSync blocks, @c false otherwise. | ||
231 | */ | 211 | */ | ||
232 | void setBlocksForRetrace(bool enabled) { | 212 | void setBlocksForRetrace(bool enabled) { | ||
233 | m_blocksForRetrace = enabled; | 213 | m_blocksForRetrace = enabled; | ||
▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Line(s) | |||||
280 | * These are the EGL/GLX extensions, not the OpenGL extensions | 260 | * These are the EGL/GLX extensions, not the OpenGL extensions | ||
281 | */ | 261 | */ | ||
282 | void setExtensions(const QList<QByteArray> &extensions) { | 262 | void setExtensions(const QList<QByteArray> &extensions) { | ||
283 | m_extensions = extensions; | 263 | m_extensions = extensions; | ||
284 | } | 264 | } | ||
285 | 265 | | |||
286 | private: | 266 | private: | ||
287 | /** | 267 | /** | ||
288 | * @brief Whether VSync is available and used, defaults to @c false. | | |||
289 | */ | | |||
290 | bool m_syncsToVBlank; | | |||
291 | /** | | |||
292 | * @brief Whether present() will block execution until the next vertical retrace @c false. | 268 | * @brief Whether present() will block execution until the next vertical retrace @c false. | ||
293 | */ | 269 | */ | ||
294 | bool m_blocksForRetrace; | 270 | bool m_blocksForRetrace; | ||
295 | /** | 271 | /** | ||
296 | * @brief Whether direct rendering is used, defaults to @c false. | 272 | * @brief Whether direct rendering is used, defaults to @c false. | ||
297 | */ | 273 | */ | ||
298 | bool m_directRendering; | 274 | bool m_directRendering; | ||
299 | /** | 275 | /** | ||
Show All 27 Lines |