Legacy GM Surfaces aren't being drawn at the right size


Dragon Ferocity

I'm having a lot of issues with using surfaces right now. Issues I haven't encountered before.

The first issue i'm having, is when I set a surface to the size of the room (10,000 x 10,000), the surface is actually set to around 1800 x 1800 (Even though surface_get_width() reports 10,000), and it is scaled to about 1/6 or 1/7 of the size it should be.

If I set the size of the surface to 8192 x 8192, then it is scaled correctly at a 1:1 ratio, but when I get to the edge of the surface, the last row of pixels is stretched to the edge of the screen.

Now, if I set the room size to 16384 x 16384, but keep the surface at 8192 x 8192, then the surface is scaled to 1:1 ratio, and the last row of pixels is stretched to the edge of the room.

If I set the surface to be the same size as the room, the surface becomes scaled at a 0.5:1 ratio with the room, but the last row of pixels is not stretched to the edge of the room, and the surface doesn't show everything I'm drawing to it.

(I'd rather not post a lot of code at this moment, but if you need more I'll provide it).

Here's what I'm using to draw the surface:

draw_surface_general(WORLD_SURFACE, view_xview[0], view_yview[0], view_wview[0], view_hview[0], view_xview[0], view_yview[0], 1, 1, 0, c_white, c_white, c_white, c_white, 1);
Here's my script that draws the surface:

var numRows = argument0;

show_debug_message("Creating surface");

if (!surface_exists(WORLD_SURFACE))
  WORLD_SURFACE = surface_create(16384, 16384);
draw_clear_alpha(c_black, 0);


show_debug_message("Done with surface");


I have no idea whats going on.


You're trying to create a surface that's bigger than your GPU can handle. Don't make a surface that big. 1024x1024 and 2048x2048 are safe sizes that will be supported on the majority of devices, including mobile.