Revision history for KeyPgScreenres


Revision [21682]

Last edited on 2016-11-07 08:02:15 by fxm [Formatting]
Additions:





Revision [21543]

Edited on 2016-08-13 09:38:34 by fxm [Corrected bad referring to 'Open']
Additions:
The error code returned by ##**Screenres**## can be checked using ##[[KeyPgErr|Err]]## in the next line. The function version of ##**Screenres**## returns directly the error code as a 32 bit ##[[KeyPgLong|Long]]##.
Deletions:
The error code returned by ##**Screenres**## can be checked using ##[[KeyPgErr|Err]]## in the next line. The function version of ##**Open**## returns directly the error code as a 32 bit ##[[KeyPgLong|Long]]##.


Revision [21335]

Edited on 2016-04-06 03:46:15 by fxm [The error code returned can also be checked using Err()]
Additions:
The error code returned by ##**Screenres**## can be checked using ##[[KeyPgErr|Err]]## in the next line. The function version of ##**Open**## returns directly the error code as a 32 bit ##[[KeyPgLong|Long]]##.


Revision [21131]

Edited on 2016-03-13 10:44:14 by fxm [Formatting]

No Differences

Revision [21127]

Edited on 2016-03-13 10:32:33 by fxm [Formatting]

No Differences

Revision [20509]

Edited on 2016-02-10 16:08:21 by DkLwikki [Update link format]
Additions:
[[KeyPgDeclare|declare]] [[KeyPgFunction|function]] **Screenres** ( [[KeyPgByval|byval]] //width// [[KeyPgAs|as]] [[KeyPgLong|long]], [[KeyPgByval|byval]] //height// [[KeyPgAs|as]] [[KeyPgLong|long]], [[KeyPgByval|byval]] //depth// [[KeyPgAs|as]] [[KeyPgLong|long]] = 8, [[KeyPgByval|byval]] //num_pages// [[KeyPgAs|as]] [[KeyPgLong|long]] = 1, [[KeyPgByval|byval]] //flags// [[KeyPgAs|as]] [[KeyPgLong|long]] = 0, [[KeyPgByval|byval]] //refresh_rate// [[KeyPgAs|as]] [[KeyPgLong|long]] = 0 ) [[KeyPgAs|as]] [[KeyPgLong|long]]
The display width and height, respectively. For fullscreen mode, the user should check the availability of the resolution using ##[[KeyPgScreenlist|Screenlist]]##.
The color depth in bits per pixel. Valid color depths are: ##1##, ##2##, ##4##, ##8##, ##16## and ##32##. Values of ##15## and ##24## are also allowed as aliases for ##16## and ##32##, respectively. If omitted, the default is 8 bits per pixel. 8 bits and below will give a palette image. The default palette will be the first ##2 [[KeyPgOpExponentiate|^]] //depth//## colors of the 256-color palette used in ##[[KeyPgScreengraphics|Screen]] 13##.
Returns zero (##0##) if successful, or a non-zero error code to indicate a failure. //[[ProPgErrorHandling|(throws a runtime error)]]// (???)
##**Screenres**## clears the created window or the full screen. In non-fullscreen modes, the resolution does not have to match any resolution of the graphics card. Resolutions like ##555x111## are possible, ""GfxLib"" will create a window of such size. See the page [[GfxLib|GfxLib overview]] for DOS issues.
The font size in ##**Screenres**## modes is set to 8x8 by default. This can be changed by setting the number of text rows/columns, using the ##[[KeyPgWidth|Width]]## function.
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.
~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]]##. Their values can be combined to form a mask using ##[[KeyPgOpOr|Operator Or]]##. 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 refresh the screen as needed. This mode allows to mix ""FreeBASIC"" drawing functions with API-driven windows. Alternatively, it allows to process graphics (for example files) without making it visible on the screen, even in a purely console application. 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.
~~-##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.
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.
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.
pset (x,y),(x + y) and 255
- In DOS, Windowing and ""OpenGL"" related switches are not available, and other issues, see [[GfxLib|GfxLib overview]]
- Not available in the //[[CompilerOptlang|-lang qb]]// dialect unless referenced with the alias ##**""__Screenres""**##.
- ##[[KeyPgScreengraphics|Screen]]## The QB-like way to set graphics mode
- ##[[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:
[[KeyPgDeclare declare]] [[KeyPgFunction function]] **Screenres** ( [[KeyPgByval byval]] //width// [[KeyPgAs as]] [[KeyPgLong long]], [[KeyPgByval byval]] //height// [[KeyPgAs as]] [[KeyPgLong long]], [[KeyPgByval byval]] //depth// [[KeyPgAs as]] [[KeyPgLong long]] = 8, [[KeyPgByval byval]] //num_pages// [[KeyPgAs as]] [[KeyPgLong long]] = 1, [[KeyPgByval byval]] //flags// [[KeyPgAs as]] [[KeyPgLong long]] = 0, [[KeyPgByval byval]] //refresh_rate// [[KeyPgAs as]] [[KeyPgLong long]] = 0 ) [[KeyPgAs as]] [[KeyPgLong long]]
The display width and height, respectively. For fullscreen mode, the user should check the availability of the resolution using ##[[KeyPgScreenlist Screenlist]]##.
The color depth in bits per pixel. Valid color depths are: ##1##, ##2##, ##4##, ##8##, ##16## and ##32##. Values of ##15## and ##24## are also allowed as aliases for ##16## and ##32##, respectively. If omitted, the default is 8 bits per pixel. 8 bits and below will give a palette image. The default palette will be the first ##2 [[KeyPgOpExponentiate ^]] //depth//## colors of the 256-color palette used in ##[[KeyPgScreengraphics Screen]] 13##.
Returns zero (##0##) if successful, or a non-zero error code to indicate a failure. //[[ProPgErrorHandling (throws a runtime error)]]// (???)
##**Screenres**## clears the created window or the full screen. In non-fullscreen modes, the resolution does not have to match any resolution of the graphics card. Resolutions like ##555x111## are possible, ""GfxLib"" will create a window of such size. See the page [[GfxLib GfxLib overview]] for DOS issues.
The font size in ##**Screenres**## modes is set to 8x8 by default. This can be changed by setting the number of text rows/columns, using the ##[[KeyPgWidth Width]]## function.
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.
~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]]##. Their values can be combined to form a mask using ##[[KeyPgOpOr Operator Or]]##. 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 refresh the screen as needed. This mode allows to mix ""FreeBASIC"" drawing functions with API-driven windows. Alternatively, it allows to process graphics (for example files) without making it visible on the screen, even in a purely console application. 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.
~~-##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.
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.
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.
pset (x,y),(x + y) and 255
- In DOS, Windowing and ""OpenGL"" related switches are not available, and other issues, see [[GfxLib GfxLib overview]]
- Not available in the //[[CompilerOptlang -lang qb]]// dialect unless referenced with the alias ##**""__Screenres""**##.
- ##[[KeyPgScreengraphics Screen]]## The QB-like way to set graphics mode
- ##[[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 [17818]

