Revision history for KeyPgScreengraphics


Revision [22362]

Last edited on 2018-08-21 00:31:45 by fxm [Added note on using 'Screen 0, , , SCREEN_EXIT' (with SCREEN_EXIT=&h80000000) to close any graphics window while preserving the console window if it exists]
Additions:
__Note on using ##Screen 0##__
##Screen 0## closes any graphics window, but also clears the console window if it exists.
##Screen 0, , , SCREEN_EXIT## (with ##SCREEN_EXIT=&h80000000##) also closes any graphics window, but does not clear the console window if it exists (previous text is preserved).


Revision [22033]

Edited on 2017-12-08 14:08:53 by fxm [Corrected confusion on an existing flag to select the graphics driver]
Additions:
Are used to select several things as graphics driver priority, fullscreen mode. There are constants predefined in the ##fbgfx.bi## file ready to use. See the page [[KeyPgScreenres|Screenres]] for available flags.
Deletions:
Are used to select several things as graphics driver, fullscreen mode. There are constants predefined in the ##fbgfx.bi## file ready to use. See the page [[KeyPgScreenres|Screenres]] for available flags.


Revision [21933]

Edited on 2017-10-06 06:59:08 by fxm [Added that the text cursor is never visible on any graphics screen]
Additions:
While in windowed mode, clicking on the window close button will add a keypress of ##([[KeyPgChr|Chr]](255) & "k")## to the ##[[KeyPgInkey|Inkey]]## buffer. Clicking on the Maximize window button will switch to fullscreen mode if possible. A successful ##**Screen**## call sets currently visible and working pages both to page number ##0##, resets the palette to the specified mode one (see [[GfxDefPalettes|Default palettes]]), resets the clipping region to the size of the screen, disables custom coordinates mappings, moves the graphics cursor to the center of the screen, moves the text cursor to the top-left corner of the screen (but never visible on any graphics screen), and sets foreground and background colors to bright white and black respectively.
Deletions:
While in windowed mode, clicking on the window close button will add a keypress of ##([[KeyPgChr|Chr]](255) & "k")## to the ##[[KeyPgInkey|Inkey]]## buffer. Clicking on the Maximize window button will switch to fullscreen mode if possible. A successful ##**Screen**## call sets currently visible and working pages both to page number ##0##, resets the palette to the specified mode one (see [[GfxDefPalettes|Default palettes]]), resets the clipping region to the size of the screen, disables custom coordinates mappings, moves the graphics cursor to the center of the screen, moves the text cursor to the top-left corner of the screen and sets foreground and background colors to bright white and black respectively.


Revision [21122]

Edited on 2016-03-13 10:20:27 by fxm [Formatting]
Additions:












Revision [20504]

