home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Computer Panoráma
/
computer_panorama_1997-12-hibas.iso
/
SHARE
/
GRAPH
/
PTC051.ZIP
/
EXAMPLES
/
RAND16.TXT
< prev
next >
Wrap
Text File
|
1997-09-04
|
2KB
|
48 lines
=================================
= random 16bit putpixel example =
=================================
Overview
--------
This example draws random pixels to a 16bit RGB565 system memory surface
and updates this surface to the display - converting to the output format
if necessary. It demonstrates working in "virtual 16bit" with fuzzy
16bit mode setting.
NOTE: When from now on when i say "16bit" i mean "16bit RGB565" the major
16bit pixel format supported in PTC.
FUZZY16
-------
FUZZY16 means "a mode close to 16bit". When FUZZY16 is specified the mode set
attempts to set output formats in the following order:
1. RGB565 (16bit)
2. BGR565 (16bit)
3. ARGB1555 (16bit "15bit")
4. ABGR1555 (16bit "15bit")
5. RGB888 (24bit)
6. BGR888 (24bit)
7. ARGB8888 (32bit)
8. RGBA8888 (32bit)
9. BGRA8888 (32bit)
10. ABGR8888 (32bit)
11. FAKEMODE2A (emulated truecolor)
Note that this order is different to the order of a FUZZY32 modeset. When you
want to work virtually in 16bit, make sure you specify FUZZY16 explicity:
"PTC ptc(320,200,FUZZY16)" because if you just go: "PTC ptc(320,200)" it
defaults to FUZZY32, which is not efficient when you are working virtually
in 16bit.
Finally, the function RGB16 used to pack the pixel in is just the 16bit RGB565
equivalent of the RGB32 function used in rand32. It simply packs three color
chars r,g,b into a packed 16bit word.