Welcome! Log In Create A New Profile

Advanced

GRRLib Poblem

Posted by Superyoshi 
GRRLib Poblem
January 24, 2010 01:06PM
So I'm having a problem with GRRLIB. When I want to compile, it says

[pastebin.com]

If I delete c:/devkitPro/libogc/include/grrlib.h:202...

[pastebin.com]

...and if I delete c:/devkitpro/projects/test/source/main.c:35...

[pastebin.com]

I tried multiple different things, but nothing worked.
How should I fix this?

If this helps, here's the code: [pastebin.com]
Re: GRRLib Poblem
January 24, 2010 03:22PM
Basically, you can't declare rmode in your code because GRRLIB already uses it. So just call it rmode2 instead or something. Or better yet, use the already declared rmode.



Edited 1 time(s). Last edit at 01/24/2010 03:23PM by Arikado.
Re: GRRLib Poblem
January 24, 2010 03:59PM
Quote
Arikado
Basically, you can't declare rmode in your code because GRRLIB already uses it. So just call it rmode2 instead or something. Or better yet, use the already declared rmode.

So how should I change the code, then? When I changed everything in main.c from rmode to rmode2, it gave me

Quote

> "make"
main.c
c:/devkitPro/projects/test/source/main.c:35: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
c:/devkitPro/projects/test/source/main.c:62: error: expected declaration specifiers or '...' before 'GXrmode2Obj'
c:/devkitPro/projects/test/source/main.c: In function 'drawdot':
c:/devkitPro/projects/test/source/main.c:77: error: 'rmode2' undeclared (first use in this function)
c:/devkitPro/projects/test/source/main.c:77: error: (Each undeclared identifier is reported only once
c:/devkitPro/projects/test/source/main.c:77: error: for each function it appears in.)
c:/devkitPro/projects/test/source/main.c: In function 'main':
c:/devkitPro/projects/test/source/main.c:198: error: 'rmode2' undeclared (first use in this function)
make[1]: *** [main.o] Error 1
"make": *** [build] Error 2

> Process Exit Code: 2
> Time Taken: 00:01

And if I comment the redefine in main.c out, it gives me the error posted above.
Re: GRRLib Poblem
January 24, 2010 04:21PM
If you really want to keep GRRLIB, don't use any function called VIDEO_*. Mixing two video "library" is a bad idea.

Instead of drawdot, use GRRLIB_Plot or GRRLIB_Rectangle. For more detail check this page [grrlib.santo.fr]
Re: GRRLib Poblem
January 24, 2010 04:58PM
I deleted all VIDEO_ functions now.
I still got the errors. Any other ideas?
Re: GRRLib Poblem
January 24, 2010 05:09PM
Delete drawdot if you are not using it. I sure it will solve a lot of problem.

EDIT
BTW, you should have started your project with the GRRLIB template: [code.google.com]



Edited 1 time(s). Last edit at 01/24/2010 05:12PM by Crayon.
Re: GRRLib Poblem
January 24, 2010 05:12PM
I did that. It still gives me these errors.
Re: GRRLib Poblem
January 24, 2010 06:10PM
A quick scan of the errors tells me that these are basic C errors you should be able to solve if you have any C knowledge/abilities. For example: "c:/devkitPro/projects/test/source/main.c:77: error: 'rmode2' undeclared (first use in this function)"
Re: GRRLib Poblem
January 27, 2010 02:47PM
I looked again at it said rmode2 there. I dunno where it comes from...

Well, I'll should first do simpler stuff before I make stuff with graphics libraries and so on. Though, thanks for the help!
Re: GRRLib Poblem
January 27, 2010 04:24PM
Could you paste the code of your latest version.
Re: GRRLib Poblem
January 28, 2010 05:47PM
Re: GRRLib Poblem
January 28, 2010 06:04PM
All those line should be deleted if you are using GRRLIB:
	rmode2 = VIDEO_GetPreferredMode(NULL);
 
	// double buffering, prevents flickering (is it needed for LCD TV? i don't have one to test)
	xfb[0] = MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode2));
	xfb[1] = MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode2));
and this too:
		CON_Init(xfb[fbi],0,0,rmode2->fbWidth,rmode2->xfbHeight,rmode2->fbWidth*VI_DISPLAY_PIX_SZ);
		//VIDEO_ClearFrameBuffer(rmode2,xfb[fbi],COLOR_BLACK);
		printf("\n\n\n");
And this:
static GXrmode2Obj *rmode2 = NULL;
And this:
		/*VIDEO_SetNextFramebuffer(xfb[fbi]);
		VIDEO_Flush();
		VIDEO_WaitVSync();*/
		fbi ^= 1;
Don't use this: print_and_draw_wiimote_data(xfb[fbi]);
And use this WPAD_SetVRes(0, rmode->fbWidth, rmode->xfbHeight); instead of WPAD_SetVRes(0, rmode2->fbWidth, rmode2->xfbHeight);
Delete void *xfb[2]; and int fbi = 0;

And like I said before, next time start with the GRRLIB template
Sorry, only registered users may post in this forum.

Click here to login