Here are my first tests with my FLTK-wrapper for AGK. The first sample program works as far as possible.
There is still very much to do until the first release. The main difficulty is to integrate the output window of AppGameKit into FLTK. I do not know if this is possible. Otherwise, the AppGameKit window must remain separate.
This is the code of the shown image.
// Project: Hello
// Created: 2017-04-28
#import_plugin FLTK_Wrapper As Fl
#include "./../Fl/FLTK_Constants.agc"
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "Hello" )
SetWindowSize( 1024, 768, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( 1024, 768 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 60, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts
window = Fl.MakeWindow(1,340,180, "FLTK-Window")
box = Fl.CreateBox(2,20,40,300,100,"Hello, here we are!")
Fl.SetBoxType(box, FL_UP_BOX)
Fl.SetLabelFont(box, FL_BOLD_ITALIC)
Fl.SetLabelSize(box, 27)
Fl.SetLabelType(box, FL_SHADOW_LABEL)
Fl.EndGroup(window)
Fl.WindowShow(window)
While(Fl.Wait())
Print( ScreenFPS() )
Sync()
EndWhile
Then there is the event system. I do not know yet how to do it best to make it easy to use. Since I also can not use callbacks in AGK.
My first thought would be - a kind of event stack that stacks all upcoming events since the last query. This is then requested manually via PollEvent until the stack is empty. Event information would be id of the widget and what event was triggered.
I am open to all suggestions.
The progress of the plugins will probably be very sluggish. I also work on a new AGK-IDE. This has a higher priority for me.