How to blank the screen?

Blitz3D Forums/Blitz3D Programming/How to blank the screen?

martonic(Posted 2004) [#1]
Hi! I am writing a FPS game in Blitz3d using terrain, a skybox and gobs of entities. I want to add a "Pause Game" feature that switches to a black screen with text only, and then switches back after a mouse click.

However, even though I set ambientlight to 0,0,0 and all other light colors to -255,-255,-255, and called "Cls", the graphics (though dark) are still visible!

How can I make a blank screen? Is there any easy method that does not require hiding everything?


jhocking(Posted 2004) [#2]
After Cls make sure you aren't calling RenderWorld until you want the graphics to show up again. 3D graphics are rendered to the backbuffer whenever you call RenderWorld.

You shouldn't have to change anything about the lights if you Cls to erase the backbuffer and then don't call RenderWorld until you want graphics again.


martonic(Posted 2004) [#3]
Wonderful, thank you!


slenkar(Posted 2004) [#4]
whats the point? why not just stop the action instead?


jhocking(Posted 2004) [#5]
Presumably because he doesn't want the player to see what's happening while the game is paused. For a straight action game this doesn't make much difference, but for something pretty strategic this can be vital. Imagine if in Tetris you could still see everything, just frozen in place, when you pause the game.


martonic(Posted 2004) [#6]
My reason is that I am using "Pause" to re-display the instructions mid-game and it was hard to see the writing against the bright background.

I decided to stop the action, hide the skybox, and darken the scene, but not cut to a blank screen.

Thanks for your help!


Zethrax(Posted 2004) [#7]
Make sure you're using 'Flip' after 'Cls' too, so that the cleared backbuffer gets flipped to the front.