Author Topic: Tutor_16 (C++ VS2022 GDImage64 tutorial)  (Read 98 times)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1965
    • zapsolution
Tutor_16 (C++ VS2022 GDImage64 tutorial)
« on: August 23, 2023, 08:21:50 am »
Sixteenth 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_16
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.

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.
The selected wallpaper is also used to change on the fly the texture for all 3D objects.

3D OpenGL animation
You can choose  between several FFP OpenGL 3D objects.
FFP means Fixed Function Pipeline, this refers to the set of configurable processing state present in older versions of OpenGL.
Thus they should work with any PC configuration.
Modern OpenGL are based on FBO (Framebuffer Objects), this is what the ObjReader 3D engine is using.

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.

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: September 05, 2023, 09:18:03 am by Patrice Terrier »
(Always working with the latest Windows version available...)