Windows Game draws texture pages

A

AlexMdle

Guest
I need a little help.

I've just imported the game I'm working on from GMS and when starting, it just draws random texture pages on screen. I'm not sure what the problem could be. The same kind of problem happened for some players back on GMS, but only before we switched the vertex buffer method in the windows > graphics tab. These are absent in GMS2.

Any ideas?
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
First thing's first! Did you clear the compiler cache? The "broom" icon beside Play in the IDE... this is a common issue with stale caches...

If you've done that and you're still getting the issue, then we'll need to know more details like what you're drawing and how... Is it only when drawing a specific object or background? Does everything draw weird? Does it draw properly in one room but not another? etc...
 
T

Taylor Miller

Guest
Other dev here:
  • Happens in all rooms.
  • Happens when drawing any surface.
  • It draws the entirety of the texture page, usually shrunken to fit on screen, but sometimes blowing up to full size.
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
  • Happens when drawing any surface.
Aha! Okay, so are you clearing the surface before you use it? A surface is simply an area of texture memory that GMS will "reserve" for drawing to as a surface. This means that whatever was in that part of the texture memory needs to be cleared before you actually use the surface. This is usually done with draw_clear_alpha, eg:

Code:
surface_set_target(shadow_surf);
draw_clear_alpha(c_black, 0);
draw_self();
surface_reset_target();
If you don't want to clear it every step that it's being drawn, then you can also clear once just when you create it, but it'll all depend on what you are doing (normally you'd clear it every step before redrawing what is required unless the surface is static and only drawn to once then simply displayed).
 
Top