surface_get_target


语法:

surface_get_target();


返回:

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


描述

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()).


例如:

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.