simple display (from: GUI library for D)

Michel Fortin michel.fortin at michelf.com
Mon Apr 11 05:00:43 PDT 2011


On 2011-04-10 17:39:03 -0400, KennyTM~ <kennytm at gmail.com> said:

> On Apr 9, 11 04:26, Adam D. Ruppe wrote:
>> We discussed this first in the GUI library thread, but since it
>> meandered so much, I decided to split off into a new subject. Much
>> of what I say here will be old to anyone who saw the previous thread.
>> There's some new stuff nearer to the bottom though.
>> 
>> I, with input from others, have started writing a little module
>> for simple uses of a display. You can write to a bitmap, display it
>> to a window, and handle events all in an easy way. The basics are
>> cross platform, but you can use native function calls too.
>> 
>> http://arsdnet.net/dcode/simpledisplay.d
>> 
>> It's still very much in progress, but I think it's now at the point
>> where the direction I'm taking it is clear.
>> 
> [snip]
> 
> Thanks for the great work!
> 
> Taking the version on that link, I have ported it to use the native 
> Cocoa/Core Graphics in OS X, instead of X11. You can check out the diff 
> in https://github.com/kennytm/simpledisplay.d/commit/a790.

Nice, you're the second one to do that. :-) (I made a Cocoa port of the 
earlier version when all there was to do was image.display(), but I 
didn't release the code.)

The major difference between our approaches is that I made it by 
putting Objective-C code in a separate Objective-C file instead of 
doing that objc_msgSend boilerplate directly in D.


> Only Snow Leopard (10.6) is supported.
> 
> I have only tested that it works on the pendulum example and the HSL 
> picker, so things like drawText and drawPixel may not work properly 
> yet. The implementation part is quite messy right now due to 
> Objective-C.

Ideally we'd be using the extern(Objective-C) syntax I'm working on, 
but I still have polishing to do on that thing before it's ready to be 
integrated in mainline DMD (and then it'll probably take some time 
before Walter reviews and applies the pull request) so it's not an 
option right now.


-- 
Michel Fortin
michel.fortin at michelf.com
http://michelf.com/



More information about the Digitalmars-d mailing list