Hello dudes,
i'm new to his forum. OS4coding seems really interesting.
I have only a little AOS coding experience, since in the past i left Amiga buy a PC (sigh). So i don't remember pratically nothing of my initial programming experience on Amiga. So forgive me for any strange and unexpected question.
First question:
Want to draw pixel randomly using a palette of 16M colors.
How can i realize this. I tried, but it's seems to me that colors are only few.
Moreover, it's possible to increase the line width when drawing?
Thank you very much
Hi, AmigaBlitter,
I don't think i can help you, but wellcome.
Maybe you should post your try to trigger more interesting answers
*BUMP*
@AmigaBlitter
I assume you are already familiar with pen-based drawing using rastports?
Drawing using direct ARGB values on a high-/true-color screen is not that much different.
Only instead of the SetAPen(), SetBPen() and SetOutlinePen() functions you have the tags RPTAG_APenColor, RPTAG_BPenColor and RPTAG_OPenColor that can be used together with the SetRPAttrs() function to specify colors as 32-bit ARGB.
Thank you
I will try.
It works! (kinda)
Does anyone knows a nice color wheel code or something to draw the colors spectrum in a good way?
Writing each pixel through a rastport is rather slow, isn't it.
It's better to write the RGB data into a buffer and then use WritePixelArray to draw it into the window in one go.
Here is an example: http://thomas-rapp.homepage.t-online.de/examples/colorwheel.c
@thomas
WritePixelArray() is a CGX function. On AmigaOS 4.x you should rather use p96WritePixelArray() or BltBitMapTags() with BLITA_SrcType set to BLITT_RGB24.
To be honest I don't care much what OS4 dictates. My code can be compiled and run without changes for OS3, OS4, MorphOS and AROS. If I used P96 I would lock out 70% of the systems (MorphOS, AROS and OS3 with CGX gfx card).
The code gyve me many cybergraph errors. Maybe my setup is different from your setup.
If i want to use Reaction and Intuition, what is the actual fastest way to plot pixels?
@AmigaBlitter
That's because the cgx header file is not included in the AmigaOS SDK (probably for legal reasons).
I've modified thomas' code so that it uses p96 calls when compiling for AmigaOS 4.x. You can get it here:
http://dl.dropbox.com/u/26599983/colorwheel.c
It should compile using just:
gcc -O2 -Wall -D__USE_INLINE__ -o colorwheel colorwheel.c -lauto
I also added a proto/graphics.h include directive which was missing from the code.
Thank you both for replying.
it's quite fast. One note: resizing the window cause some graphics glitches on the bottom line of the window as well as the left lefte edge, when i try to resize to fast.