Changeset View
Changeset View
Standalone View
Standalone View
libkwineffects/kwinglutils.h
Show First 20 Lines • Show All 215 Lines • ▼ Show 20 Line(s) | 209 | public: | |||
---|---|---|---|---|---|
216 | * @return The currently bound shader or @c null if no shader is bound. | 216 | * @return The currently bound shader or @c null if no shader is bound. | ||
217 | */ | 217 | */ | ||
218 | GLShader *getBoundShader() const; | 218 | GLShader *getBoundShader() const; | ||
219 | 219 | | |||
220 | /** | 220 | /** | ||
221 | * @return @c true if a shader is bound, @c false otherwise | 221 | * @return @c true if a shader is bound, @c false otherwise | ||
222 | */ | 222 | */ | ||
223 | bool isShaderBound() const; | 223 | bool isShaderBound() const; | ||
224 | /** | | |||
225 | * Is @c true if the environment variable KWIN_GL_DEBUG is set to 1. | | |||
226 | * In that case shaders are compiled with KWIN_SHADER_DEBUG defined. | | |||
227 | * @returns @c true if shaders are compiled with debug information | | |||
228 | * @since 4.8 | | |||
229 | */ | | |||
230 | bool isShaderDebug() const; | | |||
231 | 224 | | |||
232 | /** | 225 | /** | ||
233 | * Pushes the current shader onto the stack and binds a shader | 226 | * Pushes the current shader onto the stack and binds a shader | ||
234 | * with the given traits. | 227 | * with the given traits. | ||
235 | */ | 228 | */ | ||
236 | GLShader *pushShader(ShaderTraits traits); | 229 | GLShader *pushShader(ShaderTraits traits); | ||
237 | 230 | | |||
238 | /** | 231 | /** | ||
▲ Show 20 Lines • Show All 88 Lines • ▼ Show 20 Line(s) | 315 | private: | |||
327 | void bindAttributeLocations(GLShader *shader) const; | 320 | void bindAttributeLocations(GLShader *shader) const; | ||
328 | 321 | | |||
329 | QByteArray generateVertexSource(ShaderTraits traits) const; | 322 | QByteArray generateVertexSource(ShaderTraits traits) const; | ||
330 | QByteArray generateFragmentSource(ShaderTraits traits) const; | 323 | QByteArray generateFragmentSource(ShaderTraits traits) const; | ||
331 | GLShader *generateShader(ShaderTraits traits); | 324 | GLShader *generateShader(ShaderTraits traits); | ||
332 | 325 | | |||
333 | QStack<GLShader*> m_boundShaders; | 326 | QStack<GLShader*> m_boundShaders; | ||
334 | QHash<ShaderTraits, GLShader *> m_shaderHash; | 327 | QHash<ShaderTraits, GLShader *> m_shaderHash; | ||
335 | bool m_debug; | | |||
336 | QString m_resourcePath; | 328 | QString m_resourcePath; | ||
337 | static ShaderManager *s_shaderManager; | 329 | static ShaderManager *s_shaderManager; | ||
338 | }; | 330 | }; | ||
339 | 331 | | |||
340 | /** | 332 | /** | ||
341 | * An helper class to push a Shader on to ShaderManager's stack and ensuring that the Shader | 333 | * An helper class to push a Shader on to ShaderManager's stack and ensuring that the Shader | ||
342 | * gets popped again from the stack automatically once the object goes out of life. | 334 | * gets popped again from the stack automatically once the object goes out of life. | ||
343 | * | 335 | * | ||
▲ Show 20 Lines • Show All 494 Lines • Show Last 20 Lines |