scopes: don't use shared context

OpenGL shared contexts (through Qt at least) seem to be buggy. Scopes have been
shifted to a non-shared approach as a result.
This commit is contained in:
itsmattkc
2020-04-28 17:08:52 +10:00
parent 690bdb6581
commit 4906bb7d53
17 changed files with 90 additions and 188 deletions
@@ -74,6 +74,11 @@ void OpenGLTexture::Create(QOpenGLContext *ctx, int width, int height, const Pix
}
void OpenGLTexture::Create(QOpenGLContext *ctx, FramePtr frame)
{
Create(ctx, frame.get());
}
void OpenGLTexture::Create(QOpenGLContext *ctx, Frame *frame)
{
Create(ctx, frame->width(), frame->height(), frame->format(), frame->data(), frame->linesize_pixels());
}
@@ -120,6 +125,16 @@ const GLuint &OpenGLTexture::texture() const
return texture_;
}
void OpenGLTexture::Upload(FramePtr frame)
{
Upload(frame.get());
}
void OpenGLTexture::Upload(Frame *frame)
{
Upload(frame->data(), frame->linesize_pixels());
}
void OpenGLTexture::Upload(const void *data, int linesize)
{
if (!IsCreated()) {