LibWiiSprite Help! May 08, 2009 05:30AM | Registered: 15 years ago Posts: 444 |
#include stdio.h> #include stdlib.h> #include gccore.h> #include wiiuse/wpad.h> #include fat.h> #include wiisprite.h> // libwiisprite uses wsp as it's namespace using namespace wsp; void Initialize() { GameWindow gwd; gwd.InitVideo(); gwd.SetBackground((GXColor){ 255, 255, 255, 255 }); // Initialise Wiimote WPAD_Init(); } int main(int argc, char **argv) { Initialize(); Quad rectangle1; rectangle1.SetWidth(20); rectangle1.SetHeight(200); rectangle1.SetBorder(1); rectangle1.SetFillColor((GXColor){0xFF, 0x00, 0x00, 0xFF}); rectangle1.Draw(0,0); for(;;) { WPAD_ScanPads(); u32 buttondown = WPAD_ButtonsDown(0); if(buttondown & WPAD_BUTTON_HOME) break; gwd.Flush(); } return 0; }
d:/Homebrew/mystuff/C++/wiispritetest/source/main.cpp:41: error: 'gwd' was not declared in this scope
Re: LibWiiSprite Help! May 08, 2009 06:17AM | Registered: 15 years ago Posts: 303 |
int main(int argc, char **argv) { Initialize(); GameWindow gwd; ...snip... }
Re: LibWiiSprite Help! May 08, 2009 11:04AM | Registered: 15 years ago Posts: 25 |
Re: LibWiiSprite Help! May 08, 2009 05:54PM | Admin Registered: 16 years ago Posts: 5,132 |
Re: LibWiiSprite Help! May 08, 2009 05:55PM | Admin Registered: 16 years ago Posts: 5,132 |
That doesnt work because you didnt initialze the video of the new gwd in main().Quote
PhoenixTank
First up, I haven't even touched libwiisprite before this post.
As far as the error goes... gwd is not declared in main()
Just add "GameWindow gwd;" I'd think?int main(int argc, char **argv) { Initialize(); GameWindow gwd; ...snip... }
Edit: I need to learn more about makefiles.
And err... with that fixed.. it just black-screens. Going on a hunch here, but the scope mixing looks like an issue?
I can get the background filled white if everything is contained in main(), but no rectangle being drawn.
I hope some help is better than no help =/
Re: LibWiiSprite Help! May 08, 2009 11:29PM | Registered: 15 years ago Posts: 303 |
Re: LibWiiSprite Help! May 09, 2009 12:47AM | Admin Registered: 16 years ago Posts: 5,132 |