Changeset View
Changeset View
Standalone View
Standalone View
libkwineffects/kwinglutils.h
Show First 20 Lines • Show All 411 Lines • ▼ Show 20 Line(s) | |||||
412 | * Render target object enables you to render onto a texture. This texture can | 412 | * Render target object enables you to render onto a texture. This texture can | ||
413 | * later be used to e.g. do post-processing of the scene. | 413 | * later be used to e.g. do post-processing of the scene. | ||
414 | * | 414 | * | ||
415 | * @author Rivo Laks <rivolaks@hot.ee> | 415 | * @author Rivo Laks <rivolaks@hot.ee> | ||
416 | **/ | 416 | **/ | ||
417 | class KWINGLUTILS_EXPORT GLRenderTarget | 417 | class KWINGLUTILS_EXPORT GLRenderTarget | ||
418 | { | 418 | { | ||
419 | public: | 419 | public: | ||
420 | | ||||
421 | /** | ||||
422 | * Constructs a GLRenderTarget | ||||
423 | * @since 5.13 | ||||
424 | **/ | ||||
425 | explicit GLRenderTarget(); | ||||
426 | | ||||
420 | /** | 427 | /** | ||
421 | * Constructs a GLRenderTarget | 428 | * Constructs a GLRenderTarget | ||
422 | * @param color texture where the scene will be rendered onto | 429 | * @param color texture where the scene will be rendered onto | ||
423 | **/ | 430 | **/ | ||
424 | explicit GLRenderTarget(const GLTexture& color); | 431 | explicit GLRenderTarget(const GLTexture& color); | ||
425 | ~GLRenderTarget(); | 432 | ~GLRenderTarget(); | ||
426 | 433 | | |||
427 | /** | 434 | /** | ||
Show All 10 Lines | |||||
438 | 445 | | |||
439 | /** | 446 | /** | ||
440 | * Sets the target texture | 447 | * Sets the target texture | ||
441 | * @param target texture where the scene will be rendered on | 448 | * @param target texture where the scene will be rendered on | ||
442 | * @since 4.8 | 449 | * @since 4.8 | ||
443 | **/ | 450 | **/ | ||
444 | void attachTexture(const GLTexture& target); | 451 | void attachTexture(const GLTexture& target); | ||
445 | 452 | | |||
453 | /** | ||||
454 | * Detaches the texture that is currently attached to this framebuffer object. | ||||
455 | * @since 5.13 | ||||
456 | **/ | ||||
457 | void detachTexture(); | ||||
458 | | ||||
446 | bool valid() const { | 459 | bool valid() const { | ||
447 | return mValid; | 460 | return mValid; | ||
448 | } | 461 | } | ||
449 | 462 | | |||
463 | void setTextureDirty() { | ||||
464 | mTexture.setDirty(); | ||||
465 | } | ||||
466 | | ||||
450 | static void initStatic(); | 467 | static void initStatic(); | ||
451 | static bool supported() { | 468 | static bool supported() { | ||
452 | return sSupported; | 469 | return sSupported; | ||
453 | } | 470 | } | ||
471 | | ||||
472 | /** | ||||
473 | * Pushes the render target stack of the input parameter in reverse order. | ||||
474 | * @param targets The stack of GLRenderTargets | ||||
475 | * @since 5.13 | ||||
476 | **/ | ||||
477 | static void pushRenderTargets(QStack <GLRenderTarget*> targets); | ||||
fredrik: This assumes that s_renderTargets is empty when this function is called, which might not be the… | |||||
478 | | ||||
454 | static void pushRenderTarget(GLRenderTarget *target); | 479 | static void pushRenderTarget(GLRenderTarget *target); | ||
455 | static GLRenderTarget *popRenderTarget(); | 480 | static GLRenderTarget *popRenderTarget(); | ||
456 | static bool isRenderTargetBound(); | 481 | static bool isRenderTargetBound(); | ||
457 | /** | 482 | /** | ||
458 | * Whether the GL_EXT_framebuffer_blit extension is supported. | 483 | * Whether the GL_EXT_framebuffer_blit extension is supported. | ||
459 | * This functionality is not available in OpenGL ES 2.0. | 484 | * This functionality is not available in OpenGL ES 2.0. | ||
460 | * | 485 | * | ||
461 | * @returns whether framebuffer blitting is supported. | 486 | * @returns whether framebuffer blitting is supported. | ||
▲ Show 20 Lines • Show All 340 Lines • Show Last 20 Lines |
This assumes that s_renderTargets is empty when this function is called, which might not be the case.
How about naming it pushRenderTargets(), and have it add the targets to s_renderTargets instead of replacing it?