Name : RgbRenderer V0.1
Coded by NoNameNo  (nonameno@seci-fr.com)

what is RgbRenderer ?
RgbRenderer is a kind of library to help people wanting to START coding C on wii.

Is RgbRenderer very good coded and optimised ?
NO ;)

Why RgbRenderer ?
In fact all started when i wanted to port some of my old demo effect. I discovered that the wii video RAM use a "strange" format called Y1CbY2Cr.
This format is able to embed 2 pixel color definition in only 32bits. so all Pixels goes by two. so when you want to only light one you need to
know if it is on a odd or even X, then encode it with the one before or after it (depend odd or even) in Y1CbY2Cr. pfffff......
More over if you want to know the color of a pixel, you have to do the same reversed ..... re pffffff....
when you code in this format you allocat an array of 320*480 (u32) often called xfb in "hello world" example around. why 320 ?? remember 2 pixels for a u32 ;)
you fill your xfb array and you make it appear at screen at a certain signal called VBL.
i had a little reflexion about this method, video memory is Y1CbY2Cr, we use a Y1CbY2Cr array to prepare our drawing then display it.
and here is my "little" idea.
why not handle a RGB array ?? then at the VBL, convert the whole array to Y1CbY2Cr format, then push to xfb ;)
i was very septic at start, coz converting a whole screen to 640*480 pixel to Y1CbY2Cr format 50/60 per secondes was a real challenge ;)
and it was coz the converter i coded only do 1/4 of a screen per vbl.... BUT i found a kind of coded that do the job really quick !!!
a whole screen is ok per vbl depending of what other job you add.

What are the provided function with RgbRenderer ?

	void RgbFillScreen(unsigned char R, unsigned char G, unsigned char B);
	  Fill the Whole RGB array with the provided R,G,B Color

	void RgbPutPixel(int x,int y,unsigned char R, unsigned char G, unsigned char B);
	  Put a Pixel of R,G,B color at the x and y place in the RGB Array
	
	void RgbLine(short int x1, short int y1, short int x2, short int y2, unsigned char R, unsigned char G, unsigned char B);
	  Trace a line from x1,y1 to x2,y2 of the R,G,B color in the RGB Array	

	void RgbRectangle(short int x1, short int y1, short int x2, short int y2, unsigned char R, unsigned char G, unsigned char B);
	  Trace a rectangle from x1,y1 to the opposite angle x2,y2 of the R,G,B color in the RGB Array
	
	void RgbRenderScreen();
	  Convert the whole RGB Array to Y1CbY2Cr format and display it.
	
	unsigned _rand(unsigned long MAX);
	  a tiny rand function (dunno why i keep it in RgbRenderer ?? ;) )

What are the example you provide with this package ?

        - 00_What_Is_This       : * This Stuff ;)

        - 01_lesson             : * Learn how to fill the whole screen with a specified RGB color
                                  * Learn how to Set a single pixel color
                                  * Learn how to do your first rgb rendering

        - 02_lesson             : * Learn how to simply draw a line

        - 03_lesson             : * Learn how to draw a simple Rectangle

        - 04_lesson             : * How to display an image

        - 05_lesson             : * Use paddle to Move an image

        - 99_intro              : * A little intro coded with all you see above ;) (starfield + sinlogo + 3d + scrolltext)

	- moulinette		: some php(cli) tools to convert your images.

how your "moulinette" work ?
      use php (cli) to use them :
       php gfxconvertor.php your_image_file_without_the_png_extension
       php fontconvertor.php your_font_image_file_without_the_png_extension charset_high charset_width
     ps: use only png RGB no interlaced image.

Can i help ? How can can you contribute ?
you can send me some new primitive function you coded that you think that can be added
like a draw circle function, etc....
or you can optimize the already coded one ;)

Go Go Go and provide some stuff to make growing RgbRenderer ;)





