X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Frender%2Fsequence.cpp;h=9a50b8f6f405648ff7b857af03f394b4a85d2eb7;hb=1509585cd1adcf7cff7beecc72e953583a2ea07e;hp=aaa1ef12a2238e209973c708446672b3ba865ed6;hpb=cd5f37b066352119cf92d53d0001af7ff99be437;p=libs%2Fgl.git diff --git a/source/render/sequence.cpp b/source/render/sequence.cpp index aaa1ef12..9a50b8f6 100644 --- a/source/render/sequence.cpp +++ b/source/render/sequence.cpp @@ -1,6 +1,5 @@ #include #include "blend.h" -#include "camera.h" #include "framebuffer.h" #include "lighting.h" #include "postprocessor.h" @@ -32,7 +31,6 @@ Sequence::Sequence(const Framebuffer &fbo) void Sequence::init(unsigned w, unsigned h) { - camera = 0; width = w; height = h; hdr = false; @@ -132,7 +130,7 @@ void Sequence::add_postprocessor(PostProcessor *pp, bool owned) } catch(...) { - if(!owned) + if(owned) delete pp; postproc.pop_back(); throw; @@ -197,8 +195,8 @@ void Sequence::render(Renderer &renderer, Tag tag) const { unsigned j = i%2; renderer.set_framebuffer(i+1get_framebuffer() : out_fbo); - const Texture2D &color = target[j]->get_target_texture(RENDER_COLOR); - const Texture2D &depth = target[j]->get_target_texture(RENDER_DEPTH); + const Texture2D &color = target[j]->get_target_texture(COLOR_ATTACHMENT); + const Texture2D &depth = target[j]->get_target_texture(DEPTH_ATTACHMENT); postproc[i].postproc->render(renderer, color, depth); } } @@ -220,7 +218,7 @@ void Sequence::create_targets(unsigned recreate) } PixelFormat color_pf = (hdr ? (alpha ? RGBA16F : RGB16F) : (alpha ? RGBA8 : RGB8)); - RenderTargetFormat fmt = (RENDER_COLOR,color_pf, RENDER_DEPTH); + FrameFormat fmt = (COLOR_ATTACHMENT,color_pf, DEPTH_ATTACHMENT); if(!postproc.empty() || samples) { if(!target[0]) @@ -230,7 +228,7 @@ void Sequence::create_targets(unsigned recreate) } if(!target_ms && samples) - target_ms = new RenderTarget(width, height, samples, fmt); + target_ms = new RenderTarget(width, height, fmt.set_samples(samples)); #ifdef DEBUG if(!debug_name.empty())