Add love.graphics.copyTextureToBuffer and copyBufferToTexture.

This commit is contained in:
Alex Szpakowski
2021-12-28 12:46:56 -04:00
parent d7bfc2ebcb
commit 52101b2563
11 changed files with 344 additions and 4 deletions
+18
View File
@@ -1530,6 +1530,24 @@ bool OpenGL::isCopyBufferSupported() const
return GLAD_VERSION_3_1 || GLAD_ES_VERSION_3_0;
}
bool OpenGL::isCopyBufferToTextureSupported() const
{
// Requires pixel unpack buffer binding support.
return GLAD_VERSION_2_0 || GLAD_ES_VERSION_3_0;
}
bool OpenGL::isCopyTextureToBufferSupported() const
{
// Requires glGetTextureSubImage support.
return GLAD_VERSION_4_5;
}
bool OpenGL::isCopyRenderTargetToBufferSupported() const
{
// Requires pixel pack buffer binding support.
return GLAD_VERSION_2_0 || GLAD_ES_VERSION_3_0;
}
int OpenGL::getMax2DTextureSize() const
{
return std::max(max2DTextureSize, 1);