Author Topic: Tutor_15 (C++ VS2022 GDImage64 tutorial)  (Read 3524 times)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1984
    • zapsolution
Tutor_15 (C++ VS2022 GDImage64 tutorial)
« on: August 18, 2023, 02:11:09 pm »
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_15
This 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.

Wallpaper
You 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 animation
The 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 controls
They 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 objects
All 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.

Settings
The user interface allows you to change on the fly many of the ZOBJECT sprite properties.

GDImage 7.16
Is 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.
« Last Edit: August 19, 2023, 02:16:56 pm by Patrice Terrier »
Patrice
(Always working with the latest Windows version available...)