I wanted to have the txt console and the graphic console active at the same time
i noticed when closing the graphic mode using the normal screen 0 command
the txt console was cleared , it was not what i wanted , because i used the txt console to collect info
before opening the graphic mode and wanted to be able to see that info after closing the graphic mode.
so i tried to avoid the txt suppression, and after looking the .c source of fbgfx ,
i've found a flag for the function fb_GfxScreen (screen in freebasic)
SCREEN_EXIT (wich is a define to value &h80000000)
if we use that value on screen 0 , 0 , 0 , &h80000000
the previous content of txt console is preserved.....
i"ve tested it on win xp (32) win vista (32) win 10 (32/64)
hope it will help some of you
test to reproduce
Code: Select all
'test_fbgfx.bas
' compile with -s console flag to verify
#include "fbgfx.bi"
function test_fbgfx()as long
dim as string c
Screen 11 , 32 , 4
do
screenlock
' Prints "Hello World!" in the middle of the screen
Locate 15 , 14
Print "Escape key or close window to stop graphic mode"
screenunlock
Sleep 1 , 1
c = inkey
if c = chr(255) + "k" THEN exit do
Loop while c <> chr(27)
'SCREEN 0 'will erase the previous text console
SCREEN 0, 0, 0, &h80000000 'will keep the previous text console
return 1
END FUNCTION
print : Print "Before test graphic mode!" : print
test_fbgfx()
print : Print "After test graphic mode!" : print
print " Press any key to quit"
Sleep