surface_get_target

This function gets the surface that's currently set as the drawing target.

A couple of values can be returned: 

 

Syntax:

surface_get_target();

 

Returns:

Surface or -1 (if no target surface is set)

 

Example:

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

The above code checks to see if the current render target is a surface or not, resetting the drawing target if it is. The surface stored in the variable surf is then drawn.