Basic standard graphics

Adam D. Ruppe destructionator at gmail.com
Sat Nov 13 08:18:26 PST 2010


spir wrote:
>  It's not  what I have in mind for my use cases. Rather,
> I would be in favor of a simple graphic frame that could
> be used like in good old times we used to draw
> directly on the video -- when this was easy to do,
> just using x,y pixel coordinates.

Absolutely, my craving for the good old DOS days is what
inspired my D1 game engine, and another little block of code
which I called "dimage".


It actually uses two helper C modules I wrote,
but it just calls the OS so it could be easily ported to raw D.

Here it is:

http://arsdnet.net/dcode/dimage/

The way it works is you draw a bitmap (or load it from a .bmp
file) then call the display method.

display calls out to win32 or X11 to pop up a window showing
the bitmap and blocks until the user hits any key to exit.


So it just shows an image quickly and easily. My plan with it
was simple image viewing or graph plotting. I never finished
it completely but you are free to take what I started there
and play with it if you like.


Note this code is really old. It doesn't compile on the new
dmd2 and it does a lot of copying... actually I shouldn't
throw this on people and expect them to fix it.


Is there interest in me fixing it myself and packing it as
one little D file? It is very simple: write raw pixels to
an array, call the function. It pops up and remains static
until the user presses any key to close it.


More information about the Digitalmars-d mailing list