ScreenRes
 
Initializes a graphics mode by specifying horizontal and vertical resolution

Syntax

ScreenRes width As Integer, height As Integer, depth As Integer = 8, num_pages As Integer = 1, flags As Integer = 0, refresh_rate As Integer = 0

Usage

ScreenRes width, height [, [depth] [, [num_pages] [, [flags] [, refresh_rate ]]]]

Parameters

width, height
The display width and height, respectively. For fullscreen mode, the user should check the availability of the resolution using 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^depth colors of the 256-color palette used in 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 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)

Description


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 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 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 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 Screen (Graphics) keyword.

Example

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


Platform Differences

  • In DOS, Windowing and OpenGL related switches are not available, see also GfxLib overview

Dialect Differences

  • Not available in the -lang qb dialect unless referenced with the alias __Screenres.

Differences from QB

  • New to FreeBASIC

See also

Сайт ПДСНПСР. Если ты патриот России - жми сюда!


Знаете ли Вы, что любой разумный человек скажет, что не может быть улыбки без кота и дыма без огня, что-то там, в космосе, должно быть, теплое, излучающее ЭМ-волны, соответствующее температуре 2.7ºК. Действительно, наблюдаемое космическое микроволновое излучение (CMB) есть тепловое излучение частиц эфира, имеющих температуру 2.7ºK. Еще в начале ХХ века великие химики и физики Д. И. Менделеев и Вальтер Нернст предсказали, что такое излучение (температура) должно обнаруживаться в космосе. В 1933 году проф. Эрих Регенер из Штуттгарта с помощью стратосферных зондов измерил эту температуру. Его измерения дали 2.8ºK - практически точное современное значение. Подробнее читайте в FAQ по эфирной физике.

НОВОСТИ ФОРУМАФорум Рыцари теории эфира
Рыцари теории эфира
 10.11.2021 - 12:37: ПЕРСОНАЛИИ - Personalias -> WHO IS WHO - КТО ЕСТЬ КТО - Карим_Хайдаров.
10.11.2021 - 12:36: СОВЕСТЬ - Conscience -> РАСЧЕЛОВЕЧИВАНИЕ ЧЕЛОВЕКА. КОМУ ЭТО НАДО? - Карим_Хайдаров.
10.11.2021 - 12:36: ВОСПИТАНИЕ, ПРОСВЕЩЕНИЕ, ОБРАЗОВАНИЕ - Upbringing, Inlightening, Education -> Просвещение от д.м.н. Александра Алексеевича Редько - Карим_Хайдаров.
10.11.2021 - 12:35: ЭКОЛОГИЯ - Ecology -> Биологическая безопасность населения - Карим_Хайдаров.
10.11.2021 - 12:34: ВОЙНА, ПОЛИТИКА И НАУКА - War, Politics and Science -> Проблема государственного терроризма - Карим_Хайдаров.
10.11.2021 - 12:34: ВОЙНА, ПОЛИТИКА И НАУКА - War, Politics and Science -> ПРАВОСУДИЯ.НЕТ - Карим_Хайдаров.
10.11.2021 - 12:34: ВОСПИТАНИЕ, ПРОСВЕЩЕНИЕ, ОБРАЗОВАНИЕ - Upbringing, Inlightening, Education -> Просвещение от Вадима Глогера, США - Карим_Хайдаров.
10.11.2021 - 09:18: НОВЫЕ ТЕХНОЛОГИИ - New Technologies -> Волновая генетика Петра Гаряева, 5G-контроль и управление - Карим_Хайдаров.
10.11.2021 - 09:18: ЭКОЛОГИЯ - Ecology -> ЭКОЛОГИЯ ДЛЯ ВСЕХ - Карим_Хайдаров.
10.11.2021 - 09:16: ЭКОЛОГИЯ - Ecology -> ПРОБЛЕМЫ МЕДИЦИНЫ - Карим_Хайдаров.
10.11.2021 - 09:15: ВОСПИТАНИЕ, ПРОСВЕЩЕНИЕ, ОБРАЗОВАНИЕ - Upbringing, Inlightening, Education -> Просвещение от Екатерины Коваленко - Карим_Хайдаров.
10.11.2021 - 09:13: ВОСПИТАНИЕ, ПРОСВЕЩЕНИЕ, ОБРАЗОВАНИЕ - Upbringing, Inlightening, Education -> Просвещение от Вильгельма Варкентина - Карим_Хайдаров.
Bourabai Research Institution home page

Боровское исследовательское учреждение - Bourabai Research Bourabai Research Institution