Archived

This topic is now archived and is closed to further replies.

Si

Eric Wright's Sprite Tutorial

Recommended Posts

First of all, I have to admit I''m a bit of a C++ and DX newbie, so please go easy on me! Right, with that out the way... I downloaded the files that went with Eric Wright''s sprite tutorial. I tried out the main.cpp file, and it worked nicely, so I decided it to use it as a starting point for a program. To make things a bit more organised, I decided to split main.cpp into three separate files - a header and a cpp file for the sprite class, and a cpp file for the program (just called ''test''). However, having done this, and upon trying to compile the ''test'' program, I get one error in the sprite header file: error C2065: ''g_pDevice'' : undeclared identifier Obviously, g_pDevice needs to be declared somewhere, but I''m not sure where to do this, or what the best way to do it would be. If anyone can help, then that would be much appreciated.

Share this post


Link to post
Share on other sites
i never looked at the tutorial, but it''s missing the device that it draws with. define it in one of the header files and include that header file in the main source code. then it should work

[Edited by - kmsixpence on October 17, 2005 7:04:58 PM]

Share this post


Link to post
Share on other sites