diff --git a/app/render/backend/opengl/openglframebuffer.cpp b/app/render/backend/opengl/openglframebuffer.cpp index 4f23b19e6..9153e9659 100644 --- a/app/render/backend/opengl/openglframebuffer.cpp +++ b/app/render/backend/opengl/openglframebuffer.cpp @@ -98,16 +98,6 @@ void OpenGLFramebuffer::Attach(OpenGLTexturePtr texture) AttachInternal(texture_->texture(), false); } -void OpenGLFramebuffer::AttachBackBuffer(OpenGLTexturePtr texture) -{ - if (context_ == nullptr) { - return; - } - - texture_ = texture; - AttachInternal(texture_->back_texture(), true); -} - void OpenGLFramebuffer::Detach() { if (context_ == nullptr) { diff --git a/app/render/backend/opengl/openglframebuffer.h b/app/render/backend/opengl/openglframebuffer.h index ad063e48d..7b74e925f 100644 --- a/app/render/backend/opengl/openglframebuffer.h +++ b/app/render/backend/opengl/openglframebuffer.h @@ -45,8 +45,6 @@ public: void Attach(OpenGLTexturePtr texture); - void AttachBackBuffer(OpenGLTexturePtr texture); - void Detach(); const GLuint& buffer() const; diff --git a/app/render/backend/opengl/opengltexture.cpp b/app/render/backend/opengl/opengltexture.cpp index bc67bb42c..0ee2a7e8b 100644 --- a/app/render/backend/opengl/opengltexture.cpp +++ b/app/render/backend/opengl/opengltexture.cpp @@ -28,7 +28,6 @@ OpenGLTexture::OpenGLTexture() : context_(nullptr), texture_(0), - back_texture_(0), width_(0), height_(0), format_(olive::PIX_FMT_INVALID) @@ -46,11 +45,6 @@ bool OpenGLTexture::IsCreated() const } void OpenGLTexture::Create(QOpenGLContext *ctx, int width, int height, const olive::PixelFormat &format, void* data) -{ - Create(ctx, width, height, format, kSingleBuffer, data); -} - -void OpenGLTexture::Create(QOpenGLContext *ctx, int width, int height, const olive::PixelFormat &format, const OpenGLTexture::Type &type, void *data) { if (ctx == nullptr) { qWarning() << "RenderTexture::Create was passed an invalid context"; @@ -68,21 +62,11 @@ void OpenGLTexture::Create(QOpenGLContext *ctx, int width, int height, const oli // Create main texture CreateInternal(&texture_, data); - - if (type == kDoubleBuffer) { - // Create back texture - CreateInternal(&back_texture_, nullptr); - } -} - -void OpenGLTexture::Create(QOpenGLContext *ctx, FramePtr frame, const Type &type) -{ - Create(ctx, frame->width(), frame->height(), frame->format(), type, frame->data()); } void OpenGLTexture::Create(QOpenGLContext *ctx, FramePtr frame) { - Create(ctx, frame, kSingleBuffer); + Create(ctx, frame->width(), frame->height(), frame->format(), frame->data()); } void OpenGLTexture::Destroy() @@ -93,9 +77,6 @@ void OpenGLTexture::Destroy() context_->functions()->glDeleteTextures(1, &texture_); texture_ = 0; - context_->functions()->glDeleteTextures(1, &back_texture_); - back_texture_ = 0; - context_ = nullptr; } } @@ -145,18 +126,6 @@ const GLuint &OpenGLTexture::texture() const return texture_; } -const GLuint &OpenGLTexture::back_texture() const -{ - return back_texture_; -} - -void OpenGLTexture::SwapFrontAndBack() -{ - GLuint temp = texture_; - texture_ = back_texture_; - back_texture_ = temp; -} - void OpenGLTexture::Upload(const void *data) { if (!IsCreated()) { diff --git a/app/render/backend/opengl/opengltexture.h b/app/render/backend/opengl/opengltexture.h index ba8abe612..258bce32d 100644 --- a/app/render/backend/opengl/opengltexture.h +++ b/app/render/backend/opengl/opengltexture.h @@ -35,19 +35,12 @@ class OpenGLTexture : public QObject { Q_OBJECT public: - enum Type { - kSingleBuffer, - kDoubleBuffer - }; - OpenGLTexture(); virtual ~OpenGLTexture() override; DISABLE_COPY_MOVE(OpenGLTexture) void Create(QOpenGLContext* ctx, int width, int height, const olive::PixelFormat &format, void *data = nullptr); - void Create(QOpenGLContext* ctx, int width, int height, const olive::PixelFormat &format, const Type& type, void *data = nullptr); - void Create(QOpenGLContext* ctx, FramePtr frame, const Type& type); void Create(QOpenGLContext* ctx, FramePtr frame); bool IsCreated() const; @@ -65,8 +58,6 @@ public: QOpenGLContext* context() const; const GLuint& texture() const; - const GLuint& back_texture() const; - void SwapFrontAndBack(); void Upload(const void *data); @@ -82,8 +73,6 @@ private: GLuint texture_; - GLuint back_texture_; - int width_; int height_;