void FrameBufferEffect::InitFbo1() { Vector2ui size(_window->Width(), _window->Height()); LOG << "create coloreTexture" << std::endl; GL::Texture colorTexture; colorTexture.Create(GL::Enum::Texture::Texture2d); colorTexture.Enable(); colorTexture.Init2d(0, GL::Enum::Texture::RGBA8, size, GL::Enum::PixelFormat::RGBA, GL::Enum::PixelDataType::UnsignedByte, NULL); colorTexture.GenerateMipmaps(); colorTexture.Disable(); LOG << "create depthRenderBuffer" << std::endl; GL::RenderBuffer depthRenderBuffer; depthRenderBuffer.Create(); depthRenderBuffer.Enable(); depthRenderBuffer.Init(GL::Enum::RenderBuffer::DepthComponent, size); depthRenderBuffer.Disable(); LOG << "Create fbo" << std::endl; _fboPass1.Create(); _fboPass1.Enable(); _fboPass1.Attach(GL::Enum::FrameBuffer::ColorAttachment0, colorTexture, 0); _fboPass1.Attach(GL::Enum::FrameBuffer::DepthAttachement, depthRenderBuffer); if(_fboPass1.CheckStatus() != GL::Enum::FrameBuffer::Complete) throw Utils::Exception("Can't initialize the fbo"); _fboPass1.Disable(); _sprite->SetTexture(colorTexture); _sprite->Size(size); _sprite->TextureBox(Box2i(Vector2f(0,0), size)); _camera2d->Resized(size); LOG << "init done" << std::endl; _fboNeedInit = false; }