Lesson 20: help...
-
- Posts: 4
- Joined: December 22nd, 2012, 1:06 pm
- Location: Lithuania
Lesson 20: help...
I don't know what I did wrong, but when I tried building the program after creating the Sprite structure I got some seriously weird errors on the debugger... It worked fine before that... So I'm posting the code I have here, maybe someone would check it out... I feel kinda retarded, but I just couldn't find the problem
- Attachments
-
- Lesson20.7z
- (1.22 MiB) Downloaded 156 times
Re: Lesson 20: help...
hey, i found your problem =]...i hope you didnt have to wait for too long.
P.S. (dont feel bad...i made the same mistake in lesson 20 and it took me a good while to figure it out)
now...im not sure why this effects the compiler like it does, but im guessing when 2 files include each other...sht gets wierd, and you start getting wierd errors. Also its good practice to put the .h files into the header file (i noticed your bitmap.h was in game.cpp) because if you put it in the header file it goes to the cpp anyway...its not completely necessary, but its just mo' sexy. and you want your code to be sexy right? =PD3DGraphics.h
#include <d3d9.h>
#include "Game.h" //this is your problem, simply remove it and you should be fine, also after that
struct Sprite
{
unsigned int width, height;
D3DCOLOR key;
D3DCOLOR* surface;
};
P.S. (dont feel bad...i made the same mistake in lesson 20 and it took me a good while to figure it out)