<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>LibWiiSprite Help!</title>
<description> Ok i&amp;#039;m trying to get Libwiisprite to work, and I know i have all of the neccacary libs, and i&amp;#039;m getting an error that shouldn&amp;#039;t be there

The Code:

#include stdio.h&amp;gt;
#include stdlib.h&amp;gt;
#include gccore.h&amp;gt;
#include wiiuse/wpad.h&amp;gt;
#include fat.h&amp;gt;
#include wiisprite.h&amp;gt;

// libwiisprite uses wsp as it&amp;#039;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 &amp; WPAD_BUTTON_HOME)
break;
gwd.Flush();
}
return 0;
}

My Error:

d:/Homebrew/mystuff/C++/wiispritetest/source/main.cpp:41: error: &amp;#039;gwd&amp;#039; was not declared in this scope

I don&amp;#039;t think there is anything wrong, all I added was the code to draw a rectangle.
Thanks</description><link>http://forum.wiibrew.org/read.php?11,16104,16104#msg-16104</link><lastBuildDate>Mon, 13 Jul 2026 07:55:14 +0200</lastBuildDate>
<generator>Phorum 5.2.23</generator>
<item>
<guid>http://forum.wiibrew.org/read.php?11,16104,16138#msg-16138</guid>
<title>Re: LibWiiSprite Help!</title><link>http://forum.wiibrew.org/read.php?11,16104,16138#msg-16138</link><description><![CDATA[ No need, I&#039;m glad you tried to help. Since you both seem to be relatively new to coding, you can both PM me with any questions you have. It may take me a day or two to respond sometimes, but even if I cant help I can at least point you in the direction of someone who can.]]></description>
<dc:creator>Arikado</dc:creator>
<category>Coding</category><pubDate>Sat, 09 May 2009 00:47:28 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,16104,16134#msg-16134</guid>
<title>Re: LibWiiSprite Help!</title><link>http://forum.wiibrew.org/read.php?11,16104,16134#msg-16134</link><description><![CDATA[ Ah yes, that makes sense, thank you.<br />I think I better lurk and learn more for now.]]></description>
<dc:creator>PhoenixTank</dc:creator>
<category>Coding</category><pubDate>Fri, 08 May 2009 23:29:50 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,16104,16118#msg-16118</guid>
<title>Re: LibWiiSprite Help!</title><link>http://forum.wiibrew.org/read.php?11,16104,16118#msg-16118</link><description><![CDATA[ <blockquote class="bbcode"><div><small>Quote<br /></small><strong>PhoenixTank</strong><br />First up, I haven&#039;t even touched libwiisprite before this post.<br />As far as the error goes... gwd is not declared in main()<br />Just add "GameWindow gwd;" I&#039;d think?<br /><pre class="bbcode">
int main(int argc, char **argv)
{
	Initialize();
	GameWindow gwd;
	...snip...
}</pre><br />Edit: I need to learn more about makefiles.<br />And err... with that fixed.. it just black-screens. Going on a hunch here, but the scope mixing looks like an issue?<br />I can get the background filled white if everything is contained in main(), but no rectangle being drawn.<br />I hope some help is better than no help =/</div></blockquote>
That doesnt work because you didnt initialze the video of the new gwd in main().]]></description>
<dc:creator>Arikado</dc:creator>
<category>Coding</category><pubDate>Fri, 08 May 2009 17:55:25 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,16104,16116#msg-16116</guid>
<title>Re: LibWiiSprite Help!</title><link>http://forum.wiibrew.org/read.php?11,16104,16116#msg-16116</link><description><![CDATA[ The error means that you can not use gwd in main(). You cant use gwd in main() because it was declared in Initialize(). Declare gwd globally to fix the problem.]]></description>
<dc:creator>Arikado</dc:creator>
<category>Coding</category><pubDate>Fri, 08 May 2009 17:54:33 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,16104,16110#msg-16110</guid>
<title>Re: LibWiiSprite Help!</title><link>http://forum.wiibrew.org/read.php?11,16104,16110#msg-16110</link><description><![CDATA[ Just define gwd as a global variable.]]></description>
<dc:creator>koopa</dc:creator>
<category>Coding</category><pubDate>Fri, 08 May 2009 11:04:25 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,16104,16106#msg-16106</guid>
<title>Re: LibWiiSprite Help!</title><link>http://forum.wiibrew.org/read.php?11,16104,16106#msg-16106</link><description><![CDATA[ First up, I haven&#039;t even touched libwiisprite before this post.<br />As far as the error goes... gwd is not declared in main()<br />Just add "GameWindow gwd;" I&#039;d think?<br /><pre class="bbcode">
int main(int argc, char **argv)
{
	Initialize();
	GameWindow gwd;
	...snip...
}</pre><br />Edit: I need to learn more about makefiles.<br />And err... with that fixed.. it just black-screens. Going on a hunch here, but the scope mixing looks like an issue?<br />I can get the background filled white if everything is contained in main(), but no rectangle being drawn.<br />I hope some help is better than no help =/]]></description>
<dc:creator>PhoenixTank</dc:creator>
<category>Coding</category><pubDate>Fri, 08 May 2009 06:17:54 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,16104,16104#msg-16104</guid>
<title>LibWiiSprite Help!</title><link>http://forum.wiibrew.org/read.php?11,16104,16104#msg-16104</link><description><![CDATA[ Ok i&#039;m trying to get Libwiisprite to work, and I know i have all of the neccacary libs, and i&#039;m getting an error that shouldn&#039;t be there<br /><br />The Code:<br /><pre class="bbcode">
#include stdio.h&gt;
#include stdlib.h&gt;
#include gccore.h&gt;
#include wiiuse/wpad.h&gt;
#include fat.h&gt;
#include wiisprite.h&gt;

// libwiisprite uses wsp as it&#039;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;
}</pre><br />My Error:<br /><pre class="bbcode">
d:/Homebrew/mystuff/C++/wiispritetest/source/main.cpp:41: error: &#039;gwd&#039; was not declared in this scope</pre><br />I don&#039;t think there is anything wrong, all I added was the code to draw a rectangle.<br />Thanks]]></description>
<dc:creator>g_man</dc:creator>
<category>Coding</category><pubDate>Fri, 08 May 2009 05:30:10 +0200</pubDate></item>
</channel>
</rss>