You are not logged in.
Hello,
When I try to show more than 10 images using GRRLIB_DrawImg();, my application crashes and it does not show any of them. I need to show 11 as least. How can I make it work?
Thanks Previously.
Offline
1) Do you need to show all images at the same time?
2) What is the total file size of your images?
3) What format do you use: JPEG or Bitmap?
Offline
Thanks for the quick reply.
1) Yes, I need to show all them at the same time, they are the pieces of a board game.
2) Currently, 4.23KB as bitmap, and conversed to header files about 26.3KB, but it may increase because now they are simplified.
3) PNG
Offline
Oups, I did a mistake on #3, Bitmap are not supported, PNG was supposed to be there.
Kadede, if you comment one GRRLIB_DrawImg, does it work? If not, try commenting another one, do that until it works. I want to know what is the quantity that is working.
Normally I guess it's possible to draw multiple image with GRRLIB_DrawImg on the same screen. So if it's possible, could you paste some code here.
Offline
Yes, I tried to comment different DrawImg(s), and I noted that the maximum number of them working is 10, if I try to write a 11 one, it crashes the app.
This is the piece of code I use:
void colocafichas()
{
GRRLIB_FillScreen(0xFFFFFFFF);
GRRLIB_Printf(30, 30, tex_font1, 0xFF000000, 4, "Senet");
GRRLIB_DrawImg( 27, 156, 40, 40, tex_reel, 0, 1, 1, 255);
GRRLIB_DrawImg(147, 156, 40, 40, tex_reel, 0, 1, 1, 255);
GRRLIB_DrawImg(267, 156, 40, 40, tex_reel, 0, 1, 1, 255);
GRRLIB_DrawImg(387, 156, 40, 40, tex_reel, 0, 1, 1, 255);
GRRLIB_DrawImg(507, 156, 40, 40, tex_reel, 0, 1, 1, 255);
GRRLIB_DrawImg( 87, 156, 40, 40, tex_cone, 0, 1, 1, 255);
GRRLIB_DrawImg(207, 156, 40, 40, tex_cone, 0, 1, 1, 255);
GRRLIB_DrawImg(327, 156, 40, 40, tex_cone, 0, 1, 1, 255);
GRRLIB_DrawImg(447, 156, 40, 40, tex_cone, 0, 1, 1, 255);
GRRLIB_DrawImg(567, 156, 40, 40, tex_cone, 0, 1, 1, 255);
GRRLIB_DrawImg(10, 135, 616, 200, tex_tablero, 0, 1, 1, 255);
GRRLIB_Render();
}
Last edited by Kadede (2009-03-30 23:20:37)
Offline
Topic was moved because it's a GRRLib 3.0 question.
I don't know if it's too late, but you should consider upgrading to GRRLIB 4.0.
Just in case this line is the problem:
GRRLIB_DrawImg(10, 135, 616, 200, tex_tablero, 0, 1, 1, 255);
Try:
void colocafichas() { GRRLIB_FillScreen(0xFFFFFFFF); GRRLIB_Printf(30, 30, tex_font1, 0xFF000000, 4, "Senet"); GRRLIB_DrawImg( 27, 156, 40, 40, tex_reel, 0, 1, 1, 255); GRRLIB_DrawImg(147, 156, 40, 40, tex_reel, 0, 1, 1, 255); GRRLIB_DrawImg(267, 156, 40, 40, tex_reel, 0, 1, 1, 255); GRRLIB_DrawImg(387, 156, 40, 40, tex_reel, 0, 1, 1, 255); GRRLIB_DrawImg(507, 156, 40, 40, tex_reel, 0, 1, 1, 255); GRRLIB_DrawImg( 87, 156, 40, 40, tex_cone, 0, 1, 1, 255); GRRLIB_DrawImg(207, 156, 40, 40, tex_cone, 0, 1, 1, 255); GRRLIB_DrawImg(327, 156, 40, 40, tex_cone, 0, 1, 1, 255); GRRLIB_DrawImg(447, 156, 40, 40, tex_cone, 0, 1, 1, 255); GRRLIB_DrawImg(567, 156, 40, 40, tex_cone, 0, 1, 1, 255); // same as above GRRLIB_DrawImg( 87, 156, 40, 40, tex_cone, 0, 1, 1, 255); GRRLIB_DrawImg(207, 156, 40, 40, tex_cone, 0, 1, 1, 255); GRRLIB_DrawImg(327, 156, 40, 40, tex_cone, 0, 1, 1, 255); GRRLIB_DrawImg(447, 156, 40, 40, tex_cone, 0, 1, 1, 255); GRRLIB_DrawImg(567, 156, 40, 40, tex_cone, 0, 1, 1, 255); GRRLIB_Render(); }
Offline
Well,
I have upgraded to GRRLIB 4.0, but that's shown when compiling:Code:
error: incompatible type for argument 3 of 'GRRLIB_DrawImg'Of course, I have modified my code to adapt it to 4.0:
Code:
GRRLIB_texImg tex_tablero = GRRLIB_LoadTexture(tablero); [...] GRRLIB_DrawImg( 10, 135, tex_tablero, 0, 1, 1, 0xFFFFFFFF);In adittion, the template doesn 't compile too and it shows:
Code:
undefined reference to 'GRRLIB_Init' undefined reference to 'GRRLIB_Render'I've tried with both standard and svn version.
.
EDIT.:
Errors shown on top were caused by mistakes in my makefile.
The error now shown is this:Code:
GRRLIB.o: In function `GRRLIB_LoadTextureJPG': c:/PROJECTS/senet001/source/GRRLIB/GRRLIB/GRRLIB.c:212: undefined reference to `jpeg_CreateDecompress' c:/PROJECTS/senet001/source/GRRLIB/GRRLIB/GRRLIB.c:213: undefined reference to `jpeg_std_error' c:/PROJECTS/senet001/source/GRRLIB/GRRLIB/GRRLIB.c:215: undefined reference to `jpeg_memory_src' c:/PROJECTS/senet001/source/GRRLIB/GRRLIB/GRRLIB.c:216: undefined reference to `jpeg_read_header' c:/PROJECTS/senet001/source/GRRLIB/GRRLIB/GRRLIB.c:217: undefined reference to `jpeg_start_decompress' c:/PROJECTS/senet001/source/GRRLIB/GRRLIB/GRRLIB.c:223: undefined reference to `jpeg_read_scanlines' c:/PROJECTS/senet001/source/GRRLIB/GRRLIB/GRRLIB.c:235: undefined reference to `jpeg_finish_decompress' c:/PROJECTS/senet001/source/GRRLIB/GRRLIB/GRRLIB.c:236: undefined reference to `jpeg_destroy_decompress'I bet it is a libjpeg problem. Does anybody knows how to fix it?
EDIT 2.:
Fixed. It was again a makefile problem.
Now everything works and it sows more than 10 images at once.
Realy thanks for the brought help and I regret that this subject may cause you trouble.
Last edited by Kadede (2009-03-31 19:59:58)
Offline