Skip to content

Releases: tabularelf/Canvas

Canvas v2.2.0

27 Jun 20:25
Compare
Choose a tag to compare

Added:

  • .SetCallbackCacheUpdated(function) and .SetCallbackSurfaceUpdated(function) (see issue for more info #11)
  • Added additional optional argument to .Clear([color], [alpha], [updateCache]) where updateCache is new. #10

Bug Fixed:

  • Fixed an issue where copying to a blank canvas would crash. #9

Canvas v2.1.1

04 Mar 03:57
4ecc9db
Compare
Choose a tag to compare

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

13 Aug 19:28
Compare
Choose a tag to compare

New:

  • Added in __CanvasConfig, for setting the autowrite to cache on .Finish() and mode of surface depth #5

Fixed:

  • CanvasGetAppSurf(true) not respecting the value of __writeToCache when set to false #4
  • Backported to LTS

Canvas v2.0.1

20 Apr 17:20
Compare
Choose a tag to compare

Fixes:

-Fixed an issue with Canvas's GC deleting the wrong buffers.

Canvas v2.0.0

05 Apr 12:28
Compare
Choose a tag to compare

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

  • Updated .WriteToCache() to .SetWriteToCache(), to compliment .GetWriteToCache().
  • .Clear() now accepts two optional arguments as per #3, thanks once again @Grisgram! (.Clear([colour], [alpha]))

Canvas v1.3.0

11 Nov 04:05
Compare
Choose a tag to compare

-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

29 Sep 20:58
Compare
Choose a tag to compare
  • 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

28 Sep 21:10
Compare
Choose a tag to compare
  • 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

18 Sep 16:45
Compare
Choose a tag to compare

-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

16 Sep 05:45
Compare
Choose a tag to compare

-Fixed a memory leak with .SetBufferContents()
-Added .UpdateCache() as a method, to allow updating the cache manually.