Welcome! Log In Create A New Profile

Advanced

GRRLIB Help

Posted by g_man 
Re: GRRLIB Help
March 23, 2009 01:10AM
Here is the line in the GRRLIB.h, could you help me?

GRRLIB.h
GRRLIB_texImg GRRLIB_LoadTexture(const unsigned char my_img[]);

inline void GRRLIB_DrawImg(f32 xpos, f32 ypos, GRRLIB_texImg tex, float degrees, float scaleX, f32 scaleY, u32 color );

my code
u8 *tex_ready=GRRLIB_LoadTexture(ready);

	GRRLIB_DrawImg(0,0,tex_ready,0,1,1,0x00ff00ff);
I Want to show a pic the size of the entire screen
Re: GRRLIB Help
March 23, 2009 05:00AM
I think what's missing is your width and height variables. Try adding this to the inline void GRRLIB_DrawImg section of your GRRLIB.h file, after your xpos,ypos:
u16 width, u16 height
Then add your actual width and height variables to the GRRLIB_DrawImg part of your code.
Re: GRRLIB Help
March 23, 2009 05:33PM
ok, but my error is here
	u8 *tex_ready=GRRLIB_LoadTexture(ready);
once i get this i know that the next line will work. in my ready.h file
#ifndef _Ready_h_
#define _Ready_h_
//---------------------------------------------------------------------------------
const unsigned char Ready[] = {
 A bunch of hex values
};
const int Ready_size = 63773;
//---------------------------------------------------------------------------------
#endif //_Ready_h_

Re: GRRLIB Help
March 23, 2009 10:18PM
The compiler is case-sensitive, so since your "ready.h" file code says Ready, you'll have to the LoadTexture code to a capital "R" as well, otherwise, the compiler will say it is undeclared. Example:
#include "gfx/Ready.h"
u8 *tex_ready=GRRLIB_LoadTexture(Ready);

Case-sensitive is a pain sometimes, but it just means you have to pay closer attention to your code.
Re: GRRLIB Help
March 24, 2009 04:12PM
Thanks I will test when I get back to my computer
Ok i changed all to Ready, and nothing different. I checked my file and it is Ready. I belive the problem is in the
u8 *tex_Ready
or in
(Ready)
Should this really be this hard?



Edited 1 time(s). Last edit at 03/25/2009 12:26AM by g_man.
Re: GRRLIB Help
March 25, 2009 06:32AM
GRRLIB 4.0.0 is not using a pointer to a texture anymore, it's using a struct called GRRLIB_texImg.

GRRLIB_texImg GRRLIB_LoadTexture(const unsigned char my_img[]);

In the file you downloaded (http://grrlib.santo.fr/release/GRRLib4.0.0.rar) there is a folder called examples, go and the look at the code.
Re: GRRLIB Help
March 25, 2009 04:22PM
Thanks, i saw that moments before i check here. I fixed and now there is another problem
linking ... pong.elf
GRRLIB.o: In function `GRRLIB_LoadTexturePNG':
d:/homebrew/mystuff/pong/source/GRRLIB/GRRLIB.c:138: undefined reference to `PNGU_SelectImageFromBuffer'
d:/homebrew/mystuff/pong/source/GRRLIB/GRRLIB.c:139: undefined reference to `PNGU_GetImageProperties'
d:/homebrew/mystuff/pong/source/GRRLIB/GRRLIB.c:141: undefined reference to `PNGU_DecodeTo4x4RGBA8'
d:/homebrew/mystuff/pong/source/GRRLIB/GRRLIB.c:142: undefined reference to `PNGU_ReleaseImageContext'
collect2: ld returned 1 exit status
make[1]: *** [/d/homebrew/mystuff/pong/pong.elf] Error 1
"make": *** [build] Error 2
If you need any of my code just tell me which part and i will post it

Also, is it possible to make your own fonts for GRRLIB, and how?



Edited 1 time(s). Last edit at 03/26/2009 02:32AM by g_man.
Re: GRRLIB Help
March 26, 2009 02:34AM
Make sure this path is OK in GRRLIB.c:
#include "../libpng/pngu/pngu.h" // This is mine

Make sure the lib is included in your Make file:
LIBS := ......... -lpng ................

In the Make file the path needs to be OK too:
GRRLIB := ../../GRRLIB
TARGET := $(notdir $(CURDIR))
BUILD := build
SOURCES := source source/gfx $(GRRLIB)/GRRLIB $(GRRLIB)/lib/libpng/pngu
DATA := data
INCLUDES :=
Re: GRRLIB Help
March 26, 2009 03:02AM
i added the parts in my makefile and it compiled, no errors :) but nothing, other than normal, showed on my screen. i'v put the code that puts the picture onsceen in my loop and outside of it, what am i doing wrong
Re: GRRLIB Help
March 26, 2009 04:23AM
Try to use (paste) the code from an example, there is a folder called examples in the rar file.
Re: GRRLIB Help
March 26, 2009 06:56AM
I Finally got it to work and it only took 50 posts. I copyed some txt and it compiled correct and i got my image
Thanks to everyone that has helped.
Ok now i can't get GRRLIB_Printf to work, i copied the code from the demo for everything up to GRRLIB_Printf and this is what i put for Printf
GRRLIB_Printf(0,0,tex_font,0xffffff,0,"Hello World of GRRLIB");



Edited 1 time(s). Last edit at 03/27/2009 02:04AM by g_man.
Sorry, only registered users may post in this forum.

Click here to login