The GetSurfaceStatus() function returns the status of the current drawing surface. If the current surface exists it should return a 1 (true), 0 if it doesn't.
FACTS: * None
Mini Tutorial:
This example uses the GetSurface commands to get some basic information about the current drawing surface
; Display the info about the default surface Display_Current_Surface_info_to_Screen(50,50) ; Create a new image CreateImage 1,200,100 ; Set this new image as the Current drawing surface RenderToImage 1 Display_Current_Surface_info_to_Screen(50,200) ; Show the screen to the user and wait for a key press Sync WaitKey Function Display_Current_Surface_info_to_Screen(Xpos,Ypos) ; Get the curret drawing surface index SurfaceIndex=GetSurface() ; get the current drawing surfaces width Width=GetSurfaceWidth() ; get the current drawing surfaces Height Height=GetSurfaceHeight() ; Get the current surfaces status Status=GetSurfaceStatus() If SurfaceINdex=0 Name$="[Screen]" Else Name$="[Image]" EndIf ; Make the Screen the current drawing surface RenderToScreen ; Display the info at this position Text xpos,ypos, "Surface Name:"+name$ Text xpos,ypos+20,"====================" Text xpos,ypos+40," Surface:"+Str$(SurfaceIndex) Text xpos,ypos+60," Status:"+Str$(Status) Text xpos,ypos+80," Width:"+Str$(Width) Text xpos,ypos+100," Height:"+Str$(Height) ; Restore the original drawing surface RenderToImage SurfaceIndex EndFunction |
This example would output. Surface Name:[screen] ==================== Surface:0 Status:1 Width:800 Height:600 Surface Name:[Image] ==================== Surface:1 Status:1 Width:200 Height:100 |
|