[Lazarus] IMGUI example

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

[Lazarus] IMGUI example

Darius Blaszyk
ZeelandNet Webmail
Hi,

Here's a nice demo which I reworked to FPC/Lazarus of an IMGUI implementation. An IMGUI is a different approach to implementing a widget toolkit and may be of interest in some applications. Additionally I included a port of a vector font library for OpenGL.
The demo is very fast (>60FPS on a low end laptop). For now this was only tested on win32 but I'm confident that it will run on any platform without issues as it's native pascal all over. I would welcome it if it could be included as an example for the OpenGLContext component.

Regards, Darius

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

imgui.zip (11K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] IMGUI example

Darius Blaszyk
Just tried on the mac mini. The demo runs up to 1000FPS which is the limit of what I can measure. How nice to have hardware acceleration.... 

One more thing tho, there seem to be a some bugs with key handling. 

1) OnKeyPress, OnKeyDown and OnKeyUp are not fired for TOpenGLControl on win32 but are fired on mac
2) OnKeyDown and OnKeyUp for TForm always give an uppercase value for the key, only OnKeyPress gives the correct character (lower or uppercase) for win32. On Mac however I got the right value for the key that fired the method each time.

Are these known issues? I googled a bit and looked on the bug tracker but couldn't find anything related. Just try the demo I sent to see if this can be confirmed. On win32 I used a lazarus snapshot (2.4.3) no more than a couple of days old.

Regards, Darius


On Mar 30, 2011, at 1:45 PM, <[hidden email]> <[hidden email]> wrote:


Hi,

Here's a nice demo which I reworked to FPC/Lazarus of an IMGUI implementation. An IMGUI is a different approach to implementing a widget toolkit and may be of interest in some applications. Additionally I included a port of a vector font library for OpenGL.
The demo is very fast (>60FPS on a low end laptop). For now this was only tested on win32 but I'm confident that it will run on any platform without issues as it's native pascal all over. I would welcome it if it could be included as an example for the OpenGLContext component.

Regards, Darius
<imgui.zip>--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] IMGUI example

Darius Blaszyk
I checked linux, and there the OnKeyXX also works correct. So this seems to be a win32 specific thing.

Darius


On Mar 30, 2011, at 3:52 PM, Darius Blaszyk wrote:

Just tried on the mac mini. The demo runs up to 1000FPS which is the limit of what I can measure. How nice to have hardware acceleration.... 

One more thing tho, there seem to be a some bugs with key handling. 

1) OnKeyPress, OnKeyDown and OnKeyUp are not fired for TOpenGLControl on win32 but are fired on mac
2) OnKeyDown and OnKeyUp for TForm always give an uppercase value for the key, only OnKeyPress gives the correct character (lower or uppercase) for win32. On Mac however I got the right value for the key that fired the method each time.

Are these known issues? I googled a bit and looked on the bug tracker but couldn't find anything related. Just try the demo I sent to see if this can be confirmed. On win32 I used a lazarus snapshot (2.4.3) no more than a couple of days old.

Regards, Darius


On Mar 30, 2011, at 1:45 PM, <[hidden email]> <[hidden email]> wrote:


Hi,

Here's a nice demo which I reworked to FPC/Lazarus of an IMGUI implementation. An IMGUI is a different approach to implementing a widget toolkit and may be of interest in some applications. Additionally I included a port of a vector font library for OpenGL.
The demo is very fast (>60FPS on a low end laptop). For now this was only tested on win32 but I'm confident that it will run on any platform without issues as it's native pascal all over. I would welcome it if it could be included as an example for the OpenGLContext component.

Regards, Darius
<imgui.zip>--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] IMGUI example

Mattias Gaertner
In reply to this post by Darius Blaszyk
On Wed, 30 Mar 2011 15:52:57 +0200
Darius Blaszyk <[hidden email]> wrote:

>[...]
> 2) OnKeyDown and OnKeyUp for TForm always give an uppercase value for the key,

The Key parameter is the virtual key code.


> only OnKeyPress gives the correct character (lower or uppercase) for win32. On Mac however I got the right value for the key that fired the method each time.

How can a virtual key code give upper or lower case? Maybe you mean
ssShift is not set correct in the Shift parameter under Windows?


Mattias

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] IMGUI example

Mattias Gaertner
In reply to this post by Darius Blaszyk
On Wed, 30 Mar 2011 13:45:54 +0200
<[hidden email]> wrote:

>    ZeelandNet Webmail  
>
> Hi,
>
> Here's a nice demo which I reworked to
> FPC/Lazarus of an IMGUI implementation. An IMGUI is a different approach
> to implementing a widget toolkit and may be of interest in some
> applications. Additionally I included a port of a vector font library
> for OpenGL.
> The demo is very fast (>60FPS on a low end laptop). For now
> this was only tested on win32 but I'm confident that it will run on any
> platform without issues as it's native pascal all over. I would welcome
> it if it could be included as an example for the OpenGLContext
> component.

Thanks. Added.


Mattias

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] IMGUI example

Darius Blaszyk
In reply to this post by Mattias Gaertner

On Mar 30, 2011, at 8:26 PM, Mattias Gaertner wrote:

> On Wed, 30 Mar 2011 15:52:57 +0200
> Darius Blaszyk <[hidden email]> wrote:
>
>> [...]
>> 2) OnKeyDown and OnKeyUp for TForm always give an uppercase value for the key,
>
> The Key parameter is the virtual key code.
>
>
>> only OnKeyPress gives the correct character (lower or uppercase) for win32. On Mac however I got the right value for the key that fired the method each time.
>
> How can a virtual key code give upper or lower case? Maybe you mean
> ssShift is not set correct in the Shift parameter under Windows?
>

I didn't realize they were VKs. It makes sense now. Still however there is some strangeness.

The TForm.OnKeyDown method is only executed once on Mac. On win32 it is executed all the time, but then again the TOpenGLControl1.OnKeyDown is not executed on win32 but works on Mac.

Regards, Darius
--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] IMGUI example

Graeme Geldenhuys
On 30/03/2011 21:00, Darius Blaszyk wrote:
>
> The TForm.OnKeyDown method is only executed once on Mac. On win32 it
> is executed all the time, but then again the
> TOpenGLControl1.OnKeyDown is not executed on win32 but works on Mac.


Welcome to GUI toolkit design. :-)



Regards,
   - Graeme -

--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/


--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] IMGUI example

Michael Schnell
On 03/31/2011 09:12 AM, Graeme Geldenhuys wrote:
>
> Welcome to GUI toolkit design. :-)
Yet another re-implementation of TTimer,  TThread.Synchronize,
PostMessage, TApplication.QueueAsyncCall etc is due..

-Michael (could not resist ;) )

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus