Creating a window in the window manager. When setting a parameter in a template, it can create both its regular version and with hardware graphics acceleration.
Graphics context creation interface for hardware graphics acceleration.
Window interaction interface. It does not provide its creation, it is created by a separate function within the interface implementation, in particular the initialize function.
With the creation of a graphical context.
Without creating a graphical context.
Graphics attributes for creating a special graphics pipeline (default parameters are indicated in the structure).
Automatic determination of the structure of graphic attributes by the total size of the color unit.
First of all, creating a window begins with allocating memory and setting the input parameters:
Window window = new Window(640, 480, "Example title");
Only input parameters are set in the constructor, this does not mean that the window is ready for use. Here only the initial width, height and title of the window are set. Other properties do not affect creation, everything is done after the window is created.
The window is created by the windowInitialize function:
windowInitialize(window, 100, 100); ... window.windowInitialize(100, 100); // UFCS
Now, you can interact with the window or create a graphics context to access hardware acceleration. To do this, again, allocate the mod memory for the context collector and create a structure with a description of the context properties:
Context context = new Context(); // We just set the parameters by color. Each color will weigh 8 bits. GraphicsAttributes attributes = AttribBySizeOfTheColor!8; context.setAttributes(attributes); context.create(window); // We set the current context to the window. window.context = context;
Now you will have access to hardware acceleration according to the attributes you specified, what you can do next is load open graphics libraries and start drawing primitives. To display primitives on the screen, use the function.
It may be that the built-in tools are not enough and you need, say, to change some properties that other platforms cannot do. For this, each object has an open handle field. Getting it is easy, however, be careful with what you do with it. You can do such things that the interaction interface after your manipulations will not be able to control it. To do this, it is enough not to change the properties that can be controlled by the interaction interface.
Copyright (c) 2020 - 2021, TodNaz.
Implementation of cross-platform creation and management of a window.
Also, at the same time, it is possible to create a graphical context for the window to be able to use hardware acceleration using a common open API - OpenGL.