Browse Source

add callback variant for love.graphics.captureScreenshot

ell 1 year ago
parent
commit
23bd9110dd
1 changed files with 5 additions and 0 deletions
  1. 5 0
      testing/tests/graphics.lua

+ 5 - 0
testing/tests/graphics.lua

@@ -1550,6 +1550,11 @@ love.test.graphics.captureScreenshot = function(test)
   -- need to wait until end of the frame for the screenshot
   test:assertNotNil(love.filesystem.openFile('example-screenshot.png', 'r'))
   love.filesystem.remove('example-screenshot.png')
+  -- test callback version
+  love.graphics.captureScreenshot(function (idata)
+    test:assertNotEquals(nil, idata, 'check we have image data')
+  end)
+  test:waitFrames(10)
 end