I can't seem to find where my errors are, hopefully someone can enlighten me.
Sprite dude; is declared in Game.h and the Sprite struct is in D3DGraphics.h
D3DGraphics.h is included in Game.h and I'm a bit stumped.
Started with a fresh framework download and followed the video again. I got the exact same outcome. I'm sure I am making a mistake somewhere but I can't seem to figure it out.
Cleaned the source folder and uploaded.
1>------ Build started: Project: Chili DirectX Framework, Configuration: Debug Win32 ------
1> D3DGraphics.cpp
d3dgraphics.cpp(30): error C2065: 'dude' : undeclared identifier
d3dgraphics.cpp(30): error C2228: left of '.height' must have class/struct/union
1> type is ''unknown-type''
d3dgraphics.cpp(31): error C2065: 'dude' : undeclared identifier
d3dgraphics.cpp(31): error C2228: left of '.width' must have class/struct/union
1> type is ''unknown-type''
d3dgraphics.cpp(32): error C2065: 'dude' : undeclared identifier
d3dgraphics.cpp(32): error C2228: left of '.key' must have class/struct/union
1> type is ''unknown-type''
d3dgraphics.cpp(33): error C2065: 'dude' : undeclared identifier
d3dgraphics.cpp(33): error C2228: left of '.surface' must have class/struct/union
1> type is ''unknown-type''
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
[solved] Stuck on beginner lesson 20
Re: Stuck on beginner lesson 20
What seems to be the problem is that you forgot to create your object.
So, you made a struct called Sprite, but then you start talking about the dude. object while you did not even declare the object.
So if you add 'Sprite dude;' to D3DGraphics.cpp (above the function that calls for the dude. object) you should be fine...
** Edit: I'm just a newbie, so correct me if I'm wrong, but that actually drawed the character on my screen for me and it compiled without actual errors **
So, you made a struct called Sprite, but then you start talking about the dude. object while you did not even declare the object.
So if you add 'Sprite dude;' to D3DGraphics.cpp (above the function that calls for the dude. object) you should be fine...
** Edit: I'm just a newbie, so correct me if I'm wrong, but that actually drawed the character on my screen for me and it compiled without actual errors **
Re: Stuck on beginner lesson 20
Turns out I was just using the wrong sprite name. In the video the LoadSprite function changes dude to sprite (just for the function) and I missed that. Though if I hadn't read your suggestion, I wouldn't have tried it, got a new error, and realized what I did. So with that, thanks Natox!
Re: Stuck on beginner lesson 20
Edit: Ah you found it, never mind.
Musi
There are 10 types of people that understand binary.
Those that do, and those that don't.
There are 10 types of people that understand binary.
Those that do, and those that don't.
Re: Stuck on beginner lesson 20
I JUST figured it out. That was exactly what was wrong!
Re: Stuck on beginner lesson 20
Then I don't get it mate... could you explain?Caleb7 wrote:Turns out I was just using the wrong sprite name. In the video the LoadSprite function changes dude to sprite (just for the function) and I missed that. Though if I hadn't read your suggestion, I wouldn't have tried it, got a new error, and realized what I did. So with that, thanks Natox!
Because according to my findings you make a function called 'LoadSprite' that uses the 'dude.*' object in 'D3DGraphics.cpp', but it does not recognize the 'dude.*' object because it is not initialized in any corresponding header file. But apparently I'm wrong on that one...
So what happened?
Re: Stuck on beginner lesson 20
The LoadSprite function takes a sprite called "sprite" but I wrote "dude"natox1986 wrote:Then I don't get it mate... could you explain?Caleb7 wrote:Turns out I was just using the wrong sprite name. In the video the LoadSprite function changes dude to sprite (just for the function) and I missed that. Though if I hadn't read your suggestion, I wouldn't have tried it, got a new error, and realized what I did. So with that, thanks Natox!
Because according to my findings you make a function called 'LoadSprite' that uses the 'dude.*' object in 'D3DGraphics.cpp', but it does not recognize the 'dude.*' object because it is not initialized in any corresponding header file. But apparently I'm wrong on that one...
So what happened?