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 VSync blocks execution until the screen is in the retrace | | |||
| 129 | * | | |||
| 130 | * Case for waitVideoSync and non triple buffering buffer swaps (triple buffering support | | |||
| 131 | * has been removed). | | |||
| 132 | * | | |||
| 133 | */ | | |||
| 134 | bool blocksForRetrace() const { | | |||
| 135 | return m_blocksForRetrace; | | |||
| 136 | } | | |||
| 137 | /** | | |||
| 138 | * @brief Whether the backend uses direct rendering. | 128 | * @brief Whether the backend uses direct rendering. | ||
| 139 | * | 129 | * | ||
| 140 | * Some OpenGLScene modes require direct rendering. E.g. the OpenGL 2 should not be used | 130 | * Some OpenGLScene modes require direct rendering. E.g. the OpenGL 2 should not be used | ||
| 141 | * if direct rendering is not supported by the Scene. | 131 | * if direct rendering is not supported by the Scene. | ||
| 142 | * | 132 | * | ||
| 143 | * @return bool @c true if the GL context is direct, @c false if indirect | 133 | * @return bool @c true if the GL context is direct, @c false if indirect | ||
| 144 | */ | 134 | */ | ||
| 145 | bool isDirectRendering() const { | 135 | bool isDirectRendering() const { | ||
| ▲ Show 20 Lines • Show All 52 Lines • ▼ Show 20 Line(s) | 181 | protected: | |||
| 198 | * | 188 | * | ||
| 199 | * This method should be called by the concrete subclass in case the initialization failed. | 189 | * This method should be called by the concrete subclass in case the initialization failed. | ||
| 200 | * The given @p reason is logged as a warning. | 190 | * The given @p reason is logged as a warning. | ||
| 201 | * | 191 | * | ||
| 202 | * @param reason The reason why the initialization failed. | 192 | * @param reason The reason why the initialization failed. | ||
| 203 | */ | 193 | */ | ||
| 204 | void setFailed(const QString &reason); | 194 | void setFailed(const QString &reason); | ||
| 205 | /** | 195 | /** | ||
| 206 | * @brief Sets whether the VSync iplementation blocks | | |||
| 207 | * | | |||
| 208 | * Should be called by the concrete subclass once it is determined how VSync works. | | |||
| 209 | * If the subclass does not call this method, the backend defaults to @c false. | | |||
| 210 | * @param enabled @c true if VSync blocks, @c false otherwise. | | |||
| 211 | */ | | |||
| 212 | void setBlocksForRetrace(bool enabled) { | | |||
| 213 | m_blocksForRetrace = enabled; | | |||
| 214 | } | | |||
| 215 | /** | | |||
| 216 | * @brief Sets whether the OpenGL context is direct. | 196 | * @brief Sets whether the OpenGL context is direct. | ||
| 217 | * | 197 | * | ||
| 218 | * Should be called by the concrete subclass once it is determined whether the OpenGL context is | 198 | * Should be called by the concrete subclass once it is determined whether the OpenGL context is | ||
| 219 | * direct or indirect. | 199 | * direct or indirect. | ||
| 220 | * If the subclass does not call this method, the backend defaults to @c false. | 200 | * If the subclass does not call this method, the backend defaults to @c false. | ||
| 221 | * | 201 | * | ||
| 222 | * @param direct @c true if the OpenGL context is direct, @c false if indirect | 202 | * @param direct @c true if the OpenGL context is direct, @c false if indirect | ||
| 223 | */ | 203 | */ | ||
| Show All 36 Lines | |||||
| 260 | * These are the EGL/GLX extensions, not the OpenGL extensions | 240 | * These are the EGL/GLX extensions, not the OpenGL extensions | ||
| 261 | */ | 241 | */ | ||
| 262 | void setExtensions(const QList<QByteArray> &extensions) { | 242 | void setExtensions(const QList<QByteArray> &extensions) { | ||
| 263 | m_extensions = extensions; | 243 | m_extensions = extensions; | ||
| 264 | } | 244 | } | ||
| 265 | 245 | | |||
| 266 | private: | 246 | private: | ||
| 267 | /** | 247 | /** | ||
| 268 | * @brief Whether present() will block execution until the next vertical retrace @c false. | | |||
| 269 | */ | | |||
| 270 | bool m_blocksForRetrace; | | |||
| 271 | /** | | |||
| 272 | * @brief Whether direct rendering is used, defaults to @c false. | 248 | * @brief Whether direct rendering is used, defaults to @c false. | ||
| 273 | */ | 249 | */ | ||
| 274 | bool m_directRendering; | 250 | bool m_directRendering; | ||
| 275 | /** | 251 | /** | ||
| 276 | * @brief Whether the backend supports GLX_EXT_buffer_age / EGL_EXT_buffer_age. | 252 | * @brief Whether the backend supports GLX_EXT_buffer_age / EGL_EXT_buffer_age. | ||
| 277 | */ | 253 | */ | ||
| 278 | bool m_haveBufferAge; | 254 | bool m_haveBufferAge; | ||
| 279 | /** | 255 | /** | ||
| Show All 23 Lines | |||||