Added a new texture wrap mode "clampzero", which outputs transparent black (or opaque black for textures without an alpha channel) rather than the texture's edge colors, when it's drawn or sampled from outside of its regular texture coordinate range.

This commit is contained in:
Alex Szpakowski
2015-11-30 02:22:20 -04:00
parent 2c4e713114
commit 4c82c96369
9 changed files with 43 additions and 32 deletions
+1 -10
View File
@@ -407,9 +407,6 @@ void Canvas::startGrab(const std::vector<Canvas *> &canvases)
if (canvases.size() > 0)
{
if (!isMultiCanvasSupported())
throw love::Exception("Multi-canvas rendering is not supported on this system.");
if ((int) canvases.size() + 1 > gl.getMaxRenderTargets())
throw love::Exception("This system can't simultaneously render to %d canvases.", canvases.size()+1);
@@ -804,15 +801,9 @@ bool Canvas::isSupported()
return GLAD_ES_VERSION_2_0 || GLAD_VERSION_3_0 || GLAD_ARB_framebuffer_object || GLAD_EXT_framebuffer_object;
}
bool Canvas::isMultiCanvasSupported()
{
// system must support at least 4 simultaneous active canvases.
return gl.getMaxRenderTargets() >= 4;
}
bool Canvas::isMultiFormatMultiCanvasSupported()
{
return isMultiCanvasSupported() && (GLAD_ES_VERSION_3_0 || GLAD_VERSION_3_0 || GLAD_ARB_framebuffer_object);
return gl.getMaxRenderTargets() > 1 && (GLAD_ES_VERSION_3_0 || GLAD_VERSION_3_0 || GLAD_ARB_framebuffer_object);
}
bool Canvas::supportedFormats[] = {false};