simple display (from: GUI library for D)

Adam D. Ruppe destructionator at gmail.com
Fri Apr 8 18:45:20 PDT 2011


Michel Fortin wrote:
> One issue is that different operating system will draw things with
> slightly different algorithms, which will result in slightly different
>images, which might introduce glitches from platform to platform.

I actually hit an even bigger problem... Xlib can't actually draw
to XImages, and you don't have direct pixel access to XPixmaps
(it's the difference between being on the X Server and the client).

So, the lowest common denominator, using only system libraries, is
actually to allow *only* pixel access to Image, and move other
drawing over to the Window. (Specifically, a Painter struct that
ties to the window, so it can manage graphics contexts... yeah,
it's starting to get complicated again.)


What this means is if we want to draw to images, we've
got to spin our own algorithms. Which makes the different OS
algorithms moot - the direct screen drawing will be different, but
the images will all be the same. The downside is their functions
will lag a bit since I can't just wrap some C calls.


More information about the Digitalmars-d mailing list