Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2011-03

IMGUI example

8 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Unknown author

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110330/518d1222/attachment-0001.html> -------------- next part --------------
A non-text attachment was scrubbed...
Name: imgui.zip
Type: application/zip
Size: 8862 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110330/518d1222/attachment-0001.zip>

Darius Blaszyk
to Unknown author

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

Show quoted text 12 lines
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 http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110330/5654edd2/attachment.html>

Darius Blaszyk
to Darius Blaszyk

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

Darius

Darius Blaszyk wrote 32 lines
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, 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 > > http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110330/8f0c4122/attachment-0001.html>

Mattias Gaertner
to Darius Blaszyk: Just tried on the mac mini. The demo runs up to 1000FPS which is the limit of what I can…
[...] 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

Mattias Gaertner
to Unknown author: ZeelandNet Webmail Here's a nice demo which I reworked to FPC/Lazarus of an IMGUI…
Show quoted text 14 lines
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

Darius Blaszyk
to Mattias Gaertner: On Wed, 30 Mar 2011 15:52:57 +0200 The Key parameter is the virtual key code. How can a…
Mattias Gaertner wrote 14 lines
On Wed, 30 Mar 2011 15:52:57 +0200 Darius Blaszyk 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

Graeme Geldenhuys
to Darius Blaszyk
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/
Michael Schnell
to Graeme Geldenhuys
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 ;) )