Fifteenth post of a series, translated from the "WinDev and PowerBASIC",
to explain the use of GDImage64 in
procedural* programming mode with Visual Studio 2022.
About Tutor_15This is a C++ transcription of a PowerBASIC demo written in 2009 with the official release of
GDImage 5.00.
It was the first version able to mix 2D and 3D OpenGL into the same graphic control.
The application itself is skinned with WinLIFT, and share the same background wallpaper with all child controls.
WallpaperYou can change them on the fly, by cliking on the top-left icon with either the left or right mouse button.
The wallpaper images are stored in the "
Resource\Background" sub-folder.
3D OpenGL animationThe
compass is using a spherical texture named "
graduation.jpg" from the "Resource" folder.
You can change its orientation with the "
Rotation" trackbar slider.
The "
DrawObject3D" is the procedure where we render the OpenGL object.
It is converted on the fly in a sprite bitmap (IDS_3DOBJECT) inside of "
RenderAnimation".
Custom controlsThey are skinned on the fly using the WinLIFT
skSkinChildCtrl() API.
All labels are created with the
skSetLabelFont() API using a private font, this ensures the GUI looks always the same on every computer.
Linked sprite objectsAll the sprites are linked together with the
ZD_SetObjectLinked() API, to create a single entity that can be moved around holding down the left mouse button inside of the GDImage graphic control.
SettingsThe user interface allows you to change on the fly many of the
ZOBJECT sprite properties.
GDImage 7.16Is an experimental version converted to VS2022, with a new API named "
ZD_GLtoBitmap" to dynamically turn the OpenGL context into a ZOBJECT sprite bitmap (see the
RenderAnimation() procedure).
Last but not least,
the size of the standalone binary EXE is only
22 Kb.
*
procedural programming mode, is based on direct use of the FLAT API (Windows SDK) that is the core meat of the OS.