You are not logged in.
i have a little bug with multiple drawing
Exemple :
u8 *tex_bg1 = GRRLIB_LoadTexture(BG1); u8 *tex_bg2 = GRRLIB_LoadTexture(BG2); u8 *tex_bg3 = GRRLIB_LoadTexture(BG3); while (stape == 0) { GRRLIB_FillScreen(0xFF000000); GRRLIB_DrawImg(0, 0, 640, 480, tex_bg1, 0, 1, 1, 255); GRRLIB_DrawImg(0, 200, 640, 200, tex_bg2, 0, 1, 1, 255); GRRLIB_DrawImg(0, 250, 640, 100, tex_bg3, 0, 1, 1, 255); GRRLIB_Render(); //if blabla stape = 1; } free(tex_bg1); tex_bg1 = NULL; free(tex_bg2); tex_bg2 = NULL; free(tex_bg3); tex_bg3 = NULL; sleep(1); u8 *tex_bg4 = GRRLIB_LoadTexture(BG4); u8 *tex_bg5 = GRRLIB_LoadTexture(BG5); u8 *tex_bg6 = GRRLIB_LoadTexture(BG6); while (stape == 1) { GRRLIB_FillScreen(0xFF000000); GRRLIB_DrawImg(0, 0, 640, 480, tex_bg4, 0, 1, 1, 255); GRRLIB_DrawImg(0, 200, 640, 200, tex_bg5, 0, 1, 1, 255); GRRLIB_DrawImg(0, 250, 640, 100, tex_bg6, 0, 1, 1, 255); GRRLIB_Render(); //if blabla stape = 2; } free(tex_bg4); tex_bg4 = NULL; free(tex_bg5); tex_bg5 = NULL; free(tex_bg6); tex_bg6 = NULL; sleep(1); //etc...if i continu to bg12/13, i have a little bug when the new bg is drawing
free(tex_???); it's really good ?
Offline
I'm not quite sure what your bug is as you have not given much to go on in terms of you problem
A couple of observations are:
If you are freeing your textures then there is no need to null them
Why are you not just using the variables tex_bg1(to 3) that you have already created to load your next set of textures into instead of creating the new ones?
Offline
JustWoody wrote:
I'm not quite sure what your bug is as you have not given much to go on in terms of you problem
A couple of observations are:
If you are freeing your textures then there is no need to null them
Why are you not just using the variables tex_bg1(to 3) that you have already created to load your next set of textures into instead of creating the new ones?
Good suggestion, i test it .
Offline