Legacy GM Drawing shapes on app surface vs other surface

I

Ian

Guest
Just practicing with surfaces and realized drawing functions on the app surface have a different resolution than those on another even though both surfaces are the same size:

App surface:


Other surface (fxaa_surf):


Code:
Code:
///Create
width = surface_get_width(application_surface);
height = surface_get_height(application_surface);
fxaa_surf = surface_create(width,height);
Code:
///Draw end
surface_set_target(fxaa_surf)
draw_clear_alpha(c_black,0);
draw_circle(xx,yy,radius,1);
surface_reset_target();

if(surface_exists(fxaa_surf))
{
    draw_surface(fxaa_surf,0,0);
}
else
{
    fxaa_surf = surface_create(width,height);
}
Can I get the same quality the app surface is giving with a surface i make? Am i doing something wrong?


EDIT------------------------------------------

Heres another example of actually being scaled (960x540 > 1920X1080):

This one is in a blank project to rule anything else out in the main project since theres a lot more going on and still has the problem.

Boths surfaces resolution are the same but fxaa_surf (bottom) looks like 960x540 even tho the surface itself is the same as the app surface
 
Last edited by a moderator:
O

orange451

Guest
Try re-setting the projection to the desired resolution.
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
That looks very much like the two surfaces are NOT the same size. Throw some show debug messages in there to see the exact size of the surfaces (or run in debug mode and in the debugger actually check the surface sizes). Also note that you should be doing it like this:

Code:
// CREATE EVENT
width = -1;
height = -1;
fxaa_surf = -1;

// DRAW EVENT
if(surface_exists(fxaa_surf))
{
surface_set_target(fxaa_surf)
draw_clear_alpha(c_black,0);
draw_circle(xx,yy,radius,1);
surface_reset_target();
draw_surface(fxaa_surf,0,0);
}
else
{
width = surface_get_width(application_surface);
height = surface_get_height(application_surface);
fxaa_surf = surface_create(width,height);
}
 
I

Ian

Guest
That looks very much like the two surfaces are NOT the same size. Throw some show debug messages in there to see the exact size of the surfaces (or run in debug mode and in the debugger actually check the surface sizes). Also note that you should be doing it like this:

Code:
// CREATE EVENT
width = -1;
height = -1;
fxaa_surf = -1;

// DRAW EVENT
if(surface_exists(fxaa_surf))
{
surface_set_target(fxaa_surf)
draw_clear_alpha(c_black,0);
draw_circle(xx,yy,radius,1);
surface_reset_target();
draw_surface(fxaa_surf,0,0);
}
else
{
width = surface_get_width(application_surface);
height = surface_get_height(application_surface);
fxaa_surf = surface_create(width,height);
}
Thnx for the tip, adjusted and still nothing but somethings definitely not right

I have both set to sync w/h but no change. Its seems like its stuck at the games base resolution which is 960x540 and its not in the draw gui event either which is 960x540


EDIT------------------------------------------

Heres another example of actually being scaled (960x540 > 1920X1080):

This one is in a blank project to rule anything else out in the main project since theres a lot more going on and still has the problem.
 
Last edited by a moderator:

Nocturne

Friendly Tyrant
Forum Staff
Admin
Okay, are you simply drawing the circle using the drw_circle function? Or are you actually targeting the app surface using surface_set_target? Just drawing shapes directly and NOT to a surface will render them at the screen resolution and NOT the game resolution....
 
I

Ian

Guest
Okay, are you simply drawing the circle using the drw_circle function? Or are you actually targeting the app surface using surface_set_target? Just drawing shapes directly and NOT to a surface will render them at the screen resolution and NOT the game resolution....
Code:
if(surface_exists(fxaa_surf))
{
    surface_set_target(fxaa_surf);
    draw_circle(x,y-40,6,1);
    surface_reset_target();
    draw_surface(fxaa_surf,0,0);
}
else
{
    width = surface_get_width(application_surface);
    height = surface_get_height(application_surface);
    fxaa_surf = surface_create(width,height);
}
Im doing that

EDIT

but it is drawing at 960x540 regardless, i put 6000x6000 as w/h and same results.
 
Top