Dear All,
This is a brief overview of the current status of the development of the GUI Toolkit NF.
One week after the start of the project, things are moving forward at a relatively good pace, considering that I do not spend that much time coding.
Right now, I am working on the foundation of the Toolkit, meaning the classes needed to properly interact with either the hardware and the main classes of the application.
The GUI Toolkit NF has reached an important milestone (in my development roadmap

) :
- the KeyManager class is now finished - all keys are correctly captured as well as transient events (Press and Release event)
- the MouseManager class is also now finished - cursor position and clicks are correctly captured as well as all arrow keys (*). As for KeyManager, all transient events for keys are also captured.
(*) as the arrow keys are physically linked to the touchpad, I was a bit concerned by the class to be used to track their status. I finally decided to use the MouseManager to be inline with the actual way of getting the information from the hardware and improve the performances.
- the two renderers used in the Toolkit, i.e. ScreenRenderer for on screen visual drawing and DepthBufferRenderer for off screen operations are working and are able to use both SDL and nGC.
We can choose the rendering mode by commuting a single #define preprocessing directive into a header file :
If SDL is used for rendering the primitive, we use :
- Code: Select all
//RENDER_MODE To be set to 1 if SDL is used as the renderer, and to 0 otherwise
#define RENDER_WITH_SDL 1
if nGC is chosen for rendering, we switch to :
- Code: Select all
//RENDER_MODE To be set to 1 if SDL is used as the renderer, and to 0 otherwise
#define RENDER_WITH_SDL 0
Quite easy, isn't it ?
Of course, this is a balance between performance / portability of code and size of the executable.
For example, the same application (very simple PoC as depicted by the following pictures) gives the following figures :
- compiled for use with SDL rendering : size of the executable : 280kb
- compiled for use with nGC rendering : size of the executable : 130kb
Visuals are very similar. This is the great part of my current job to have a sufficiently robust ScreenRenderer class able to perfectly translate the Toolkit Drawcalls either to SDL or nGC in a smooth way and without visual artefacts. Following are two pictures of the same program, compiled once for use with SDL and once for use with nGC.

As usual, the target is to get a simple way to code applications, so for the end user, it means a minimum code to write.
This simple app is coded with the following lines :
- Code: Select all
#include "ToolkitNF/GUIToolkitNF.hpp"
int main( void )
{
WidgetApplication::Initialize();
DesktopWidget* desktop = new DesktopWidget( "I am a Desktop", 0, 0, SCREEN_WIDTH_GUI, SCREEN_HEIGHT_GUI, nullptr );
ButtonWidget* button = new ButtonWidget( "Hello World !!!", 25, 25, 250, 20, desktop );
#if RENDER_WITH_SDL == 1
ButtonWidget* button2 = new ButtonWidget( "We are rendered with SDL", 25, 50, 250, 20, desktop );
#else
ButtonWidget* button2 = new ButtonWidget( "We are rendered with GC", 25, 50, 250, 20, desktop );
#endif
button2->Disable();
WidgetApplication::AddChild( desktop );
WidgetApplication::SetBackgroundPicture( "/documents/Widget/Wallpapers/002.bmp.tns" );
WidgetApplication::PrepareForRun();
while (!WidgetApplication::AskForClosure() && !button->IsPressed() )
{
WidgetApplication::Run( WidgetApplication::Normal );
}
WidgetApplication::Close();
return 0;
}
As you can read, the second button uses a condition to get its text content updated
Now the big part of my job is to convert all the code of all the widget of the GUI Toolkit (not NF) to the GUI Toolkit NF ... May be a bit long.
Ciao
Sly