surface_get_target


Description

With this function you can get the current surface target. If no surface is set (ie: default drawing to the application surface), then the function will return -1, otherwise it will return a positive integer which is the unique ID that identifies the surface being targeted (as returned when the surface was created using surface_create()).


Syntax:

surface_get_target();


Returns:

Integer (-1 for no surface target, or a surface ID value)


Example:

surface_get_target() != -1
    {
    surface_reset_target();
    }
draw_surface(surf, 0, 0);

The above code will check to see if the current render target is a surface or not, and if it is, it resets the target then draws a surface.