You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Manually calculate the bytes necessary for it's dimensions and allocate them.
Look up the pixel format / size to determine needed bytes.
If you do ANY of this wrong. You'll get segfaults or unsafe and undefined behavior.
Feature request
Why can't we have a safe image abstraction like the Image crate does? This is not only safer but also more convenient as it lets you create an image in one line.
Actually, there already is the Image::gen_image_color function, which creates a new image with the given dimensions filled with the given color. Therefore, one can simply call Image::gen_image_color(screen_width() as u16, screen_height() as u16, BLACK), so I don't see much value in adding a new constructor just for black images.
Problem
Creating an image in
Macroquad
is verbose and unsafe. To create an image in macroquad I have to:If you do ANY of this wrong. You'll get segfaults or unsafe and undefined behavior.
Feature request
Why can't we have a safe image abstraction like the
Image
crate does? This is not only safer but also more convenient as it lets you create an image in one line.See their docs for more.
The text was updated successfully, but these errors were encountered: