• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Windows [Confirmed] bug? Surface issues preventing additional drawing

kupo15

Member
There has to be some sort of surface bug, has anyone else been experiencing it? I just added my first surface to my game (to prove that I didn't mess up with another surface and that recent update interfering with this)

In Draw Begin
Code:
if !surface_exists(shadow_surface) // if surface is lost
    {
    show_debug_message("shadow surface lost: rebuilding");
    ini_shadow_surface(); // this is simply shadow_surface = surface_create
    }

surface_set_target(shadow_surface);
draw_clear_alpha(c_red,1);
surface_reset_target();

// draw the surface
var zoom_scale = cam_w/1920;
draw_surface_ext(shadow_surface,left_box,top_box,zoom_scale,zoom_scale,0,c_white,1);
The result of this is that the surface is not drawn AND nothing after this is being drawn. If I were to stick the draw_surface BEFORE building it, it draws the surface but once again, nothing afterwards is drawn.

It seems as if surface_reset_target isn't resetting the target at all and things are still being drawn to the surface. Anyone have any idea what might be going on?
 
P

ph101

Guest
Yes, having this same issue when using this code in the DrawGUI event with the new beta v2.2.2
Sorry to pry, but have you filed a bug? I haven't had a chance to test the beta but I think we'd all appreciate it so that YYG can get chance to solve the issue?
 

kupo15

Member
Yes, having this same issue when using this code in the DrawGUI event with the new beta v2.2.2
That's good to know that I'm not alone even though I don't have the beta. I find it strange that no one else has reported this, though I opened a blank project and surfaces appear to be working which doesn't help my main project.

Sorry to pry, but have you filed a bug? I haven't had a chance to test the beta but I think we'd all appreciate it so that YYG can get chance to solve the issue?
I filed a bug for myself
 
P

ph101

Guest
That's good to know that I'm not alone even though I don't have the beta. I find it strange that no one else has reported this, though I opened a blank project and surfaces appear to be working which doesn't help my main project.


I filed a bug for myself
Actually I tihnk you are alone because the issue mentioned by xygthop3 he said only occurs in draw gui and only in the beta (that's why i'm asking if he filed it because I would like to know if it replicatres and can be fixed for 2.2.2.full release :D)

Your issue seems to be a problem with your code in the main project? (as you say, surfaces do work in a seperate project). I'm not 100% but when you say "nothing else draws" how can you verify this? I'm not saying I can get into this and solve it for you but some things i wonder about are - why in begin draw event? What value is cam_w, what is full code for ini_value_surface because what you wrote as a cpomment isn't viable code. Just some thoughts!
 

kupo15

Member
Your issue seems to be a problem with your code in the main project? (as you say, surfaces do work in a seperate project). I'm not 100% but when you say "nothing else draws" how can you verify this?
This is in a code that draws everything, backgrounds, players etc.. Whereever I stick this code, everything above it draws, everything below it doesn't. I've stuck it elsewhere and the same thing happens. I can put together a video showing it
I'm not saying I can get into this and solve it for you but some things i wonder about are - why in begin draw event? What value is cam_w, what is full code for ini_value_surface because what you wrote as a cpomment isn't viable code. Just some thoughts!
Now that you mention it, I guess I can now change this to the draw event just because. This was handled in the Begin because its part of my background drawing code when objects drew themselves. I had the Camera draw begin for background > players draw themselves > then had the camera draw in the end draw for foreground. Now that the camera obj draws everything I can move it back to the Draw event. I doubt it'll fix it but we'll see what happens.

The value of cam_w is the width of the camera zoom. the full code for ini_shadow_surface is simply shadow_surface = surface_create(1920,1080);

I know the surface drawing code works in some fashion because if I put the draw_surface_ext code BEFORE the surface_set/reset code, it draws the blank red surface...however anything after the surface_reset still doesn't draw, not to mention I shouldn't be placing the surface code in reverse order. Its very strange. I searched the project for every instance of surface_set/reset, this is the only place its found. Maybe I should a search for surface_draw to hit all the bases


EDIT: Just got a response back from my ticket and it was confirmed this indeed is a bug that apparently the current beta version addresses. From the email I got, the reason why it works in my test project and not this one is because my textures are so big that I get an asset compile error (which I have seen during compile sometimes) but I don't in my test project. This is an additional bug that has been fixed and waiting to get rolled out

I guess I'll just have to wait until the stable version comes out to hopefully see things working.
 
Last edited:
P

ph101

Guest
EDIT: Just got a response back from my ticket and it was confirmed this indeed is a bug that apparently the current beta version addresses. From the email I got, the reason why it works in my test project and not this one is because my textures are so big that I get an asset compile error (which I have seen during compile sometimes) but I don't in my test project. This is an additional bug that has been fixed and waiting to get rolled out
Interesting ta for the info, so @xygthop3 looks like @kupo15 was having a seperate issue to yours.
 
Top