You are not logged in.
Hi
I recently started developing some homebrew for my Wii, and my first little project is a painting program, that will enable my kids to paint on the TV by swinging the Wii-mote.
After having looked at various other programs that uses GRRLIB it's my impression that GRRLIB automatically does double buffering for us, and as a part of this job clears the appropriate buffer after calling Render(). However, for my little painting program I would like the graphics (the stuff that already has been painted) to "stay" on the screen - like on a real canvas.
I was thinking about one of these two options, but I'm not sure how to do it using GRRLIB:
1) Set a switch somewhere, that will disable clearing of buffer after the call to Render().
2) Copy what has been drawn so far (just before I call Render()) into a buffer of my own, and then "draw" this buffer first thing after the call to Render().
I hope it makes sense, and that someone can help me. Anyways, thank you VERY much for a great library!
Kind regards,
Flarup
Offline
have a look at the svn there is a screen2texture function
http://code.google.com/p/grrlib/source/list
Offline
Thanks a lot. It ALMOST works However, everything fades to black for some reason?!? Right after the call to Render() I copy the buffer back onto the screen using the following command:
GRRLIB_DrawImg(0, 0, myBuffer, 0, 1, 1, 0xFFFFFFFF);
Isn't this the right way to copy the buffer back?
Offline
That's how I'm doing it, if you want to see my code it's available here: http://wiibrew.org/wiki/Wii-Tac-Toe
Offline
I still have problems getting the graphics to stay on the screen - it fades away after a few seconds I've made a tiny example, where I in the beginning draw a big white rectangle on the screen. In my main loop I then copy the screen to buffer, call Render, and finally copy buffer back to screen. I would expect the result to be, that the big white rectangle would just stay on the screen - however, it faces to black. Can anyone see what I'm doing wrong?
Source code here:
http://www.flarup.org/main.cpp
Thanks a lot in advance.
Offline
dear flarup
the bug you have is already known by the grrlib dev, in fact the FB is in a strange format YbCbr or something like this. when you call screentotexture, GX convert the FB to a RGBA texture format (loosing a little precision), so looping this process will tend to fade to black, i coded a sample code (in the svn) to show ppl this effect, i hope a workaround or something quick.
perhaps a correction in the converted texture buffer will correct this... dunno more for now...
Offline
Thanks a lot for the explanation.
I'll go ahead and modify my code, such that my painting is done directly to the texImg buffer, and then I copy this buffer to the screen before the call to render. This also saves a bunch of memory copying.
Offline
yes you can do it easily with GRRLIB_SetPixelTotexImg for now, we hope providing something better soon.
btw drawing to a buffer then render it to FB is how worked grrlib 1.X version
Offline