Recent Posts

Pages: [1] 2 3 ... 10
The concept / Tutor_01 (C++ VS2022 GDImage64 tutorial)
« Last post by Patrice Terrier on Today at 08:45:28 am »
First post of a serie, translated from the "WinDev tutorial",
to explain the use of GDImage64 in procedural* programming mode with Visual Studio 2022.

About Tutor_01
This is a GDImage "Hello World" project, based on "Programming Windows" by Charles Petzold.

All the child controls are created in the CreateControls() procedure.
Among them, CreateWindowExW(0, GDImageClassName, Resource((WCHAR*) L"paintbrush.png"), ...), is the one used by every GDImage container.
Resource((WCHAR*) L"paintbrush.png"), means use this image to paint the background of the control, it works like the desktop wallpaper background in Windows.

If the size of the image is larger that the window, then scrollbars are used to move the content.
This is shown in context when you press the "Capture screen" button,
and GDImageCaptureScreen() is the code that performs the capture.

You can also use a gradient to paint the background with
        // Use a GDImage gradient color to paint the background
        ZI_SetProperty(hCtrl, ZI_GradientTop, ZD_ARGB(255, 0,0,64));
        ZI_SetProperty(hCtrl, ZI_GradientBottom, ZD_ARGB(255, 0,240,255));

So far the Status Bar is not used.

All child controls are anchored within the main window using the ZI_SetAnchorMode API, and the appropriate ANCHOR_PROPERTY.

Last but not least,
the size of the standalone binary EXE is only 15 Kb, because we use only direct call to the core FLAT API, and get rid of external dependencies, and huge dotNET framework. It is what they call "unmanaged code", but WE are the programmers aren't we?

* procedural programming mode, is based on direct use of the FLAT API (Windows SDK) that is the core meat of the OS.
64-bit SDK programming / OpenGL texture animation
« Last post by Patrice Terrier on June 02, 2023, 11:42:05 am »
This C++ 64-bit Visual Studio 2022 demo, is the transcription of a WinDev project writtten in 2021,
and posted on the PC-Soft repository here:;glimage-opengl-textures

The animated textures are stored in \X64\Release\resource folder

As soon as you start OpenGL programming, it is essential to be able to use quality textures.
Mipmapping, variable opacity, anti-aliasing are all techniques used to produce professional quality 3D renderings.
GDImage supports all of these techniques to produce textures of any size, from the following image formats:
tga, dds, bmp, tif, tiff, dib, gif, ico, jpg, jpeg, png.

You can change the texture on the fly using Explorer's drag and drop.
The window has 2 textures, one for the fixed background and the other opaque or using variable opacity which can be manipulated with the mouse.

Note: The default texture is using a GDImage PNG animation.

64-bit SDK programming / Splash Screen Plus
« Last post by Patrice Terrier on May 25, 2023, 11:33:07 am »
This GDImage64 project has been converted from WinDev to C++.
It uses a layered window to render GDImage PNG animation, altogether with multiple sprite effects.

The 64-bit code has been optimized to fit within a very small 16384 bytes executable.
Using specific project properties based on the TClib.lib (Tiny C Lib) to replace the default Visual Studio setup.

To start the demo, click on the "On Off" button, then select either next (>>) or prev (<<) to change of splash screen.
To stop the demo, press the close button (X).

Other links about GDImage PNG animations

About the PowerBASIC version
This is the exact transcription of the C++ 64-bit project.
A good example, showing how the core SDK syntax can ease the conversion from one language to another

The 64-bit C++ version is using Unicode, while the 32-bit is using Ansi.
Both resulting EXE size are rather small, 18 Kb for PowerBASIC 32-bit, and 13 Kb for C++ 64-bit.


Tips & Tricks / Charles Petzold 5e edition
« Last post by Patrice Terrier on May 24, 2023, 09:31:27 am »
For those wanting to learn the core SDK FLAT API
Here is the best book ever written about Windows programming.

Ho I didn't see these videos ! my bad ! I'm going to watch them !

EDIT : Yes I've already seen the first one :) but didn't see the second.

I already download the trial version on the site that's the demos I look at :)

EDIT 2 : In fact most of the examples I looked at use the SDK approach. For now I search for more examples with the DDT approach. PowerBasic is new for me, that's why I try for now to use the stock approach with some libs. I should experiment myself may be.
Have you seen these videos?

You can also download the old demos provided with the PowerBASIC GDImage 5.00 trial version
Please apologize for the double post. I look at this lib and examples. I miss some basic skeleton to understand how it works. The documentation is good but a mini skeleton  shows how to implement it could be great.
The 3D Model Collection / Mercedes 300 SL roadster 1957
« Last post by Patrice Terrier on May 22, 2023, 04:10:48 pm »
The original model has been posted on Sketchfab by Mr. Bullet (license CC-BY 4.0).

It has been converted and reworked to use a specific ObjReader texture set, and custom materials.

La démo est excellente, il faut que je regarde comment tu l'utilises avec PB pour que j'essaye. WinDEV je connais de nom mais jamais eu l'occasion d'essayer étant donné que c'est surtout pour les entreprises, la licence n'est pas pour tout le monde. C'est intéressant de voir effectivement l'implémentation.
Je dois avoir l'exemple en PowerBASIC 32-bit et également en WinDev 17.

La comparaison des codes sources est un bon moyen d'apprendre la FLAT API qui est le seul point commun de tous les langages.
Pages: [1] 2 3 ... 10