Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Simulator]: Crash on display.captureScreen and display.captureBounds on Mac OS simulators #735

Open
alanflickgames opened this issue Oct 22, 2024 · 0 comments

Comments

@alanflickgames
Copy link

alanflickgames commented Oct 22, 2024

On Mac (possibly just M1+ and not Intel Macs) the simulator suddenly crashes when you try to capture the screen. It happens around 75% of the time.

To reproduce you can use either of these in main.lua:

local obj = display.newRect(0, 0, 100, 100)
display.captureBounds({
	        xMin = 0,
	        xMax = 100,
	        yMin = 0,
	        yMax = 100,
	    }  )

or

local obj = display.newRect(0, 0, 100, 100)
display.captureScreen()

It is essentially the same problem as in this solved issue:
#595

The fix for issue 595 was to add these 2 lines to display.capture after the call to display.CaptureDisplayObject:

    //Rerender and Invalidate to prevent errors on start up
    display.Invalidate();
    display.Render();

I suspect this just needs the same fix to be applied to display.captureScreen and display.captureBounds

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@alanflickgames and others