Moved global resource creation to startup instead of context creation. Fixes #645.

This commit is contained in:
Leonardo Zide
2021-03-10 21:22:41 -08:00
parent 44d0e92b50
commit 233affe3fc
9 changed files with 79 additions and 86 deletions
+7 -2
View File
@@ -159,7 +159,9 @@ void lcTexture::CreateGridTexture()
mRefCount = 1;
mFlags = LC_TEXTURE_WRAPU | LC_TEXTURE_WRAPV | LC_TEXTURE_MIPMAPS | LC_TEXTURE_ANISOTROPIC;
lcGetPiecesLibrary()->QueueTextureUpload(this);
lcContext* Context = lcContext::GetGlobalOffscreenContext();
Context->MakeCurrent();
Upload(Context);
}
bool lcTexture::Load()
@@ -329,7 +331,10 @@ bool lcTexture::Load(int Flags)
Image.ResizePow2();
mFlags = Flags;
lcGetPiecesLibrary()->QueueTextureUpload(this);
lcContext* Context = lcContext::GetGlobalOffscreenContext();
Context->MakeCurrent();
Upload(Context);
return true;
}