Skip to content

Windows of BlitzPlus

Narta Xaymar Dirks edited this page Oct 31, 2026 · 1 revision

The windows of BlitzPlus

The original BlitzPlus makes its windows and gadgets from the controls of Windows. BlitzLLVM makes the windows from the windows of the operating system it runs on and draws the gadgets inside them with its own renderer, so the same program runs on Windows, Linux and macOS and looks the same on each.

Windows

  • Every top-level window (one whose group is the desktop) is a window of the operating system. The system draws its frame and its title bar, puts it in the task bar, and moves, sizes, minimizes and maximizes it; the program is told with the events $801 (moved), $802 (sized), $803 (close box) and $804 (activated), as in the original. Flag 1 of CreateWindow says whether the window has a frame and a title bar, flag 2 whether the user can size it, and a tool window (flag 16) stays in front of the window of Graphics.
  • Menu bars, status bars and every gadget are drawn by the runtime, in one look on every system. QueryObject gives a number for the window of the system, not a handle of the system.
  • Child windows (whose group is another window) are drawn inside their parent.
  • ActiveWindow is the window of the program that was activated last, by the user or by ActivateWindow; the system decides whether ActivateWindow may raise a window in front of other programs.

The window of Graphics

A program that calls Graphics has that window too, next to its own: it is where Flip, MouseX, KeyDown and the other commands of BlitzBasic look. Closing it does not end a program that made gadgets: it posts $803 with source 0, and the program decides. A quit signal of the system (Ctrl-C, the session ending) still ends the program. Graphics called after windows were made, or again with another size, keeps the windows.

A program that never calls Graphics opens exactly the windows it makes, nothing else, and runs until it ends. Print and Input go to the console then.

The desktop

Desktop is the primary display, in the units of the program (see below): windows are placed on it with the coordinates of the display. Nothing can be drawn on it or read from it, DesktopBuffer is a buffer of one black pixel.

Canvases

The buffer of a canvas has 32 bits of color (RGBA8) whatever depth Graphics has, and is drawn to by the same renderer as the back buffer, so Cls, the 2D commands, RenderWorld, CopyRect, ReadPixel and LockBuffer work in it the same way. FlipCanvas shows the window of the canvas right away through the window's own triple buffer: a program that never waits for events still shows its canvases, one that flips faster than the display shows the newest picture and never waits, and FlipCanvas c, 1 returns once the window has shown the picture. Flip shows the window of Graphics and leaves canvases alone. The buffer follows the size of the canvas and keeps its handle while the size stays.

Requesters and message boxes

RequestFile, RequestDir, Notify, Confirm and Proceed are the dialogs and message boxes of the operating system, in front of the program's active window. RequestColor and RequestFont are drawn by the runtime inside the active window (the window of Graphics where no window of the program is active) and answered by the mouse in that window and the keys from anywhere; they are simpler than the Windows dialogs, see RequestColor and RequestFont.

Displays with a high density of pixels

A window is scaled by the display it is on, as the windows of the original are scaled by Windows, only sharp: on a display at 150 % a window made 400 by 300 has 600 by 450 pixels and its gadgets and text are drawn one and a half times as big. The program keeps counting in its own units for the sizes and places of gadgets, the desktop, the mouse and the buffers of canvases; the picture of a canvas is enlarged when the window is drawn. WindowScale#(window) tells the scale of the display a window is on, and a program that wants to handle the DPI itself says WindowScaling 0: a unit is a pixel again, and every open window tells its scale in percent with the event $805, also when it moves to a display of another scale. BLITZLLVM_GUI_SCALE sets the scale by hand or turns it off, see DPI-Scaling.

Without a display

Where no window of the system can be made (BLITZLLVM_HEADLESS, or no window system) the windows are drawn inside the window of Graphics (1024 by 768 where the program made none) with a frame and a title bar of the runtime, and cannot leave it. A minimized window is a bar at the bottom of that window, a maximized one fills it. Dialogs answer with what is safe, or with BLITZLLVM_DIALOG_ANSWER.

For tests

The variables BLITZLLVM_TEST_WINDOW_SHOTS (saves what every window shows as a picture whenever it is drawn) and BLITZLLVM_TEST_EVENTS (presses keys and the mouse in a named window) let the tests of BlitzLLVM look at the windows and use them, see Environment-Variables. They can change at any time and are not for programs.

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally