1. Hey! Guest! The 36th GMC Jam will take place between February 27th, 12:00 UTC - March 2nd, 12:00 UTC. Why not join in! Click here to find out more!
    Dismiss Notice

Windows Game draws texture pages

Discussion in 'Programming' started by AlexMdle, Mar 9, 2018.

  1. AlexMdle

    AlexMdle Member

    Mar 9, 2018
    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?
  2. Nocturne

    Nocturne Friendly Tyrant Forum Staff Admin

    Apr 13, 2016
    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...
  3. 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.
  4. Nocturne

    Nocturne Friendly Tyrant Forum Staff Admin

    Apr 13, 2016
    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:

    draw_clear_alpha(c_black, 0);
    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).

Share This Page