mirror of
https://github.com/love2d/love.git
synced 2026-08-12 08:30:56 +02:00
Initial support for integer format textures.
They can't be rendered to and ImageData can't use the formats, for now.
This commit is contained in:
@@ -693,6 +693,9 @@ void Graphics::setRenderTargets(const RenderTargets &rts)
|
||||
if (!firsttex->isValidSlice(firsttarget.slice))
|
||||
throw love::Exception("Invalid slice index: %d.", firsttarget.slice + 1);
|
||||
|
||||
if (isPixelFormatInteger(firstcolorformat))
|
||||
throw love::Exception("Textures with integer pixel formats cannot be rendered to, currently.");
|
||||
|
||||
bool hasSRGBtexture = firstcolorformat == PIXELFORMAT_sRGBA8_UNORM;
|
||||
int pixelw = firsttex->getPixelWidth(firsttarget.mipmap);
|
||||
int pixelh = firsttex->getPixelHeight(firsttarget.mipmap);
|
||||
@@ -726,6 +729,9 @@ void Graphics::setRenderTargets(const RenderTargets &rts)
|
||||
if (isPixelFormatDepthStencil(format))
|
||||
throw love::Exception("Depth/stencil format textures must be used with the 'depthstencil' field of the table passed into setRenderTargets.");
|
||||
|
||||
if (isPixelFormatInteger(format))
|
||||
throw love::Exception("Textures with integer pixel formats cannot be rendered to, currently.");
|
||||
|
||||
if (format == PIXELFORMAT_sRGBA8_UNORM)
|
||||
hasSRGBtexture = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user