Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Crashing in Fullscreen

A topic by sayezz created Jul 08, 2022 Views: 123 Replies: 3
Viewing posts 1 to 4

When running the game with

window_set_fullscreen(true);

and then calling

window_set_cursor_sprite_ext(sprite, subimg, xscale, yscale, blend, alpha)

the game crashes without any logs or error messages.

I run the command like this

window_set_cursor_sprite_ext(myCursorSprite, 0, 2.66666, 2.66666, c_white, 1);


Best Regads

sayezz

Just for notice, if you call it like this, it works:

window_set_cursor_sprite_ext(myCursorSprite, 0, 2.6, 2.6, c_white, 1);


Meaning as soon as you use e.g. "2.66" istead of "2.6" it crashes

Developer (1 edit)

Oh huh - I guess you can’t really have a fractional number of pixels in an image, especially not in WinAPI.

You can more specifically fix this by making your scale a formula like round(width * scale) / width, which for 32px would give you 2.65625 and hit that exact number of pixels.

I’ll handle this slightly more properly in the next version though strange scales will likely look slightly off since cursor “origins” are whole numbers on Windows.

Thanks. That explains a lot and helps me to understand how the cursor works much better. Keep up the good work. Also thanks for the quick reply.