Releases: tabularelf/Canvas
Canvas v2.2.0
Canvas v2.1.1
Added:
- New macro config option to force disable Canvas's garbage collection system.
Fixed:
- Added some missing feather jsdoc to Canvas functions.
Misc:
- Garbage Collector has now been improved to detect if an invalid entry was added to the GC.
- Redid different version support handling.
Canvas v2.1.0
Canvas v2.0.1
Fixes:
-Fixed an issue with Canvas's GC deleting the wrong buffers.
Canvas v2.0.0
Additions:
- New documentation!
- Depth can now be toggled per either each canvas instance or upon new canvas instance globally as per
surface_get_disabled_depth()
! - New methods! (
.SaveAsImage()
,.SetDepthDisabled()
,.GetDepthDisabled()
, and many more!) - Surface format support!
- Added
CanvasGetAppSurf(newAppSurf)
and feather JSDOC, thanks @Grisgram #2! (Slightly readapted to provide two use cases) - A whole garbage collector for Canvases! (Two stage system: Stage 1 runs every frame for a very short time. Stage 2 runs every 15 frames, freeing any loose buffers or surfaces.)
Changes
Canvas v1.3.0
-Fixed a bug where .Resize()
wasn't updating internal width and height.
-Changed .Clear()
to take in no arguments (was silly to have anyway)
-Canvas()
now has a new optional argument for force setting up the Canvas. (Creating a surface/buffer without having to copy or call start/finish)
-Added several of QoL functions.
--.IsAvailable()
- Checks whether the canvas has any data, and isn't in used.
--All of the draw_surface*
counterparts have been implemented for Canvas.
--.CopyCanvas()
and .CopyCanvasPart()
, which allows you to copy data from one Canvas to another.
--CanvasIsCanvas(canvas)
- Checks where the value passed is a valid Canvas constructor.
Canvas v1.2.1
- Disabled
.Resize()
on keeping contents on HTML5.
-- This is due to it fetching the texture from somewhere and this seems to be more of an upstream issue. (2022.6) - Added
.Clear([clearSurface], [clearBuffer])
, which by default clears both data.
Canvas v1.2.0
- Reworked
.Resize()
to now maintain the previous surface/buffer contents. - Reworked
.CopySurface()
to include an optional[forceResize]
argument. - Fixed a few edge cases where
.CopySurface()
and.Resize()
would crash the game while the surface is in use..Start()
- Added an argument for
.Start()
to be used with MRT shaders. - Renamed
.FreeSurface()
to.Flush()
- Note that
.FreeSurface()
will still function, but this is now deprecated (and shouldn't be used in future projects.) - Added the following methods:
.GetTexture()
,.CopySurfacePart()
,.GetPixel()
,.GetPixelArray()
Canvas v1.1.3
-Added .CopySurface(surfaceID, x, y, [updateCache])
(the last argument will respect .WriteToCache()
by default)
-Fixed .UpdateCache()
when .WriteToCache()
is set to false upon creation.
-Fixed .Resize()
continuing to free elements when the size value is the same.
Canvas v1.1.2
-Fixed a memory leak with .SetBufferContents()
-Added .UpdateCache()
as a method, to allow updating the cache manually.