Browse Source

Fixed and updated framebuffer documentation.

pull/107/head
Vladimír Vondruš 11 years ago
parent
commit
3d1bce2f17
  1. 10
      src/Magnum/DefaultFramebuffer.h
  2. 4
      src/Magnum/Framebuffer.h

10
src/Magnum/DefaultFramebuffer.h

@ -48,8 +48,8 @@ must ensure that it is properly resized when application surface is resized,
i.e. you must pass the new size in your @ref Platform::Sdl2Application::viewportEvent() "viewportEvent()" i.e. you must pass the new size in your @ref Platform::Sdl2Application::viewportEvent() "viewportEvent()"
implementation, for example: implementation, for example:
@code @code
void viewportEvent(const Vector2i& size) { void viewportEvent(const Vector2i& size) override {
defaultFramebuffer.setViewport({}, size); defaultFramebuffer.setViewport({{}, size});
// ... // ...
} }
@ -59,15 +59,15 @@ Next thing you probably want is to clear all used buffers before performing
any drawing in your @ref Platform::Sdl2Application::drawEvent() "drawEvent()" any drawing in your @ref Platform::Sdl2Application::drawEvent() "drawEvent()"
implementation, for example: implementation, for example:
@code @code
void drawEvent() { void drawEvent() override {
defaultFramebuffer.clear(FramebufferClear::Color|FramebufferClear::Depth); defaultFramebuffer.clear(FramebufferClear::Color|FramebufferClear::Depth);
// ... // ...
} }
@endcode @endcode
See Framebuffer documentation for more involved usage, usage of non-default or See documentation of particular functions and @ref Framebuffer documentation for
multiple framebuffers. more involved usage, usage of non-default or multiple framebuffers.
## Performance optimizations ## Performance optimizations

4
src/Magnum/Framebuffer.h

@ -81,10 +81,10 @@ void drawEvent() {
defaultFramebuffer.clear(FramebufferClear::Color) defaultFramebuffer.clear(FramebufferClear::Color)
framebuffer.clear(FramebufferClear::Color|FramebufferClear::Depth|FramebufferClear::Stencil); framebuffer.clear(FramebufferClear::Color|FramebufferClear::Depth|FramebufferClear::Stencil);
framebuffer.bind(FramebufferTarget::Draw); framebuffer.bind();
// ... // ...
defaultFramebuffer.bind(FramebufferTarget::Draw); defaultFramebuffer.bind();
// ... // ...
} }
@endcode @endcode

Loading…
Cancel
Save