Edited on 2016-02-10 16:08:13 by DkLwikki [Update link format]
Additions:
##//[[CompilerOptlang|-lang fb|fblite]]// dialects:##
##//[[CompilerOptlang|-lang qb]]// dialect:##
Are used to select several things as graphics driver, fullscreen mode. There are constants predefined in the ##fbgfx.bi## file ready to use. See the page [[KeyPgScreenres|Screenres]] for available flags.
In QB-only modes a dumb window or fullscreen resolution is set, one or more buffers in standard memory are created, console commands are redirected to their graphic versions, a [[GfxDefPalettes|default palette]] is set and an automatic screen refresh thread is started. QB-like graphics and console statements can be used.
In QB-on-GUI modes one or more buffers in standard memory are created, console commands are redirected to their graphic versions and a [[GfxDefPalettes|default palette]] is set. QB-like graphics and console statements can be used. It is up to the user to create a window and to refresh it with the contents of the graphics buffers.
In ""OpenGL"" modes a dumb window or fullscreen resolution is set, one or more buffers in standard memory are created, and the OS's ""OpenGL"" library is initialized. From here only ""OpenGL"" commands can be used; QB-like and console commands are forbidden. This allows to initialize ""OpenGL"" in a portable way; you can then also use ##[[KeyPgScreencontrol|ScreenControl]]## to properly customize the GL pixel format to be used before ##**Screen**## is called or to retrieve the list of supported ""OpenGL"" extensions after a mode has been set, and ##[[KeyPgScreenglproc|ScreenGLProc]]## to obtain extension function pointers.
Any buffer that is created in standard memory uses one of three supported internal pixel formats, depending on the desired color depth; see [[GfxInternalFormats|Internal pixel formats]] for details.
If ##**Screen**## fails to set the required mode, an "Illegal function call" error is issued and the screen pointer is set to ##0##. Thus ##**Screen**## failures can be detected using standard ##[[KeyPgOnerror|On Error]]## processing or retrieving the screen pointer with ##[[KeyPgScreenptr|Screenptr]]##.
Before setting a fullscreen mode the program should check if that mode is available in the graphics card using ##[[KeyPgScreenlist|Screenlist]]##.
You can request any number of pages for any video mode; if you omit the parameter, only the visible page (number ##0##) will be available. A page is either the visible screen or an offscreen buffer, you can show a page while working on another one; see the ##[[KeyPgScreenset|Screenset]]## statement for details. All pages are created in standard memory, the video card memory is never used for video buffering.
(documented at the page [[KeyPgScreenres|Screenres]])
While in windowed mode, clicking on the window close button will add a keypress of ##([[KeyPgChr|Chr]](255) & "k")## to the ##[[KeyPgInkey|Inkey]]## buffer. Clicking on the Maximize window button will switch to fullscreen mode if possible. A successful ##**Screen**## call sets currently visible and working pages both to page number ##0##, resets the palette to the specified mode one (see [[GfxDefPalettes|Default palettes]]), resets the clipping region to the size of the screen, disables custom coordinates mappings, moves the graphics cursor to the center of the screen, moves the text cursor to the top-left corner of the screen and sets foreground and background colors to bright white and black respectively.
- In DOS, Windowing and ""OpenGL"" related switches are not available, and other issues, see [[GfxLib|GfxLib overview]]
- In the //[[CompilerOptlang|-lang fb]]// and //[[CompilerOptlang|-lang fblite]]// dialects, the usage is:
- In the //[[CompilerOptlang|-lang qb]]// dialect, the usage is:
- None in the //[[CompilerOptlang|-lang qb]]// dialect.
- In QB the syntax was ##**Screen** //mode//,//colormode//,//active_page//,//visible_page//##. Of those parameters ""FreeBASIC"" supports only //mode// and redefines the rest. The use of ##**Screen** , , apage,vpage## to swap screen pages is only available in the //[[CompilerOptlang|-lang qb]]// dialect.
- ##[[KeyPgScreenset|Screenset]]## should be used in the //[[CompilerOptlang|-lang fb]]// and //[[CompilerOptlang|-lang fblite]]// dialects.
- ##[[KeyPgScreenCons|Screen (Console)]]##
- ##[[KeyPgScreenres|Screenres]]## More flexible alternative to ##**Screen**##
- ##[[KeyPgScreenlist|Screenlist]]## Check display modes available for FB ""GfxLib"" to use
- ##[[KeyPgScreencontrol|Screencontrol]]## Select driver and more
- ##[[KeyPgScreenlock|Screenlock]]##
- ##[[KeyPgScreenunlock|Screenunlock]]##
- ##[[KeyPgScreenptr|Screenptr]]## Semi-low level access
- ##[[KeyPgScreenset|Screenset]]##
- ##[[KeyPgScreencopy|Screencopy]]##
- ##[[KeyPgScreeninfo|Screeninfo]]##
- ##[[KeyPgScreenglproc|Screenglproc]]##
- ##[[GfxInternalFormats|Internal pixel formats]]##
Deletions:
##//[[CompilerOptlang -lang fb|fblite]]// dialects:##
##//[[CompilerOptlang -lang qb]]// dialect:##
Are used to select several things as graphics driver, fullscreen mode. There are constants predefined in the ##fbgfx.bi## file ready to use. See the page [[KeyPgScreenres Screenres]] for available flags.
In QB-only modes a dumb window or fullscreen resolution is set, one or more buffers in standard memory are created, console commands are redirected to their graphic versions, a [[GfxDefPalettes default palette]] is set and an automatic screen refresh thread is started. QB-like graphics and console statements can be used.
In QB-on-GUI modes one or more buffers in standard memory are created, console commands are redirected to their graphic versions and a [[GfxDefPalettes default palette]] is set. QB-like graphics and console statements can be used. It is up to the user to create a window and to refresh it with the contents of the graphics buffers.
In ""OpenGL"" modes a dumb window or fullscreen resolution is set, one or more buffers in standard memory are created, and the OS's ""OpenGL"" library is initialized. From here only ""OpenGL"" commands can be used; QB-like and console commands are forbidden. This allows to initialize ""OpenGL"" in a portable way; you can then also use ##[[KeyPgScreencontrol ScreenControl]]## to properly customize the GL pixel format to be used before ##**Screen**## is called or to retrieve the list of supported ""OpenGL"" extensions after a mode has been set, and ##[[KeyPgScreenglproc ScreenGLProc]]## to obtain extension function pointers.
Any buffer that is created in standard memory uses one of three supported internal pixel formats, depending on the desired color depth; see [[GfxInternalFormats Internal pixel formats]] for details.
If ##**Screen**## fails to set the required mode, an "Illegal function call" error is issued and the screen pointer is set to ##0##. Thus ##**Screen**## failures can be detected using standard ##[[KeyPgOnerror On Error]]## processing or retrieving the screen pointer with ##[[KeyPgScreenptr Screenptr]]##.
Before setting a fullscreen mode the program should check if that mode is available in the graphics card using ##[[KeyPgScreenlist Screenlist]]##.
You can request any number of pages for any video mode; if you omit the parameter, only the visible page (number ##0##) will be available. A page is either the visible screen or an offscreen buffer, you can show a page while working on another one; see the ##[[KeyPgScreenset Screenset]]## statement for details. All pages are created in standard memory, the video card memory is never used for video buffering.
(documented at the page [[KeyPgScreenres Screenres]])
While in windowed mode, clicking on the window close button will add a keypress of ##([[KeyPgChr Chr]](255) & "k")## to the ##[[KeyPgInkey Inkey]]## buffer. Clicking on the Maximize window button will switch to fullscreen mode if possible. A successful ##**Screen**## call sets currently visible and working pages both to page number ##0##, resets the palette to the specified mode one (see [[GfxDefPalettes Default palettes]]), resets the clipping region to the size of the screen, disables custom coordinates mappings, moves the graphics cursor to the center of the screen, moves the text cursor to the top-left corner of the screen and sets foreground and background colors to bright white and black respectively.
- In DOS, Windowing and ""OpenGL"" related switches are not available, and other issues, see [[GfxLib GfxLib overview]]
- In the //[[CompilerOptlang -lang fb]]// and //[[CompilerOptlang -lang fblite]]// dialects, the usage is:
- In the //[[CompilerOptlang -lang qb]]// dialect, the usage is:
- None in the //[[CompilerOptlang -lang qb]]// dialect.
- In QB the syntax was ##**Screen** //mode//,//colormode//,//active_page//,//visible_page//##. Of those parameters ""FreeBASIC"" supports only //mode// and redefines the rest. The use of ##**Screen** , , apage,vpage## to swap screen pages is only available in the //[[CompilerOptlang -lang qb]]// dialect.
- ##[[KeyPgScreenset Screenset]]## should be used in the //[[CompilerOptlang -lang fb]]// and //[[CompilerOptlang -lang fblite]]// dialects.
- ##[[KeyPgScreenCons Screen (Console)]]##
- ##[[KeyPgScreenres Screenres]]## More flexible alternative to ##**Screen**##
- ##[[KeyPgScreenlist Screenlist]]## Check display modes available for FB ""GfxLib"" to use
- ##[[KeyPgScreencontrol Screencontrol]]## Select driver and more
- ##[[KeyPgScreenlock Screenlock]]##
- ##[[KeyPgScreenunlock Screenunlock]]##
- ##[[KeyPgScreenptr Screenptr]]## Semi-low level access
- ##[[KeyPgScreenset Screenset]]##
- ##[[KeyPgScreencopy Screencopy]]##
- ##[[KeyPgScreeninfo Screeninfo]]##
- ##[[KeyPgScreenglproc Screenglproc]]##
- ##[[GfxInternalFormats Internal pixel formats]]##


Revision [17027]

Edited on 2014-03-30 03:05:35 by DoS386 [move from SCREEN to SCREENRES]
Additions:
Are used to select several things as graphics driver, fullscreen mode. There are constants predefined in the ##fbgfx.bi## file ready to use. See the page [[KeyPgScreenres Screenres]] for available flags.
In QB-on-GUI modes one or more buffers in standard memory are created, console commands are redirected to their graphic versions and a [[GfxDefPalettes default palette]] is set. QB-like graphics and console statements can be used. It is up to the user to create a window and to refresh it with the contents of the graphics buffers.
You can request any number of pages for any video mode; if you omit the parameter, only the visible page (number ##0##) will be available. A page is either the visible screen or an offscreen buffer, you can show a page while working on another one; see the ##[[KeyPgScreenset Screenset]]## statement for details. All pages are created in standard memory, the video card memory is never used for video buffering.
(documented at the page [[KeyPgScreenres Screenres]])
- In DOS, Windowing and ""OpenGL"" related switches are not available, and other issues, see [[GfxLib GfxLib overview]]
or:
- In QB the syntax was ##**Screen** //mode//,//colormode//,//active_page//,//visible_page//##. Of those parameters ""FreeBASIC"" supports only //mode// and redefines the rest. The use of ##**Screen** , , apage,vpage## to swap screen pages is only available in the //[[CompilerOptlang -lang qb]]// dialect.
Deletions:
Are used to select several things as graphics driver, fullscreen mode. There are constants predefined in the ##fbgfx.bi## file ready to use. See below for available flags.
In QB-on-GUI modes one or more buffers in standard memory are created, console commands are redirected to their graphic versions and a [[GfxDefPalettes default palette]] is set. QB-like graphics and console statements can be used. It is up to the user to create a window and to refresh it with the contents of the graphics buffers.
You can request any number of pages for any video mode; if you omit the parameter, only the visible page (number ##0##) will be available. A page is either the visible screen or an offscreen buffer, you can show a page while working on another one; see the ##[[KeyPgScreenset Screenset]]## statement for details. All pages are created in standard memory, the video card memory is never used for video buffering.
~If flags are omitted, ""FreeBASIC"" uses QB-compatible graphics in windowed (except in DOS) mode. These constants are defined in ##fbgfx.bi##. In the //[[CompilerOptlang -lang fb]]// dialect, these constants are part of the ##FB## ##[[KeyPgNamespace Namespace]]##. Note that most of the flags are not supported in DOS.
~Available flags:
~__graphic mode flags__
~~-##GFX_NULL##: Starts a QB-on-GUI graphics mode. It creates a graphics buffer but not a window. User must implement the window, the events manager and refresh the screen as needed. This mode allows to mix ""FreeBASIC"" drawing functions with API-driven windows. This flag overrides all other mode flags. See an [[SrcPgGfxNull Example of GFX_NULL]] in Windows.
~~-##GFX_OPENGL##: Initializes ""OpenGL"" to draw in a dumb window. ""FreeBASIC"" graphic functions can't be used. The screen is not automatically updated, ##[[KeyPgFlip Flip]]## must be used. This option provides a portable way to initialize the ""OpenGL"" Library.
~~-If none of the above options is specified, ""FreeBASIC"" enters the QB-only graphics mode: it creates a buffer and a dumb window and sets a thread that automatically updates the screen and manages keyboard and mouse. The ""FreeBASIC"" drawing functions can be used.
~__window mode flags__
~~Window mode flags are meaningless if ##GFX_NULL## mode is used
~~-##GFX_WINDOWED##: If windowed mode is supported, ""FreeBASIC"" opens a window of the requested size in the present desktop
~~-##GFX_FULLSCREEN##: The graphics card switch mode is switched to the requested mode and color depth and OS fullscreen mode is used. If the mode is not available in the present card ""FreeBASIC"" switches to windowed mode.
~~-If ##GFX_FULLSCREEN## is not specified, the behavior for ##GFX_WINDOWED## is assumed.
~~-##GFX_NO_SWITCH##: Prevents the user from changing to fullscreen or to windowed mode by pressing Alt-Enter.
~~-##GFX_NO_FRAME##: Creates a window without a border.
~~-##GFX_SHAPED_WINDOW##: Creates transparent regions wherever RGBA(255, 0, 255, 0) is drawn on the screen.
~~-##GFX_ALWAYS_ON_TOP##: Creates a window that stays always on top.
~__option flags__
~~Flags working in any mode, they activate special behaviors
~~-##GFX_ALPHA_PRIMITIVES##: Tells the graphics library to enable alpha channel support for all drawing primitives. This means the alpha specified in a color value (via either the ##[[KeyPgRgba RGBA]]## macro or direct color in the form ##&h//AARRGGBB//##) will always be used by all primitives.
~~-##GFX_HIGH_PRIORITY##: Tells the graphics library to enable a higher priority for graphics processing. Only has an effect on ##gdi## and ##""DirectX""## drivers on ""Win32"" platform.
~__OpenGL Buffer flags__
~~These flags work only in ""OpenGL"" graphics mode, must be combined with GFX_OPENGL
~~-##GFX_STENCIL_BUFFER##: Forces ""OpenGL"" to use Stencil buffer
~~-##GFX_ACCUMULATION_BUFFER##: Forces ""OpenGL"" to use Accumulation buffer
~~-##GFX_MULTISAMPLE##: Requests fullscreen anti-aliasing through the ARB_multisample extension
Depending on whether the ##GFX_FULLSCREEN## parameter is present or not, ##**Screen**## will try to set the specified video mode in fullscreen or windowed mode, respectively. If fullscreen mode is set and the system cannot set specified mode in fullscreen, it will try in windowed mode. If windowed mode is set and the system fails to open a window for specified mode, it will try fullscreen. If everything fails, ##**Screen**## will have no effect and execution will resume from the statement following the ##**Screen**## call. You should take care of checking if a graphics mode has been set or not, and behave accordingly; a way to check if ##**Screen**## is successful is to test the return value of the ##[[KeyPgScreenptr Screenptr]]## function; see its page for details.
__Graphics mode console__
Console commands (##[[KeyPgLocate Locate]]##, ##[[KeyPgPrint Print]]##), input can be used both with standard QB ##**Screen**## modes and with the extended ones too, provided the standard color depth is not modified by using the second argument of ##**Screen**##. Where the table says more than one text resolution is available for the text mode, the required text resolution can be requested by using ##[[KeyPgWidth Width]]##. Any characters ##[[KeyPgPrint Print]]##ed will erase the background around them; it does not use a transparent background.
- In DOS, Windowing and ""OpenGL"" related switches are not available, see also [[GfxLib GfxLib overview]]
or:
- In QB the syntax was ##**Screen** //mode//,//colormode//,//active_page//,//visible_page//##. Of those parameters ""FreeBASIC"" supports only //mode// and redefines the rest. The use of ##**Screen** ,, apage,vpage## to swap screen pages is only available in the //[[CompilerOptlang -lang qb]]// dialect.


Revision [16999]

Edited on 2014-01-18 07:05:05 by DkLwikki [typo]
Additions:
~~-##GFX_NULL##: Starts a QB-on-GUI graphics mode. It creates a graphics buffer but not a window. User must implement the window, the events manager and refresh the screen as needed. This mode allows to mix ""FreeBASIC"" drawing functions with API-driven windows. This flag overrides all other mode flags. See an [[SrcPgGfxNull Example of GFX_NULL]] in Windows.
Deletions:
~~-##GFX_NULL##: Starts a QB-on-GUI graphics mode. It creates a graphics buffer but not a window. User must implement the window, the events manager and and refresh screen as needed. This mode allows to mix ""FreeBASIC"" drawing functions with API-driven windows. This flag overrides all other mode flags. See an [[SrcPgGfxNull Example of GFX_NULL]] in Windows.


Revision [16896]

Edited on 2013-07-26 09:54:32 by CountingPine [Other details: Link to GfxDefPalettes; reformat Close keypress string]
Additions:
While in windowed mode, clicking on the window close button will add a keypress of ##([[KeyPgChr Chr]](255) & "k")## to the ##[[KeyPgInkey Inkey]]## buffer. Clicking on the Maximize window button will switch to fullscreen mode if possible. A successful ##**Screen**## call sets currently visible and working pages both to page number ##0##, resets the palette to the specified mode one (see [[GfxDefPalettes Default palettes]]), resets the clipping region to the size of the screen, disables custom coordinates mappings, moves the graphics cursor to the center of the screen, moves the text cursor to the top-left corner of the screen and sets foreground and background colors to bright white and black respectively.
Deletions:
While in windowed mode, clicking on the window close button will add a keypress of ##[[KeyPgChr Chr]](255)&"k"## to the ##[[KeyPgInkey Inkey]]## buffer. Clicking on the Maximize window button will switch to fullscreen mode if possible. A successful ##**Screen**## call sets currently visible and working pages both to page number ##0##, resets the palette to the specified mode one (see Default palettes), resets the clipping region to the size of the screen, disables custom coordinates mappings, moves the graphics cursor to the center of the screen, moves the text cursor to the top-left corner of the screen and sets foreground and background colors to bright white and black respectively.


Revision [16214]

Edited on 2012-06-27 11:57:33 by CountingPine [Neaten]
Additions:
##**Screen** //mode// [, [//depth//] [, [//num_pages//] [, [//flags//] [, [//refresh_rate//]]]]]##
or:
##**Screen** , [//active_page//] [, [//visible_page//]]]##
##**Screen** [//mode//] [, [colormode] [, [//active_page//] [, [//visible_page//]]]]##
- In QB the syntax was ##**Screen** //mode//,//colormode//,//active_page//,//visible_page//##. Of those parameters ""FreeBASIC"" supports only //mode// and redefines the rest. The use of ##**Screen** ,, apage,vpage## to swap screen pages is only available in the //[[CompilerOptlang -lang qb]]// dialect.
Deletions:
##**Screen** //mode// [, [ //depth// ] [, [ //num_pages// ] [, [ //flags// ] [, [ //refresh_rate// ]]]]]## or ##**Screen** , [//active_page//][,[//visible_page//]]]##
##**Screen** [//mode//] [, [colormode] [,[//active_page//][,[//visible_page//]]]]##
- In QB the syntax was ##**Screen** //mode//,//colormode//,//active_page//,//visible_page//##. Of those parameters ""FreeBASIC"" supports only //mode// and redefines the rest. The use of ##**Screen** ,,apage,vpage## to swap screen pages is only available in the //[[CompilerOptlang -lang qb]]// dialect.


Revision [16213]

Edited on 2012-06-27 11:52:53 by CountingPine [Fix syntax]
Additions:
**Screen** , [ //active_page// ] [, [ //visible_page// ]]
##**Screen** [//mode//] [, [colormode] [,[//active_page//][,[//visible_page//]]]]##
Deletions:
**Screen** , [, [ //active_page// ] [, [ //visible_page// ]]]
##**Screen** [//mode//] [, [[colormode]] [,[//active_page//][,[//visible_page//]]]]##


Revision [16211]

Edited on 2012-06-27 11:02:23 by CountingPine [Fix syntax]
Additions:
##//colormode//##
Deletions:
##//color_mode//##


Revision [16210]

Edited on 2012-06-27 11:01:44 by CountingPine [mention syntaxes for page-switching]
Additions:
##//[[CompilerOptlang -lang fb|fblite]]// dialects:##
**Screen** //mode// [, [ //depth// ] [, [ //num_pages// ] [, [ //flags// ] [, [ //refresh_rate// ]]]]]
**Screen** , [, [ //active_page// ] [, [ //visible_page// ]]]
##//[[CompilerOptlang -lang qb]]// dialect:##
**Screen** [ //mode// ] [, [ //colormode// ] [, [ //active_page// ] [, [ //visible_page// ]]]]
##//active_page//##
Used to set the active page, where printing/drawing commands take effect
##//visible_page//##
Used to set the visible page, which is shown to the user
##//color_mode//##
Unused - allowed for compatibility with the QB syntax
##**Screen** //mode// [, [ //depth// ] [, [ //num_pages// ] [, [ //flags// ] [, [ //refresh_rate// ]]]]]## or ##**Screen** , [//active_page//][,[//visible_page//]]]##
##**Screen** [//mode//] [, [[colormode]] [,[//active_page//][,[//visible_page//]]]]##
Deletions:
**Screen** //mode// [, [ //depth// ] [, [ //num_pages// ] [, [ //flags// ] [, [ //refresh_rate// ]]]]]
##**Screen** //mode// [, [ //depth// ] [, [ //num_pages// ] [, [ //flags// ] [, [ //refresh_rate// ]]]]]##
##**Screen** [//mode//] [,[//active_page//][,[//visible_page//]]]##


Revision [15956]

Edited on 2012-02-02 12:05:09 by CountingPine [Formatting]
Additions:
In ""OpenGL"" modes a dumb window or fullscreen resolution is set, one or more buffers in standard memory are created, and the OS's ""OpenGL"" library is initialized. From here only ""OpenGL"" commands can be used; QB-like and console commands are forbidden. This allows to initialize ""OpenGL"" in a portable way; you can then also use ##[[KeyPgScreencontrol ScreenControl]]## to properly customize the GL pixel format to be used before ##**Screen**## is called or to retrieve the list of supported ""OpenGL"" extensions after a mode has been set, and ##[[KeyPgScreenglproc ScreenGLProc]]## to obtain extension function pointers.
~~-##GFX_ALPHA_PRIMITIVES##: Tells the graphics library to enable alpha channel support for all drawing primitives. This means the alpha specified in a color value (via either the ##[[KeyPgRgba RGBA]]## macro or direct color in the form ##&h//AARRGGBB//##) will always be used by all primitives.
Deletions:
In ""OpenGL"" modes a dumb window or fullscreen resolution is set, one or more buffers in standard memory are created, and the OS's ""OpenGL"" library is initialized. From here only ""OpenGL"" commands can be used; QB-like and console commands are forbidden. This allows to initialize ""OpenGL"" in a portable way; you can then also use [[KeyPgScreencontrol ScreenControl]] to properly customize the GL pixel format to be used before ##**Screen**## is called or to retrieve the list of supported ""OpenGL"" extensions after a mode has been set, and [[KeyPgScreenglproc ScreenGLProc]] to obtain extension function pointers.
~~-##GFX_ALPHA_PRIMITIVES##: Tells the graphics library to enable alpha channel support for all drawing primitives. This means the alpha specified in a color value (via either the ##[[KeyPgRgba RGBA]]## macro or direct color in the form ##&hAARRGGBB##) will always be used by all primitives.


Revision [15654]

Edited on 2012-01-14 13:10:44 by FxMwikki ['Screen 8' text size: 40x25 -> 80x25]
Additions:
{{table columns="6" cellpadding="1" cells="Mode nr;Resolution;Emulation;Text;char size;colors on screen;1;320x200;CGA ;40X25;8x8;16 background, 1 of four sets foreground;2;640x200;CGA;80x25;8x8;16 colors to 2 attributes;7;320x200;EGA;40x25;8x8;16 colors to 16 attributes;8;640x200;EGA;80x25;8x8;16 colors to 16 attributes;9;640x350;EGA;80x25 0r 80x43;8x14 or 8x8;16 colors to 16 attributes;11;640x480;VGA;80x30 or 80x60;8x16 or 8x8;256K colors to 2 attributes;12;640x480;VGA;80x30 or 80x60;8x16 or 8x8;256K colors to 16 attributes;13;320x200;MCGA;40X25;8X8;256K colors to 256 attributes"}}
Deletions:
{{table columns="6" cellpadding="1" cells="Mode nr;Resolution;Emulation;Text;char size;colors on screen;1;320x200;CGA ;40X25;8x8;16 background, 1 of four sets foreground;2;640x200;CGA;80x25;8x8;16 colors to 2 attributes;7;320x200;EGA;40x25;8x8;16 colors to 16 attributes;8;640x200;EGA;40x25;8x8;16 colors to 16 attributes;9;640x350;EGA;80x25 0r 80x43;8x14 or 8x8;16 colors to 16 attributes;11;640x480;VGA;80x30 or 80x60;8x16 or 8x8;256K colors to 2 attributes;12;640x480;VGA;80x30 or 80x60;8x16 or 8x8;256K colors to 16 attributes;13;320x200;MCGA;40X25;8X8;256K colors to 256 attributes"}}


Revision [15622]

Edited on 2012-01-11 10:54:12 by CountingPine [Formatting]
Additions:
~~-##GFX_ALPHA_PRIMITIVES##: Tells the graphics library to enable alpha channel support for all drawing primitives. This means the alpha specified in a color value (via either the ##[[KeyPgRgba RGBA]]## macro or direct color in the form ##&hAARRGGBB##) will always be used by all primitives.
~~-##GFX_HIGH_PRIORITY##: Tells the graphics library to enable a higher priority for graphics processing. Only has an effect on ##gdi## and ##""DirectX""## drivers on ""Win32"" platform.
Depending on whether the ##GFX_FULLSCREEN## parameter is present or not, ##**Screen**## will try to set the specified video mode in fullscreen or windowed mode, respectively. If fullscreen mode is set and the system cannot set specified mode in fullscreen, it will try in windowed mode. If windowed mode is set and the system fails to open a window for specified mode, it will try fullscreen. If everything fails, ##**Screen**## will have no effect and execution will resume from the statement following the ##**Screen**## call. You should take care of checking if a graphics mode has been set or not, and behave accordingly; a way to check if ##**Screen**## is successful is to test the return value of the ##[[KeyPgScreenptr Screenptr]]## function; see its page for details.
Deletions:
~~-##GFX_ALPHA_PRIMITIVES##: Tells the graphics library to enable alpha channel support for all drawing primitives. This means the alpha specified in a color value (via either the [[KeyPgRgba RGBA]] macro or direct color in the form &hAARRGGBB) will always be used by all primitives.
~~-##GFX_HIGH_PRIORITY##: Tells the graphics library to enable a higher priority for graphics processing. Only has an effect on ##gdi## and ##DirectX## drivers on Win32 platform.
Depending on whether the ##GFX_FULLSCREEN## parameter is present or not, ##**Screen**## will try to set the specified video mode in fullscreen or windowed mode, respectively. If fullscreen mode is set and the system cannot set specified mode in fullscreen, it'll try in windowed mode. If windowed mode is set and the system fails to open a window for specified mode, it will try fullscreen. If everything fails, ##**Screen**## will have no effect and execution will resume from the statement following the ##**Screen**## call. You should take care of checking if a graphics mode has been set or not, and behave accordingly; a way to check if ##**Screen**## is successful is to test the return value of the ##[[KeyPgScreenptr Screenptr]]## function; see its page for details.


Revision [15621]

Edited on 2012-01-11 10:52:07 by CountingPine [Remove CamelCase OpenGL links; fix sentence]
Additions:
##**Screen**## tells the compiler to link the [[GfxLib]] and initializes a QB-only, QB-on-GUI or [[OpenGL]] graphics mode, depending on the ##//flags//## setting.
In ""OpenGL"" modes a dumb window or fullscreen resolution is set, one or more buffers in standard memory are created, and the OS's ""OpenGL"" library is initialized. From here only ""OpenGL"" commands can be used; QB-like and console commands are forbidden. This allows to initialize ""OpenGL"" in a portable way; you can then also use [[KeyPgScreencontrol ScreenControl]] to properly customize the GL pixel format to be used before ##**Screen**## is called or to retrieve the list of supported ""OpenGL"" extensions after a mode has been set, and [[KeyPgScreenglproc ScreenGLProc]] to obtain extension function pointers.
~~-##GFX_OPENGL##: Initializes ""OpenGL"" to draw in a dumb window. ""FreeBASIC"" graphic functions can't be used. The screen is not automatically updated, ##[[KeyPgFlip Flip]]## must be used. This option provides a portable way to initialize the ""OpenGL"" Library.
~~These flags work only in ""OpenGL"" graphics mode, must be combined with GFX_OPENGL
~~-##GFX_STENCIL_BUFFER##: Forces ""OpenGL"" to use Stencil buffer
~~-##GFX_ACCUMULATION_BUFFER##: Forces ""OpenGL"" to use Accumulation buffer
- In DOS, Windowing and ""OpenGL"" related switches are not available, see also [[GfxLib GfxLib overview]]
Deletions:
##**Screen**## tells the compiler to link the GfxLib and initializes a QB-only, QB-on-GUI or OpenGL graphics mode, depending on the ##//flags//## setting.
In OpenGL modes a dumb window or fullscreen resolution is set, one or more buffers in standard memory are created, and the OS's OpenGL library is initialized. From here OpenGL only OpenGL commands can be used; QB-like and console commands are forbidden. This allows to initialize OpenGL in a portable way; you can then also use [[KeyPgScreencontrol ScreenControl]] to properly customize the GL pixel format to be used before ##**Screen**## is called or to retrieve the list of supported OpenGL extensions after a mode has been set, and [[KeyPgScreenglproc ScreenGLProc]] to obtain extension function pointers.
~~-##GFX_OPENGL##: Initializes OpenGL to draw in a dumb window. ""FreeBASIC"" graphic functions can't be used. The screen is not automatically updated, ##[[KeyPgFlip Flip]]## must be used. This option provides a portable way to initialize the OpenGL Library.
~~These flags work only in OpenGL graphics mode, must be combined with GFX_OPENGL
~~-##GFX_STENCIL_BUFFER##: Forces OpenGL to use Stencil buffer
~~-##GFX_ACCUMULATION_BUFFER##: Forces OpenGL to use Accumulation buffer
- In DOS, Windowing and OpenGL related switches are not available, see also [[GfxLib GfxLib overview]]


Revision [14549]

Edited on 2010-01-08 22:12:45 by DoS386 [updated, outsourced stuff to "GfxLib" "mide" bug [2]]
Additions:
Depending on whether the ##GFX_FULLSCREEN## parameter is present or not, ##**Screen**## will try to set the specified video mode in fullscreen or windowed mode, respectively. If fullscreen mode is set and the system cannot set specified mode in fullscreen, it'll try in windowed mode. If windowed mode is set and the system fails to open a window for specified mode, it will try fullscreen. If everything fails, ##**Screen**## will have no effect and execution will resume from the statement following the ##**Screen**## call. You should take care of checking if a graphics mode has been set or not, and behave accordingly; a way to check if ##**Screen**## is successful is to test the return value of the ##[[KeyPgScreenptr Screenptr]]## function; see its page for details.
- In DOS, Windowing and OpenGL related switches are not available, see also [[GfxLib GfxLib overview]]
Deletions:
Depending on whether the ##GFX_FULLSCREEN## parameter is present or not, ##**Screen**## will try to set the specified video mode in fullscreen or windowed mode, respectively. If fullscreen mode is set and the system cannot set specified mode in fullscreen, it'll try in windowed mode. If windowed mide is set and the system fails to open a window for specified mode, it will try fullscreen. If everything fails, ##**Screen**## will have no effect and execution will resume from the statement following the ##**Screen**## call. You should take care of checking if a graphics mode has been set or not, and behave accordingly; a way to check if ##**Screen**## is successful is to test the return value of the ##[[KeyPgScreenptr Screenptr]]## function; see its page for details.
- In DOS, Windowing and OpenGL related switches are not available, see also [[GfxLib ""GfxLib"" overview]]


Revision [14548]

Edited on 2010-01-08 22:11:29 by DoS386 [updated, outsourced stuff to "GfxLib"]
Additions:
- In DOS, Windowing and OpenGL related switches are not available, see also [[GfxLib ""GfxLib"" overview]]
- ##[[KeyPgScreenlist Screenlist]]## Check display modes available for FB ""GfxLib"" to use
- ##[[KeyPgScreencontrol Screencontrol]]## Select driver and more
Deletions:
- In DOS, linear framebuffer or banked VESA VBE modes are used whenever possible; if not available, drivers for the standard VGA modes or a 320*240*8 ""ModeX"" driver are used if possible. Windowing and OpenGL related switches are not available.
- ##[[KeyPgScreenlist Screenlist]]## List display modes available for FB to use
- ##[[KeyPgScreencontrol Screencontrol]]##


Revision [13673]

Edited on 2008-09-01 19:11:32 by CountingPine [Mention FB namespace; misc edits]
Additions:
Screen 18, 32, 4, (GFX_WINDOWED or GFX_NO_SWITCH)
Deletions:
Screen 18, 32, 4, (GFX_WINDOWED or GFX_NOSWITCH)


Revision [13670]

Edited on 2008-09-01 18:51:23 by CountingPine [Mention FB namespace; misc edits]
Additions:
is a QB style graphics screen mode number (see below). If ##//mode//## is ##0##, then any currently set graphics mode is closed, and all functions resume their normal console-mode functionality. See below for available modes.
is the color depth in bits per pixel. This only has an effect for modes ##14## and higher. Values of ##8##, ##16## and ##32## are allowed. ##15## and ##24## are also allowed as aliases for ##16## and ##32##, respectively. If omitted, it defaults to ##8##.
is the number of video pages you want, see below. If omitted, it defaults to ##1##.
Are used to select several things as graphics driver, fullscreen mode. There are constants predefined in the ##fbgfx.bi## file ready to use. See below for available flags.
requests a refresh rate. If it is not available in the present card or the parameter is omitted, ""FreeBASIC"" chooses the rate automatically.
In QB-on-GUI modes one or more buffers in standard memory are created, console commands are redirected to their graphic versions and a [[GfxDefPalettes default palette]] is set. QB-like graphics and console statements can be used. It is up to the user to create a window and to refresh it with the contents of the graphics buffers.
If ##**Screen**## fails to set the required mode, an "Illegal function call" error is issued and the screen pointer is set to ##0##. Thus ##**Screen**## failures can be detected using standard ##[[KeyPgOnerror On Error]]## processing or retrieving the screen pointer with ##[[KeyPgScreenptr Screenptr]]##.
New ""FreeBASIC"" modes:
For modes ##14## and up, the depth parameter changes the color depth to the specified new one; if depth is not specified, these modes run in 8bpp. For modes ##13## and below, ##//depth//## has no effect.
You can request any number of pages for any video mode; if you omit the parameter, only the visible page (number ##0##) will be available. A page is either the visible screen or an offscreen buffer, you can show a page while working on another one; see the ##[[KeyPgScreenset Screenset]]## statement for details. All pages are created in standard memory, the video card memory is never used for video buffering.
~If flags are omitted, ""FreeBASIC"" uses QB-compatible graphics in windowed (except in DOS) mode. These constants are defined in ##fbgfx.bi##. In the //[[CompilerOptlang -lang fb]]// dialect, these constants are part of the ##FB## ##[[KeyPgNamespace Namespace]]##. Note that most of the flags are not supported in DOS.
~~-##GFX_NULL##: Starts a QB-on-GUI graphics mode. It creates a graphics buffer but not a window. User must implement the window, the events manager and and refresh screen as needed. This mode allows to mix ""FreeBASIC"" drawing functions with API-driven windows. This flag overrides all other mode flags. See an [[SrcPgGfxNull Example of GFX_NULL]] in Windows.
~~-##GFX_OPENGL##: Initializes OpenGL to draw in a dumb window. ""FreeBASIC"" graphic functions can't be used. The screen is not automatically updated, ##[[KeyPgFlip Flip]]## must be used. This option provides a portable way to initialize the OpenGL Library.
~~-If none of the above options is specified, ""FreeBASIC"" enters the QB-only graphics mode: it creates a buffer and a dumb window and sets a thread that automatically updates the screen and manages keyboard and mouse. The ""FreeBASIC"" drawing functions can be used.
~~Window mode flags are meaningless if ##GFX_NULL## mode is used
~~-##GFX_WINDOWED##: If windowed mode is supported, ""FreeBASIC"" opens a window of the requested size in the present desktop
~~-##GFX_FULLSCREEN##: The graphics card switch mode is switched to the requested mode and color depth and OS fullscreen mode is used. If the mode is not available in the present card ""FreeBASIC"" switches to windowed mode.
~~-If ##GFX_FULLSCREEN## is not specified, the behavior for ##GFX_WINDOWED## is assumed.
~~-##GFX_NO_SWITCH##: Prevents the user from changing to fullscreen or to windowed mode by pressing Alt-Enter.
~~-##GFX_NO_FRAME##: Creates a window without a border.
~~-##GFX_SHAPED_WINDOW##: Creates transparent regions wherever RGBA(255, 0, 255, 0) is drawn on the screen.
~~-##GFX_ALWAYS_ON_TOP##: Creates a window that stays always on top.
~~-##GFX_ALPHA_PRIMITIVES##: Tells the graphics library to enable alpha channel support for all drawing primitives. This means the alpha specified in a color value (via either the [[KeyPgRgba RGBA]] macro or direct color in the form &hAARRGGBB) will always be used by all primitives.
~~-##GFX_HIGH_PRIORITY##: Tells the graphics library to enable a higher priority for graphics processing. Only has an effect on ##gdi## and ##DirectX## drivers on Win32 platform.
~~-##GFX_STENCIL_BUFFER##: Forces OpenGL to use Stencil buffer
~~-##GFX_ACCUMULATION_BUFFER##: Forces OpenGL to use Accumulation buffer
~~-##GFX_MULTISAMPLE##: Requests fullscreen anti-aliasing through the ARB_multisample extension
Depending on whether the ##GFX_FULLSCREEN## parameter is present or not, ##**Screen**## will try to set the specified video mode in fullscreen or windowed mode, respectively. If fullscreen mode is set and the system cannot set specified mode in fullscreen, it'll try in windowed mode. If windowed mide is set and the system fails to open a window for specified mode, it will try fullscreen. If everything fails, ##**Screen**## will have no effect and execution will resume from the statement following the ##**Screen**## call. You should take care of checking if a graphics mode has been set or not, and behave accordingly; a way to check if ##**Screen**## is successful is to test the return value of the ##[[KeyPgScreenptr Screenptr]]## function; see its page for details.
Console commands (##[[KeyPgLocate Locate]]##, ##[[KeyPgPrint Print]]##), input can be used both with standard QB ##**Screen**## modes and with the extended ones too, provided the standard color depth is not modified by using the second argument of ##**Screen**##. Where the table says more than one text resolution is available for the text mode, the required text resolution can be requested by using ##[[KeyPgWidth Width]]##. Any characters ##[[KeyPgPrint Print]]##ed will erase the background around them; it does not use a transparent background.
While in windowed mode, clicking on the window close button will add a keypress of ##[[KeyPgChr Chr]](255)&"k"## to the ##[[KeyPgInkey Inkey]]## buffer. Clicking on the Maximize window button will switch to fullscreen mode if possible. A successful ##**Screen**## call sets currently visible and working pages both to page number ##0##, resets the palette to the specified mode one (see Default palettes), resets the clipping region to the size of the screen, disables custom coordinates mappings, moves the graphics cursor to the center of the screen, moves the text cursor to the top-left corner of the screen and sets foreground and background colors to bright white and black respectively.
' Sets screen mode 13 (320*200, 8bpp)
Screen 13
Print "Screen mode 13 set"
Sleep
{{fbdoc item="filename" value="examples/manual/gfx/screen2.bas"}}%%(freebasic)
#include "fbgfx.bi"
#if __FB_LANG__ = "fb"
Using FB '' Screen mode flags are in the FB namespace in lang FB
#endif
' Sets screen mode 18 (640*480) with 32bpp color depth and 4 pages, in windowed mode; switching disabled
Screen 18, 32, 4, (GFX_WINDOWED or GFX_NOSWITCH)
' Check to make sure Screen was opened successfully
If ScreenPtr = 0 Then
Print "Error setting video mode!"
End
End If
Print "Successfully set video mode"
Sleep
- In DOS, linear framebuffer or banked VESA VBE modes are used whenever possible; if not available, drivers for the standard VGA modes or a 320*240*8 ""ModeX"" driver are used if possible. Windowing and OpenGL related switches are not available.
- In QB the syntax was ##**Screen** //mode//,//colormode//,//active_page//,//visible_page//##. Of those parameters ""FreeBASIC"" supports only //mode// and redefines the rest. The use of ##**Screen** ,,apage,vpage## to swap screen pages is only available in the //[[CompilerOptlang -lang qb]]// dialect.
- ##[[KeyPgScreenres Screenres]]## More flexible alternative to ##**Screen**##
- ##[[KeyPgScreenlist Screenlist]]## List display modes available for FB to use
Deletions:
is a QB style graphics screen mode number (see below). If ##//mode//## is 0, then any currently set graphics mode is closed, and all functions resume their normal console-mode functionality. See below for available modes.
is the color depth in bits per pixel. This only has an effect for modes 14 and higher. Values of 8, 16 and 32 are allowed. 15 and 24 are also allowed as aliases for 16 and 32, respectively. If omitted, it defaults to 8.
is the number of video pages you want, see below. If omitted, it defaults to 1.
Are used to select several things as graphics driver, fullscreen mode. There are constants predefined in the ##fbgfx.bi## file ready to use. See below for available flags.
requests a refresh rate. If it is not available in the present card or the parameter is omitted, FreeBASIC chooses the rate automatically.
In QB-on-GUI modes one or more buffers in standard memory are created, console commands are redirected to their graphic versions and a [[GfxDefPalettes default palette]] is set. QB-like graphics and console statements can be used. Is up to the user to create a window and to refresh it with the contents of the graphics buffers.
If ##**Screen**## fails to set the required mode, an "Illegal function call" error is issued and the screen pointer is set to 0. Thus ##**Screen**## failures can be detected using standard ON ERROR processing or retrieving the screen pointer with ##[[KeyPgScreenptr Screenptr]]##.
New FreeBASIC modes:
For modes 14 and up, the depth parameter changes the color depth to the specified new one; if depth is not specified, these modes run in 8bpp. For modes 13 and below, depth has no effect.
You can request any number of pages for any video mode; if you omit the parameter, only the visible page (number 0) will be available. A page is either the visible screen or an offscreen buffer, you can show a page while working on another one; see the ##[[KeyPgScreenset Screenset]]## statement for details. All pages are created in standard memory, the video card memory is never used for video buffering.
~If flags are omitted, FreeBASIC uses QB-compatible graphics in windowed (except in DOS) mode. These constants are defined in ##fbgfx.bi## . Note that most of the flags are not supported in DOS.
~~-GFX_NULL (-1) Starts a QB-on-GUI graphics mode. It creates a graphics buffer but not a window. User must implement the window, the events manager and and refresh screen as needed. This mode allows to mix FreeBASIC drawing functions with API-driven windows. This flag overrides all other mode flags. See an [[SrcPgGfxNull Example of GFX_NULL]] in Windows.
~~-GFX_OPENGL(&h02) Initializes OpenGL to draw in a dumb window. FreeBASIC graphic functions can't be used. The screen is not automatically updated, FLIP must be used. This option provides a portable way to initialize the OpenGL Library.
~~-If none of the above options is specified, FreeBASIC enters the QB-only graphics mode: it creates a buffer and a dumb window and sets a thread that automatically updates the screen and manages keyboard and mouse. The FreeBASIC drawing functions can be used.
~~Window mode flags are meaningless if GFX_NULL mode is used
~~-GFX_WINDOWED (&h00)
~~-GFX_FULLSCREEN (&h01) The graphics card switch mode is switched to the requested mode and color depth and OS fullscreen mode is used. If the mode is not available in the present card FreeBASIC switches to windowed mode.
~~-If GFX_FULLSCREEN is not specified, FreeBASIC opens a window of the requested size in the present desktop.
~~-GFX_NO_SWITCH (&h04) prevents the user from changing to fullscreen or to windowed mode by pressing Alt-Enter.
~~-GFX_NO_FRAME (&h08) creates a window without a border.
~~-GFX_SHAPED_WINDOW (&h10) creates transparent regions wherever RGBA(255, 0, 255, 0) is drawn on the screen.
~~-GFX_ALWAYS_ON_TOP (&h20) creates a window that stays always on top.
~~-GFX_ALPHA_PRIMITIVES (&h40) Tells the graphics library to enable alpha channel support for all drawing primitives. This means the alpha specified in a color value (via either the [[KeyPgRgba RGBA]] macro or direct color in the form &hAARRGGBB) will always be used by all primitives.
~~-GFX_HIGH_PRIORITY (&h80) Tells the graphics library to enable a higher priority for graphics processing. Only has an effect on ##gdi## and ##DirectX## drivers on Win32 platform.
~~-GFX_STENCIL_BUFFER (&h10000) Forces OpenGL to use Stencil buffer
~~-GFX_ACCUMULATION_BUFFER (&h20000) Forces OpenGL to use Accumulation buffer
~~-GFX_MULTISAMPLE (&h40000) Requests fullscreen anti-aliasing through the ARB_multisample extension
Depending on if the fullscreen parameter is 0 or 1, ##**Screen**## will try to set the specified video mode in windowed or fullscreen mode, respectively. If fullscreen is 1 and the system cannot set specified mode in fullscreen, it'll try in windowed mode. If fullscreen is 0 and the system fails to open a window for specified mode, it'll try fullscreen. If everything fails, ##**Screen**## will have no effect and execution will resume from the statement following the ##**Screen**## call. You should take care of checking if a graphics mode has been set or not, and behave accordingly; a way to check if ##**Screen**## is successful is to test the return value of the ##[[KeyPgScreenptr Screenptr]]## function, have a look at it for details.
Console commands (##[[KeyPgLocate Locate]]##, ##[[KeyPgPrint Print]]##), input can be used both with standard QB ##**Screen**## modes and with the extended ones too, provided the standard colordepth is not modified by using the second argument of ##**Screen**##. Where the table says more than one text resolution is available for the text mode, the required text resolution can be requested by using ##[[KeyPgWidth Width]]##. Characters printed will erase the background around them (no transparent background).
While in windowed mode, clicking on the window close button will return ##[[KeyPgChr Chr]](255)+"k"##. Clicking on the maximize window button will switch to fullscreen mode if possible. A successful ##**Screen**## call sets currently visible and working pages both to page number 0, resets the palette to the specified mode one (see Default palettes), resets the clipping region to the size of the screen, disables custom coordinates mappings, moves the graphics cursor to the center of the screen, moves the text cursor to the top-left corner of the screen and sets foreground and background colors to bright white and black respectively.
' Sets fullscreen 640x480 with 32bpp color depth and 4 pages
SCREEN 18, 32, 4, 1
IF SCREENPTR = 0 THEN
PRINT "Error setting video mode!"
END
END IF
- In DOS, linear framebuffer or banked VESA VBE modes are used whenever possible; if not available, drivers for the standard VGA modes or a 320x240x8 ""ModeX"" driver are used if possible. Windowing and OpenGL related switches are not available.
- In QB the syntax was ##**Screen** //mode//,//colormode//,//active_page//,//visible_page//##. Of those parameters FreeBASIC supports only //mode// and redefines the rest. The use of ##**Screen** ,,apage,vpage## to swap screen pages is only available in the //[[CompilerOptlang -lang qb]]// dialect.
- ##[[KeyPgScreenres Screenres]]## Better (?) alternative for Screen
- ##[[KeyPgScreenlist Screenlist]]## Check available modes


Revision [13358]

The oldest known version of this page was created on 2008-05-11 09:10:29 by DoS386 [Mention FB namespace; misc edits]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki



sf.net phatcode