Edited on 2015-09-30 07:52:54 by FxMwikki [Added that flags can be combined to form a mask using Operator Or]
Additions:
~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]]##. Their values can be combined to form a mask using ##[[KeyPgOpOr Operator Or]]##. Note that most of the flags are not supported in DOS.
Deletions:
~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.


Revision [17545]

Edited on 2015-04-01 13:01:10 by DkLwikki [integer => long]
Additions:
[[KeyPgDeclare declare]] [[KeyPgFunction function]] **Screenres** ( [[KeyPgByval byval]] //width// [[KeyPgAs as]] [[KeyPgLong long]], [[KeyPgByval byval]] //height// [[KeyPgAs as]] [[KeyPgLong long]], [[KeyPgByval byval]] //depth// [[KeyPgAs as]] [[KeyPgLong long]] = 8, [[KeyPgByval byval]] //num_pages// [[KeyPgAs as]] [[KeyPgLong long]] = 1, [[KeyPgByval byval]] //flags// [[KeyPgAs as]] [[KeyPgLong long]] = 0, [[KeyPgByval byval]] //refresh_rate// [[KeyPgAs as]] [[KeyPgLong long]] = 0 ) [[KeyPgAs as]] [[KeyPgLong long]]
Deletions:
[[KeyPgDeclare declare]] [[KeyPgFunction function]] **Screenres** ( [[KeyPgByval byval]] //width// [[KeyPgAs as]] [[KeyPgInteger integer]], [[KeyPgByval byval]] //height// [[KeyPgAs as]] [[KeyPgInteger integer]], [[KeyPgByval byval]] //depth// [[KeyPgAs as]] [[KeyPgInteger integer]] = 8, [[KeyPgByval byval]] //num_pages// [[KeyPgAs as]] [[KeyPgInteger integer]] = 1, [[KeyPgByval byval]] //flags// [[KeyPgAs as]] [[KeyPgInteger integer]] = 0, [[KeyPgByval byval]] //refresh_rate// [[KeyPgAs as]] [[KeyPgInteger integer]] = 0 ) [[KeyPgAs as]] [[KeyPgInteger integer]]


Revision [17030]

Edited on 2014-03-30 03:16:53 by DoS386 [fixed "see below"]
Additions:
Used to set various properties of the screen, including fullscreen mode and the graphics driver used. (see below or the standard header "fbgfx.bi" for available 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. Alternatively, it allows to process graphics (for example files) without making it visible on the screen, even in a purely console application. This flag overrides all other mode flags. See an [[SrcPgGfxNull Example of GFX_NULL]] in Windows.
Deletions:
Used to set various properties of the screen, including fullscreen mode and the graphics driver used. (see ##[[KeyPgScreengraphics Screen]]## or the standard header "fbgfx.bi" for available 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. Alternatively, it allows to process graphics (for example files) without making it visible on the screen. This flag overrides all other mode flags. See an [[SrcPgGfxNull Example of GFX_NULL]] in Windows.


Revision [17029]

Edited on 2014-03-30 03:14:57 by DoS386 [clraer]
Additions:
##**Screenres**## clears the created window or the full screen. In non-fullscreen modes, the resolution does not have to match any resolution of the graphics card. Resolutions like ##555x111## are possible, ""GfxLib"" will create a window of such size. See the page [[GfxLib GfxLib overview]] for DOS issues.
~~-##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. Alternatively, it allows to process graphics (for example files) without making it visible on the screen. This flag overrides all other mode flags. See an [[SrcPgGfxNull Example of GFX_NULL]] in Windows.
Deletions:
In non-fullscreen modes, the resolution does not have to match any resolution of the graphics card. Resolutions like ##555x111## are possible, ""GfxLib"" will create a window of such size. See the page [[GfxLib GfxLib overview]] for DOS issues.
~~-##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.


Revision [17028]

Edited on 2014-03-30 03:10:39 by DoS386 [move from SCREEN to SCREENRES h]
Additions:
In non-fullscreen modes, the resolution does not have to match any resolution of the graphics card. Resolutions like ##555x111## are possible, ""GfxLib"" will create a window of such size. See the page [[GfxLib GfxLib overview]] for DOS issues.
In ""OpenGL"" modes a dumb window or fullscreen resolution is set, one or more buffers in standard memory are created, and the system's ""OpenGL"" library is initialized. From here only ""OpenGL"" commands can be used to write to the graphics buffer. QB-like and console commands are forbidden. This mode allows to initialize ""OpenGL"" in a portable way.
__##flags## details:__
~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, and other issues, see [[GfxLib GfxLib overview]]
Deletions:
In non-fullscreen modes, the resolution does not have to match any resolution of the graphics card. Resolutions like ##555x111## are possible, ""GfxLib"" will create a window of such size. See Platform differences for DOS issues.
In ""OpenGL"" modes a dumb window or fullscreen resolution is set, one or more buffers in standard memory are created, and the system's ""OpenGL"" library is initialized. From here only ""OpenGL"" commands can be used to write to the graphics buffer. QB-like and console commands are forbidden. This mode allows to initialize ""OpenGL"" in a portable way.
See the details in ##[[KeyPgScreengraphics Screen (Graphics)]]## keyword.
- In DOS, refresh rate setting, and Windowing and ""OpenGL"" related switches are not available, see also [[GfxLib GfxLib overview]]


Revision [17024]

Edited on 2014-03-29 02:50:27 by DoS386 [strange: [[ProPgErrorHandling (throws a runtime error)]]]
Additions:
Returns zero (##0##) if successful, or a non-zero error code to indicate a failure. //[[ProPgErrorHandling (throws a runtime error)]]// (???)
- ##[[FaqPggfxlib2]]##
Deletions:
Returns zero (##0##) if successful, or a non-zero error code to indicate a failure. //[[ProPgErrorHandling (throws a runtime error)]]//


Revision [16848]

Edited on 2013-06-17 03:27:29 by DoS386 [boom]
Additions:
The desired refresh rate of the screen, only has an effect for fullscreen modes, and some systems and drivers only. Defaults to an appropriate value, invalid refresh rates will be ignored.
- In DOS, refresh rate setting, and Windowing and ""OpenGL"" related switches are not available, see also [[GfxLib GfxLib overview]]
Deletions:
The refresh rate of the screen, defaults to an appropriate value. (invalid refresh rates will be ignored)
- In DOS, Windowing and ""OpenGL"" related switches are not available, see also [[GfxLib GfxLib overview]]


Revision [16713]

Edited on 2013-03-31 22:44:28 by CountingPine [ScreenRes is now a function]
Additions:
[[KeyPgDeclare declare]] [[KeyPgFunction function]] **Screenres** ( [[KeyPgByval byval]] //width// [[KeyPgAs as]] [[KeyPgInteger integer]], [[KeyPgByval byval]] //height// [[KeyPgAs as]] [[KeyPgInteger integer]], [[KeyPgByval byval]] //depth// [[KeyPgAs as]] [[KeyPgInteger integer]] = 8, [[KeyPgByval byval]] //num_pages// [[KeyPgAs as]] [[KeyPgInteger integer]] = 1, [[KeyPgByval byval]] //flags// [[KeyPgAs as]] [[KeyPgInteger integer]] = 0, [[KeyPgByval byval]] //refresh_rate// [[KeyPgAs as]] [[KeyPgInteger integer]] = 0 ) [[KeyPgAs as]] [[KeyPgInteger integer]]
//result// = **Screenres**( //width//, //height// [, [//depth//] [, [//num_pages//] [, [//flags//] [, //refresh_rate// ]]]] )
{{fbdoc item="ret"}}
Returns zero (##0##) if successful, or a non-zero error code to indicate a failure. //[[ProPgErrorHandling (throws a runtime error)]]//
' Draw color bands in a diagonal pattern over the whole screen
Deletions:
[[KeyPgDeclare declare]] [[KeyPgSub sub]] **Screenres** ( [[KeyPgByval byval]] //width// [[KeyPgAs as]] [[KeyPgInteger integer]], [[KeyPgByval byval]] //height// [[KeyPgAs as]] [[KeyPgInteger integer]], [[KeyPgByval byval]] //depth// [[KeyPgAs as]] [[KeyPgInteger integer]] = 8, [[KeyPgByval byval]] //num_pages// [[KeyPgAs as]] [[KeyPgInteger integer]] = 1, [[KeyPgByval byval]] //flags// [[KeyPgAs as]] [[KeyPgInteger integer]] = 0, [[KeyPgByval byval]] //refresh_rate// [[KeyPgAs as]] [[KeyPgInteger integer]] = 0 )
' Draw colour bands in a diagonal pattern over the whole screen


Revision [16710]

Edited on 2013-03-30 23:47:55 by CountingPine [ScreenRes is now a function]
Additions:
' Display the text "Hello World!!" over the lines we've drawn, in the top-left hand corner
' Keep the window open until the user presses a key
Deletions:
'Display the text "Hello World!!" over the lines we've drawn, in the top-left hand corner
'Keep the window open until the user presses a key


Revision [16709]

Edited on 2013-03-30 23:07:11 by CountingPine [Improve example]
Additions:
' Set the screen mode to 320*200, with 8 bits per pixel
screenres 320, 200, 8
' Draw colour bands in a diagonal pattern over the whole screen
for y as integer = 0 to 200-1
for x as integer = 0 to 320-1
pset (x,y),(x + y) and 255
next x
next y
'Display the text "Hello World!!" over the lines we've drawn, in the top-left hand corner
print "Hello world!!"
'Keep the window open until the user presses a key
sleep
Deletions:
dim a as integer, b as integer
ScreenRes 640, 480, 8 'This line will set the screen mode to 640x480x8.
'The following code block will draw diagonal lines over the whole screen.
For a = 1 to 640
For b = 1 to 480
Pset (a,b),(a + b) AND 255
Next b
Next a
'The following line will print "Hello World!" over the lines we've drawn.
Print "Hello world!!"
Sleep
End


Revision [16286]

Edited on 2012-08-16 07:08:52 by CountingPine [Eep! Should definitely use preview more..]
Additions:
{{fbdoc item="title" value="SCREENRES"}}----
Initializes a graphics mode by specifying horizontal and vertical resolution

{{fbdoc item="syntax"}}##
[[KeyPgDeclare declare]] [[KeyPgSub sub]] **Screenres** ( [[KeyPgByval byval]] //width// [[KeyPgAs as]] [[KeyPgInteger integer]], [[KeyPgByval byval]] //height// [[KeyPgAs as]] [[KeyPgInteger integer]], [[KeyPgByval byval]] //depth// [[KeyPgAs as]] [[KeyPgInteger integer]] = 8, [[KeyPgByval byval]] //num_pages// [[KeyPgAs as]] [[KeyPgInteger integer]] = 1, [[KeyPgByval byval]] //flags// [[KeyPgAs as]] [[KeyPgInteger integer]] = 0, [[KeyPgByval byval]] //refresh_rate// [[KeyPgAs as]] [[KeyPgInteger integer]] = 0 )
##
{{fbdoc item="usage"}}##
**Screenres** //width//, //height// [, [//depth//] [, [//num_pages//] [, [//flags//] [, //refresh_rate// ]]]]
##
{{fbdoc item="param"}}
##//width//##, ##//height//##
The display width and height, respectively. For fullscreen mode, the user should check the availability of the resolution using ##[[KeyPgScreenlist Screenlist]]##.
##//depth//##
The color depth in bits per pixel. Valid color depths are: ##1##, ##2##, ##4##, ##8##, ##16## and ##32##. Values of ##15## and ##24## are also allowed as aliases for ##16## and ##32##, respectively. If omitted, the default is 8 bits per pixel. 8 bits and below will give a palette image. The default palette will be the first ##2 [[KeyPgOpExponentiate ^]] //depth//## colors of the 256-color palette used in ##[[KeyPgScreengraphics Screen]] 13##.
##//num_pages//##
The number of video pages to create, defaults to ##1##. (see below)
##//flags//##
Used to set various properties of the screen, including fullscreen mode and the graphics driver used. (see ##[[KeyPgScreengraphics Screen]]## or the standard header "fbgfx.bi" for available flags)
##//refresh_rate//##
The refresh rate of the screen, defaults to an appropriate value. (invalid refresh rates will be ignored)

{{fbdoc item="desc"}}

##**Screenres**## 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 non-fullscreen modes, the resolution does not have to match any resolution of the graphics card. Resolutions like ##555x111## are possible, ""GfxLib"" will create a window of such size. See Platform differences for DOS issues.

The font size in ##**Screenres**## modes is set to 8x8 by default. This can be changed by setting the number of text rows/columns, using the ##[[KeyPgWidth Width]]## function.

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 system's ""OpenGL"" library is initialized. From here only ""OpenGL"" commands can be used to write to the graphics buffer. QB-like and console commands are forbidden. This mode allows to initialize ""OpenGL"" in a portable way.

See the details in ##[[KeyPgScreengraphics Screen (Graphics)]]## keyword.

{{fbdoc item="ex"}}
{{fbdoc item="filename" value="examples/manual/gfx/screenres.bas"}}%%(freebasic)
dim a as integer, b as integer

ScreenRes 640, 480, 8 'This line will set the screen mode to 640x480x8.
'The following code block will draw diagonal lines over the whole screen.
For a = 1 to 640
For b = 1 to 480
Pset (a,b),(a + b) AND 255
Next b
Next a
'The following line will print "Hello World!" over the lines we've drawn.
Print "Hello world!!"

Sleep
End
%%

{{fbdoc item="target"}}
- In DOS, Windowing and ""OpenGL"" related switches are not available, see also [[GfxLib GfxLib overview]]

{{fbdoc item="lang"}}
- Not available in the //[[CompilerOptlang -lang qb]]// dialect unless referenced with the alias ##**""__Screenres""**##.

{{fbdoc item="diff"}}
- New to ""FreeBASIC""

{{fbdoc item="see"}}
- ##[[KeyPgScreengraphics Screen]]## The QB-like way to set graphics mode
- ##[[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]]##

{{fbdoc item="back" value="CatPgGfxScreen|Screen Functions"}}
Deletions:
{{fbdoc item="title" value="SCREENRES"}}----"}}
{{fbdoc item="title" value="Initializes a graphics mode by specifying horizontal and vertical resolution"}}
{{fbdoc item="title" value=""}}
{{fbdoc item="title" value="{{fbdoc item="syntax"}}##"}}
{{fbdoc item="title" value=" [[KeyPgDeclare declare]] [[KeyPgSub sub]] **Screenres** ( [[KeyPgByval byval]] //width// [[KeyPgAs as]] [[KeyPgInteger integer]], [[KeyPgByval byval]] //height// [[KeyPgAs as]] [[KeyPgInteger integer]], [[KeyPgByval byval]] //depth// [[KeyPgAs as]] [[KeyPgInteger integer]] = 8, [[KeyPgByval byval]] //num_pages// [[KeyPgAs as]] [[KeyPgInteger integer]] = 1, [[KeyPgByval byval]] //flags// [[KeyPgAs as]] [[KeyPgInteger integer]] = 0, [[KeyPgByval byval]] //refresh_rate// [[KeyPgAs as]] [[KeyPgInteger integer]] = 0 )"}}
{{fbdoc item="title" value="##"}}
{{fbdoc item="title" value="{{fbdoc item="usage"}}##"}}
{{fbdoc item="title" value=" **Screenres** //width//, //height// [, [//depth//] [, [//num_pages//] [, [//flags//] [, //refresh_rate// ]]]]"}}
{{fbdoc item="title" value="##"}}
{{fbdoc item="title" value="{{fbdoc item="param"}}"}}
{{fbdoc item="title" value=" ##//width//##, ##//height//##"}}
{{fbdoc item="title" value=" The display width and height, respectively. For fullscreen mode, the user should check the availability of the resolution using ##[[KeyPgScreenlist Screenlist]]##."}}
{{fbdoc item="title" value=" ##//depth//##"}}
{{fbdoc item="title" value=" The color depth in bits per pixel. Valid color depths are: ##1##, ##2##, ##4##, ##8##, ##16## and ##32##. Values of ##15## and ##24## are also allowed as aliases for ##16## and ##32##, respectively. If omitted, the default is 8 bits per pixel. 8 bits and below will give a palette image. The default palette will be the first ##2 [[KeyPgOpExponentiate ^]] //depth//## colors of the 256-color palette used in ##[[KeyPgScreengraphics Screen]] 13##."}}
{{fbdoc item="title" value=" ##//num_pages//##"}}
{{fbdoc item="title" value=" The number of video pages to create, defaults to ##1##. (see below)"}}
{{fbdoc item="title" value=" ##//flags//##"}}
{{fbdoc item="title" value=" Used to set various properties of the screen, including fullscreen mode and the graphics driver used. (see ##[[KeyPgScreengraphics Screen]]## or the standard header "fbgfx.bi" for available flags)"}}
{{fbdoc item="title" value=" ##//refresh_rate//##"}}
{{fbdoc item="title" value=" The refresh rate of the screen, defaults to an appropriate value. (invalid refresh rates will be ignored)"}}
{{fbdoc item="title" value=""}}
{{fbdoc item="title" value="{{fbdoc item="desc"}}"}}
{{fbdoc item="title" value=""}}
{{fbdoc item="title" value=" ##**Screenres**## tells the compiler to link the [[GfxLib]] and initializes a QB-only, QB-on-GUI or ""OpenGL"" graphics mode, depending on the ##//flags//## setting"}}
{{fbdoc item="title" value=""}}
{{fbdoc item="title" value=" In non-fullscreen modes, the resolution does not have to match any resolution of the graphics card. Resolutions like ##555x111## are possible, ""GfxLib"" will create a window of such size. See Platform differences for DOS issues."}}
{{fbdoc item="title" value=" "}}
{{fbdoc item="title" value=" The font size in ##**Screenres**## modes is set to 8x8 by default. This can be changed by setting the number of text rows/columns, using the ##[[KeyPgWidth Width]]## function."}}
{{fbdoc item="title" value=""}}
{{fbdoc item="title" value=" 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. "}}
{{fbdoc item="title" value=""}}
{{fbdoc item="title" value=" 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."}}
{{fbdoc item="title" value=""}}
{{fbdoc item="title" value=" In ""OpenGL"" modes a dumb window or fullscreen resolution is set, one or more buffers in standard memory are created, and the system's ""OpenGL"" library is initialized. From here only ""OpenGL"" commands can be used to write to the graphics buffer. QB-like and console commands are forbidden. This mode allows to initialize ""OpenGL"" in a portable way. "}}
{{fbdoc item="title" value=""}}
{{fbdoc item="title" value=" See the details in ##[[KeyPgScreengraphics Screen (Graphics)]]## keyword."}}
{{fbdoc item="title" value=""}}
{{fbdoc item="title" value="{{fbdoc item="ex"}}"}}
{{fbdoc item="title" value="{{fbdoc item="filename" value="examples/manual/gfx/screenres.bas"}}%%(freebasic)"}}
{{fbdoc item="title" value="dim a as integer, b as integer"}}
{{fbdoc item="title" value=""}}
{{fbdoc item="title" value="ScreenRes 640, 480, 8 'This line will set the screen mode to 640x480x8."}}
{{fbdoc item="title" value=" 'The following code block will draw diagonal lines over the whole screen."}}
{{fbdoc item="title" value="For a = 1 to 640"}}
{{fbdoc item="title" value=" For b = 1 to 480"}}
{{fbdoc item="title" value=" Pset (a,b),(a + b) AND 255"}}
{{fbdoc item="title" value=" Next b"}}
{{fbdoc item="title" value="Next a"}}
{{fbdoc item="title" value=" 'The following line will print "Hello World!" over the lines we've drawn."}}
{{fbdoc item="title" value="Print "Hello world!!""}}
{{fbdoc item="title" value=""}}
{{fbdoc item="title" value="Sleep"}}
{{fbdoc item="title" value="End"}}
{{fbdoc item="title" value="%%"}}
{{fbdoc item="title" value=""}}
{{fbdoc item="title" value="{{fbdoc item="target"}}"}}
{{fbdoc item="title" value=" - In DOS, Windowing and ""OpenGL"" related switches are not available, see also [[GfxLib GfxLib overview]]"}}
{{fbdoc item="title" value=""}}
{{fbdoc item="title" value="{{fbdoc item="lang"}}"}}
{{fbdoc item="title" value=" - Not available in the //[[CompilerOptlang -lang qb]]// dialect unless referenced with the alias ##**""__Screenres""**##."}}
{{fbdoc item="title" value=""}}
{{fbdoc item="title" value="{{fbdoc item="diff"}}"}}
{{fbdoc item="title" value=" - New to ""FreeBASIC"""}}
{{fbdoc item="title" value=""}}
{{fbdoc item="title" value="{{fbdoc item="see"}}"}}
{{fbdoc item="title" value=" - ##[[KeyPgScreengraphics Screen]]## The QB-like way to set graphics mode"}}
{{fbdoc item="title" value=" - ##[[KeyPgScreenlist Screenlist]]## Check display modes available for FB ""GfxLib"" to use"}}
{{fbdoc item="title" value=" - ##[[KeyPgScreencontrol Screencontrol]]## Select driver and more "}}
{{fbdoc item="title" value=" - ##[[KeyPgScreenlock Screenlock]]##"}}
{{fbdoc item="title" value=" - ##[[KeyPgScreenunlock Screenunlock]]##"}}
{{fbdoc item="title" value=" - ##[[KeyPgScreenptr Screenptr]]## Semi-low level access"}}
{{fbdoc item="title" value=" - ##[[KeyPgScreenset Screenset]]##"}}
{{fbdoc item="title" value=" - ##[[KeyPgScreencopy Screencopy]]##"}}
{{fbdoc item="title" value=" - ##[[KeyPgScreeninfo Screeninfo]]##"}}
{{fbdoc item="title" value=" - ##[[KeyPgScreenglproc Screenglproc]]##"}}
{{fbdoc item="title" value=" - ##[[GfxInternalFormats Internal pixel formats]]##"}}
{{fbdoc item="title" value=""}}
{{fbdoc item="title" value="{{fbdoc item="back" value="CatPgGfxScreen|Screen Functions"}}


Revision [16285]

Edited on 2012-08-16 07:06:45 by CountingPine [Unify keyword case in syntax]
Additions:
{{fbdoc item="title" value="SCREENRES"}}----"}}
{{fbdoc item="title" value="Initializes a graphics mode by specifying horizontal and vertical resolution"}}
{{fbdoc item="title" value=""}}
{{fbdoc item="title" value="{{fbdoc item="syntax"}}##"}}
{{fbdoc item="title" value=" [[KeyPgDeclare declare]] [[KeyPgSub sub]] **Screenres** ( [[KeyPgByval byval]] //width// [[KeyPgAs as]] [[KeyPgInteger integer]], [[KeyPgByval byval]] //height// [[KeyPgAs as]] [[KeyPgInteger integer]], [[KeyPgByval byval]] //depth// [[KeyPgAs as]] [[KeyPgInteger integer]] = 8, [[KeyPgByval byval]] //num_pages// [[KeyPgAs as]] [[KeyPgInteger integer]] = 1, [[KeyPgByval byval]] //flags// [[KeyPgAs as]] [[KeyPgInteger integer]] = 0, [[KeyPgByval byval]] //refresh_rate// [[KeyPgAs as]] [[KeyPgInteger integer]] = 0 )"}}
{{fbdoc item="title" value="##"}}
{{fbdoc item="title" value="{{fbdoc item="usage"}}##"}}
{{fbdoc item="title" value=" **Screenres** //width//, //height// [, [//depth//] [, [//num_pages//] [, [//flags//] [, //refresh_rate// ]]]]"}}
{{fbdoc item="title" value="##"}}
{{fbdoc item="title" value="{{fbdoc item="param"}}"}}
{{fbdoc item="title" value=" ##//width//##, ##//height//##"}}
{{fbdoc item="title" value=" The display width and height, respectively. For fullscreen mode, the user should check the availability of the resolution using ##[[KeyPgScreenlist Screenlist]]##."}}
{{fbdoc item="title" value=" ##//depth//##"}}
{{fbdoc item="title" value=" The color depth in bits per pixel. Valid color depths are: ##1##, ##2##, ##4##, ##8##, ##16## and ##32##. Values of ##15## and ##24## are also allowed as aliases for ##16## and ##32##, respectively. If omitted, the default is 8 bits per pixel. 8 bits and below will give a palette image. The default palette will be the first ##2 [[KeyPgOpExponentiate ^]] //depth//## colors of the 256-color palette used in ##[[KeyPgScreengraphics Screen]] 13##."}}
{{fbdoc item="title" value=" ##//num_pages//##"}}
{{fbdoc item="title" value=" The number of video pages to create, defaults to ##1##. (see below)"}}
{{fbdoc item="title" value=" ##//flags//##"}}
{{fbdoc item="title" value=" Used to set various properties of the screen, including fullscreen mode and the graphics driver used. (see ##[[KeyPgScreengraphics Screen]]## or the standard header "fbgfx.bi" for available flags)"}}
{{fbdoc item="title" value=" ##//refresh_rate//##"}}
{{fbdoc item="title" value=" The refresh rate of the screen, defaults to an appropriate value. (invalid refresh rates will be ignored)"}}
{{fbdoc item="title" value=""}}
{{fbdoc item="title" value="{{fbdoc item="desc"}}"}}
{{fbdoc item="title" value=""}}
{{fbdoc item="title" value=" ##**Screenres**## tells the compiler to link the [[GfxLib]] and initializes a QB-only, QB-on-GUI or ""OpenGL"" graphics mode, depending on the ##//flags//## setting"}}
{{fbdoc item="title" value=""}}
{{fbdoc item="title" value=" In non-fullscreen modes, the resolution does not have to match any resolution of the graphics card. Resolutions like ##555x111## are possible, ""GfxLib"" will create a window of such size. See Platform differences for DOS issues."}}
{{fbdoc item="title" value=" "}}
{{fbdoc item="title" value=" The font size in ##**Screenres**## modes is set to 8x8 by default. This can be changed by setting the number of text rows/columns, using the ##[[KeyPgWidth Width]]## function."}}
{{fbdoc item="title" value=""}}
{{fbdoc item="title" value=" 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. "}}
{{fbdoc item="title" value=""}}
{{fbdoc item="title" value=" 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."}}
{{fbdoc item="title" value=""}}
{{fbdoc item="title" value=" In ""OpenGL"" modes a dumb window or fullscreen resolution is set, one or more buffers in standard memory are created, and the system's ""OpenGL"" library is initialized. From here only ""OpenGL"" commands can be used to write to the graphics buffer. QB-like and console commands are forbidden. This mode allows to initialize ""OpenGL"" in a portable way. "}}
{{fbdoc item="title" value=""}}
{{fbdoc item="title" value=" See the details in ##[[KeyPgScreengraphics Screen (Graphics)]]## keyword."}}
{{fbdoc item="title" value=""}}
{{fbdoc item="title" value="{{fbdoc item="ex"}}"}}
{{fbdoc item="title" value="{{fbdoc item="filename" value="examples/manual/gfx/screenres.bas"}}%%(freebasic)"}}
{{fbdoc item="title" value="dim a as integer, b as integer"}}
{{fbdoc item="title" value=""}}
{{fbdoc item="title" value="ScreenRes 640, 480, 8 'This line will set the screen mode to 640x480x8."}}
{{fbdoc item="title" value=" 'The following code block will draw diagonal lines over the whole screen."}}
{{fbdoc item="title" value="For a = 1 to 640"}}
{{fbdoc item="title" value=" For b = 1 to 480"}}
{{fbdoc item="title" value=" Pset (a,b),(a + b) AND 255"}}
{{fbdoc item="title" value=" Next b"}}
{{fbdoc item="title" value="Next a"}}
{{fbdoc item="title" value=" 'The following line will print "Hello World!" over the lines we've drawn."}}
{{fbdoc item="title" value="Print "Hello world!!""}}
{{fbdoc item="title" value=""}}
{{fbdoc item="title" value="Sleep"}}
{{fbdoc item="title" value="End"}}
{{fbdoc item="title" value="%%"}}
{{fbdoc item="title" value=""}}
{{fbdoc item="title" value="{{fbdoc item="target"}}"}}
{{fbdoc item="title" value=" - In DOS, Windowing and ""OpenGL"" related switches are not available, see also [[GfxLib GfxLib overview]]"}}
{{fbdoc item="title" value=""}}
{{fbdoc item="title" value="{{fbdoc item="lang"}}"}}
{{fbdoc item="title" value=" - Not available in the //[[CompilerOptlang -lang qb]]// dialect unless referenced with the alias ##**""__Screenres""**##."}}
{{fbdoc item="title" value=""}}
{{fbdoc item="title" value="{{fbdoc item="diff"}}"}}
{{fbdoc item="title" value=" - New to ""FreeBASIC"""}}
{{fbdoc item="title" value=""}}
{{fbdoc item="title" value="{{fbdoc item="see"}}"}}
{{fbdoc item="title" value=" - ##[[KeyPgScreengraphics Screen]]## The QB-like way to set graphics mode"}}
{{fbdoc item="title" value=" - ##[[KeyPgScreenlist Screenlist]]## Check display modes available for FB ""GfxLib"" to use"}}
{{fbdoc item="title" value=" - ##[[KeyPgScreencontrol Screencontrol]]## Select driver and more "}}
{{fbdoc item="title" value=" - ##[[KeyPgScreenlock Screenlock]]##"}}
{{fbdoc item="title" value=" - ##[[KeyPgScreenunlock Screenunlock]]##"}}
{{fbdoc item="title" value=" - ##[[KeyPgScreenptr Screenptr]]## Semi-low level access"}}
{{fbdoc item="title" value=" - ##[[KeyPgScreenset Screenset]]##"}}
{{fbdoc item="title" value=" - ##[[KeyPgScreencopy Screencopy]]##"}}
{{fbdoc item="title" value=" - ##[[KeyPgScreeninfo Screeninfo]]##"}}
{{fbdoc item="title" value=" - ##[[KeyPgScreenglproc Screenglproc]]##"}}
{{fbdoc item="title" value=" - ##[[GfxInternalFormats Internal pixel formats]]##"}}
{{fbdoc item="title" value=""}}
{{fbdoc item="title" value="{{fbdoc item="back" value="CatPgGfxScreen|Screen Functions"}}
Deletions:
{{fbdoc item="title" value="SCREENRES"}}----
Initializes a graphics mode by specifying horizontal and vertical resolution

{{fbdoc item="syntax"}}##
[[KeyPgDeclare declare]] [[KeyPgSub sub]] **Screenres** ( [[KeyPgByval Byval]] //width// [[KeyPgAs as]] [[KeyPgInteger integer]], [[KeyPgByval Byval]] //height// [[KeyPgAs as]] [[KeyPgInteger integer]], [[KeyPgByval Byval]] //depth// [[KeyPgAs as]] [[KeyPgInteger integer]] = 8, [[KeyPgByval Byval]] //num_pages// [[KeyPgAs as]] [[KeyPgInteger integer]] = 1, [[KeyPgByval Byval]] //flags// [[KeyPgAs as]] [[KeyPgInteger integer]] = 0, [[KeyPgByval Byval]] //refresh_rate// [[KeyPgAs as]] [[KeyPgInteger integer]] = 0 )
##
{{fbdoc item="usage"}}##
**Screenres** //width//, //height// [, [//depth//] [, [//num_pages//] [, [//flags//] [, //refresh_rate// ]]]]
##
{{fbdoc item="param"}}
##//width//##, ##//height//##
The display width and height, respectively. For fullscreen mode, the user should check the availability of the resolution using ##[[KeyPgScreenlist Screenlist]]##.
##//depth//##
The color depth in bits per pixel. Valid color depths are: ##1##, ##2##, ##4##, ##8##, ##16## and ##32##. Values of ##15## and ##24## are also allowed as aliases for ##16## and ##32##, respectively. If omitted, the default is 8 bits per pixel. 8 bits and below will give a palette image. The default palette will be the first ##2 [[KeyPgOpExponentiate ^]] //depth//## colors of the 256-color palette used in ##[[KeyPgScreengraphics Screen]] 13##.
##//num_pages//##
The number of video pages to create, defaults to ##1##. (see below)
##//flags//##
Used to set various properties of the screen, including fullscreen mode and the graphics driver used. (see ##[[KeyPgScreengraphics Screen]]## or the standard header "fbgfx.bi" for available flags)
##//refresh_rate//##
The refresh rate of the screen, defaults to an appropriate value. (invalid refresh rates will be ignored)

{{fbdoc item="desc"}}

##**Screenres**## 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 non-fullscreen modes, the resolution does not have to match any resolution of the graphics card. Resolutions like ##555x111## are possible, ""GfxLib"" will create a window of such size. See Platform differences for DOS issues.

The font size in ##**Screenres**## modes is set to 8x8 by default. This can be changed by setting the number of text rows/columns, using the ##[[KeyPgWidth Width]]## function.

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 system's ""OpenGL"" library is initialized. From here only ""OpenGL"" commands can be used to write to the graphics buffer. QB-like and console commands are forbidden. This mode allows to initialize ""OpenGL"" in a portable way.

See the details in ##[[KeyPgScreengraphics Screen (Graphics)]]## keyword.

{{fbdoc item="ex"}}
{{fbdoc item="filename" value="examples/manual/gfx/screenres.bas"}}%%(freebasic)
dim a as integer, b as integer

ScreenRes 640, 480, 8 'This line will set the screen mode to 640x480x8.
'The following code block will draw diagonal lines over the whole screen.
For a = 1 to 640
For b = 1 to 480
Pset (a,b),(a + b) AND 255
Next b
Next a
'The following line will print "Hello World!" over the lines we've drawn.
Print "Hello world!!"

Sleep
End
%%

{{fbdoc item="target"}}
- In DOS, Windowing and ""OpenGL"" related switches are not available, see also [[GfxLib GfxLib overview]]

{{fbdoc item="lang"}}
- Not available in the //[[CompilerOptlang -lang qb]]// dialect unless referenced with the alias ##**""__Screenres""**##.

{{fbdoc item="diff"}}
- New to ""FreeBASIC""

{{fbdoc item="see"}}
- ##[[KeyPgScreengraphics Screen]]## The QB-like way to set graphics mode
- ##[[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]]##

{{fbdoc item="back" value="CatPgGfxScreen|Screen Functions"}}


Revision [16284]

Edited on 2012-08-16 07:05:08 by CountingPine [Byvals on parameters in syntax]
Additions:
[[KeyPgDeclare declare]] [[KeyPgSub sub]] **Screenres** ( [[KeyPgByval Byval]] //width// [[KeyPgAs as]] [[KeyPgInteger integer]], [[KeyPgByval Byval]] //height// [[KeyPgAs as]] [[KeyPgInteger integer]], [[KeyPgByval Byval]] //depth// [[KeyPgAs as]] [[KeyPgInteger integer]] = 8, [[KeyPgByval Byval]] //num_pages// [[KeyPgAs as]] [[KeyPgInteger integer]] = 1, [[KeyPgByval Byval]] //flags// [[KeyPgAs as]] [[KeyPgInteger integer]] = 0, [[KeyPgByval Byval]] //refresh_rate// [[KeyPgAs as]] [[KeyPgInteger integer]] = 0 )
Deletions:
[[KeyPgDeclare Declare]] [[KeyPgSub Sub]] **Screenres** ( //width// [[KeyPgAs as]] [[KeyPgInteger integer]], //height// [[KeyPgAs as]] [[KeyPgInteger integer]], //depth// [[KeyPgAs as]] [[KeyPgInteger integer]] = 8, //num_pages// [[KeyPgAs as]] [[KeyPgInteger integer]] = 1, //flags// [[KeyPgAs as]] [[KeyPgInteger integer]] = 0, //refresh_rate// [[KeyPgAs as]] [[KeyPgInteger integer]] = 0 )


Revision [16283]

Edited on 2012-08-16 07:03:12 by CountingPine ["Declare Sub" format on syntax; formatting]
Additions:
[[KeyPgDeclare Declare]] [[KeyPgSub Sub]] **Screenres** ( //width// [[KeyPgAs as]] [[KeyPgInteger integer]], //height// [[KeyPgAs as]] [[KeyPgInteger integer]], //depth// [[KeyPgAs as]] [[KeyPgInteger integer]] = 8, //num_pages// [[KeyPgAs as]] [[KeyPgInteger integer]] = 1, //flags// [[KeyPgAs as]] [[KeyPgInteger integer]] = 0, //refresh_rate// [[KeyPgAs as]] [[KeyPgInteger integer]] = 0 )
The color depth in bits per pixel. Valid color depths are: ##1##, ##2##, ##4##, ##8##, ##16## and ##32##. Values of ##15## and ##24## are also allowed as aliases for ##16## and ##32##, respectively. If omitted, the default is 8 bits per pixel. 8 bits and below will give a palette image. The default palette will be the first ##2 [[KeyPgOpExponentiate ^]] //depth//## colors of the 256-color palette used in ##[[KeyPgScreengraphics Screen]] 13##.
The number of video pages to create, defaults to ##1##. (see below)
Deletions:
**Screenres** //width// [[KeyPgAs as]] [[KeyPgInteger integer]], //height// [[KeyPgAs as]] [[KeyPgInteger integer]], //depth// [[KeyPgAs as]] [[KeyPgInteger integer]] = 8, //num_pages// [[KeyPgAs as]] [[KeyPgInteger integer]] = 1, //flags// [[KeyPgAs as]] [[KeyPgInteger integer]] = 0, //refresh_rate// [[KeyPgAs as]] [[KeyPgInteger integer]] = 0
The color depth in bits per pixel. Valid color depths are: 1, 2, 4, 8, 16 and 32. Values of 15 and 24 are also allowed as aliases for 16 and 32, respectively. If omitted, the default is 8 bits per pixel. 8 bits and below will give a palette image. The default palette will be the first ##2^//depth//## colors of the 256-color palette used in ##[[KeyPgScreengraphics Screen]] 13##.
The number of video pages to create, defaults to 1. (see below)


Revision [15954]

Edited on 2012-02-02 11:53:45 by CountingPine [Remove implicit CamelCase links]
Additions:
##**Screenres**## 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 non-fullscreen modes, the resolution does not have to match any resolution of the graphics card. Resolutions like ##555x111## are possible, ""GfxLib"" will create a window of such size. See Platform differences for DOS issues.
In ""OpenGL"" modes a dumb window or fullscreen resolution is set, one or more buffers in standard memory are created, and the system's ""OpenGL"" library is initialized. From here only ""OpenGL"" commands can be used to write to the graphics buffer. QB-like and console commands are forbidden. This mode allows to initialize ""OpenGL"" in a portable way.
- In DOS, Windowing and ""OpenGL"" related switches are not available, see also [[GfxLib GfxLib overview]]
Deletions:
##**Screenres**## 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 non-fullscreen modes, the resolution does not have to match any resolution of the graphics card. Resolutions like ##555x111## are possible, GfxLib will create a window of such size. See Platform differences for DOS issues.
In OpenGL modes a dumb window or fullscreen resolution is set, one or more buffers in standard memory are created, and the system's OpenGL library is initialized. From here only OpenGL commands can be used to write to the graphics buffer. QB-like and console commands are forbidden. This mode allows to initialize OpenGL in a portable way.
- In DOS, Windowing and OpenGL related switches are not available, see also [[GfxLib GfxLib overview]]


Revision [14550]

Edited on 2010-01-08 22:14:11 by DoS386 [updated, outsourced stuff to "GfxLib"]
Additions:
- In DOS, Windowing and OpenGL related switches are not available, see also [[GfxLib GfxLib overview]]
- ##[[KeyPgScreengraphics Screen]]## The QB-like way to set graphics mode
- ##[[KeyPgScreenlist Screenlist]]## Check display modes available for FB ""GfxLib"" to use
- ##[[KeyPgScreencontrol Screencontrol]]## Select driver and more
Deletions:
- In DOS the resolution must match one supported by the graphics card. GfxLib will try to find an appropriate mode from VGA modes, ""ModeX"" or VESA, preferring VESA LFB interface if available, or banked VESA otherwise. Windowing and OpenGL related switches are not available. Unsupported resolutions may currently crash the program, though in future GfxLib may try to find a close match instead. For optimal compatibility, you should support safe resolutions like 640x480 and 800x600, and maybe 1024x768. There are various additional modes like 768x576 around, but they are vendor specific and lacking on most cards. Also modes 1024x768 and above are not available on older cards and laptops.
- ##[[KeyPgScreengraphics Screen]]## The QB-like way to do
- ##[[KeyPgScreenCons Screen (Console)]]##
- ##[[KeyPgScreenlist Screenlist]]## Check available modes
- ##[[KeyPgScreencontrol Screencontrol]]##


Revision [14442]

Edited on 2009-08-29 21:57:01 by CountingPine [Remove CamelCase links in "New to FreeBASIC"]
Additions:
- New to ""FreeBASIC""
Deletions:
- New to FreeBASIC


Revision [13643]

Edited on 2008-08-02 15:59:29 by CountingPine [Default character size; width]
Additions:

The font size in ##**Screenres**## modes is set to 8x8 by default. This can be changed by setting the number of text rows/columns, using the ##[[KeyPgWidth Width]]## function.
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.
Deletions:
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.


Revision [13359]

The oldest known version of this page was created on 2008-05-11 09:11:31 by DoS386 [Default character size; width]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki



sf.net phatcode