From: Ivan Hernandez Date: Wed, 23 Dec 2009 19:52:44 +0000 (-0600) Subject: Added the basic background class and added more aplicable comments to X-Git-Url: http://git.mmlx.us/?a=commitdiff_plain;h=183fbc9fff36e8b675e166cd3fe1297ed16e57b2;p=IvanGame.git Added the basic background class and added more aplicable comments to previous classes. --- diff --git a/Background.cpp b/Background.cpp new file mode 100644 index 0000000..3b72594 --- /dev/null +++ b/Background.cpp @@ -0,0 +1,8 @@ +#include "Background.h" + +Background::Background(std::string name, std::string filename):_name(name){ + /** \todo Implememnt the constructor that gets image sizes and puts it together so that background can be used correctly. */ +} +void Background::draw(){ + /** \todo implement draw for background scrolling and otherwise. */ +} diff --git a/Background.h b/Background.h new file mode 100644 index 0000000..05f5467 --- /dev/null +++ b/Background.h @@ -0,0 +1,29 @@ +#include "Game.h"// for size of game window +#include "fns.h" +#include +#include + +/** + The Background + + This class is tasked with the following: + - loading the background + - drawing the background + */ + +class Background{ + private: + std::string _name; + SizeD _imageSize; + /** \todo _sections;//if needed */ + SDL_Surface *mScreen; + + public: + Background(std::string name, std::string filename); + void draw();/**< Draw background. */ + std::string getName(){ return _name; }/** Returns name. */ + void setName(std::string name){ _name = name; }/** Set Name. */ + SizeD size(){ return _imageSize;}/** returns image size */ + +}; +