You are not logged in.
Hi,
If i make more than 3 Draws before the Render the screen remains black.
This is my Code:
int printLoadingBar(const char* msg, const f32 percent) { GRRLIB_DrawImg(0, 0, tex_background_jpg, 0, 1, 1, 0xFFFFFFFF); GRRLIB_DrawImg(256, 112, tex_Refreshicon_png, 0, 1, 1, 0xFFFFFFFF); GRRLIB_PrintfTTF((640-strlen(msg)*9)/2, 256, myFont, msg, 20, 0x00000000); GRRLIB_DrawPart(52, 342, 0, 0, floor(536/100*percent), 36, tex_loadingbarblue_png, 0, 1, 1, 0xFFFFFFFF); GRRLIB_DrawPart(52+floor(536/100*percent), 342, floor(536/100*percent), 0, 536-floor(536/100*percent), 36, tex_loadingbargrey_png, 0, 1, 1, 0xFFFFFFFF); GRRLIB_Render(); // Render the frame buffer to the TV return 0; }
That doenst work.
But if I remove for example this line:
GRRLIB_DrawImg(256, 112, tex_Refreshicon_png, 0, 1, 1, 0xFFFFFFFF);
It works perfectly.
But the same line alone also works.
The total size of the images is 341KB that should be ok, right?
Offline
Double_A wrote:
The total size of the images is 341KB that should be ok, right?
There is no problem with size on the hard drive, but what is the actual size (width and height) of your image?
Does your png uses a palette or is it 24/32bits?
Offline
The biggest image is 640x480.
All the other images are smaller and all Pixel are divisible by 4.
And the bit depth is 32 for pngs and 24 for jpgs... Is that the problem?
And I dont know what you mean by "palette"...
Offline
Your images seems ok, so it must be something with your code. But I have no idea Could it be possible to put your whole project in download so I can debug it?
If you need more info on the word palette: http://en.wikipedia.org/wiki/Palette_%28computing%29
Offline
Hi,
This is the source.
http://www.mediafire.com/?q8onyx9wdov8b15
Pls look at it...
Offline
Simply put this code:
printLoadingBar(sometext, 65);
inside the while loop.
Offline
I can't do that...
I need the GUI later and other calculations should be done while it's displayed.
That doenst work if there ia an endless loop.
And normally is works fine if printLoadingBar(sometext, 65); is not in the while loop...
Offline
Just make a small "state machine" inside the while do to every tasks?
If that's not a valid answer, you could wait for NoNameNo to pass by, maybe he could help with this.
Offline
Double_A wrote:
And normally is works fine if printLoadingBar(sometext, 65); is not in the while loop...
NO, if you do not redraw it each VBL you wont see it,
i think you can have a look at compositing sample if you need to precalc stuff
or like crayon said, have a simple machinestate if you absolute need real time rendering.
Offline
It works outside a while loop...
I've tried. But it only works if there max. 3 Draws.
I don't need realtime rendering.
I need a static picture.
Like this:
- Display Picture 1.
- Do some calculations in background while Picture 1 is still displayed.
- Display Picture 2.
...
Isn't that possible?
Offline
But if you want to show a progress bar you will need to update the picture, no?
If you combine all you're drawings inside a texture, then you just need to draw one texture. So the limits of 3 draws is ok. Look at the GRRLIB_Screen2Texture function.
Offline
The progress bar makes just bigger "jumps". Can live with that ^^
And I solved it very easily -.-
I just had to call printLoadingBar(sometext, 65) 3 times...
Now I've just put the function content into for (i = 0; i < 3; i++) { ... } and it works fine with more than 3 draws. ^^
Offline