[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] Bit-Depth and Graphics stuff....



7 jul 2010 kl. 01.16 skrev m0n0:

> 
> Am Mittwoch, den 07.07.2010, 00:56 +0200 schrieb Peter Persson
> <pep.fishmoose@gmail.com>:
> 
>> What exactly do you mean by "support 16bit natively"? Even the built-in
>> VDI TOS-VDI in the Falcon works in 16-bit modes.
> 
> Yes, the screen output works, but the VDI color definiton is to small to
> use 32 bit values. And I think it's doesn't even support 16 bits.
> VDI's definiton of an color is: "an index into an palette". So I'm limited
> to use the colors of this palette. I expect the numbers of colors to be
> very low...
> an 16bit / 32bit Gfx card will offer much more colors than the VDI
> palette.

Ah, well - in a sense yes - but not quite!

You're right in the sense that the number of VDI pens is limited to 256, but you only use those pens for drawing primitives (i.e. lines, text etc). The colour definition for each of those pens is nearly 30 bits (1000*1000*1000 theoretical colours). However, you don't use pens to convert/blit graphics which should be displayed on screen!

You just need to know the pixel format of the current screen. Then you render your stuff to a buffer using that pixel format. When redrawing the window contents, you blit from that buffer to the screen.

>> The only tricky thing is the pixel format detection. What kind of
>> functionality are you talking about?
> 
> put_pixel(32bit_color_value, x, y) 
> and 
> put_pixel(24bit_color_value, x, y)
> and
> put_pixel(16bit_color_value, x, y) 
> and so on....

Put pixel use VDI pens (see above). Put pixel is an expensive operation since a zillion instructions are executed just to set a single pixel. Use it if you have to, but I would avoid it if possible.

best regards

-- PeP