NLS Engine  v0.1
The Next Logical Step in game engine design.
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Defines
Sprite.h
Go to the documentation of this file.
00001 
00012 #pragma once
00013 
00014 // Standard Includes
00015 
00016 // Library Includes
00017 #include <d3d9.h>
00018 #include <d3dx9.h>
00019 #include <string>
00020 
00021 // Local Includes
00022 #include "../RenderableComponent.h"
00023 
00024 // Forward Declarations
00025 
00026 // Typedefs
00027 
00028 // Constants
00029 
00030 // Classes
00031 namespace GraphicsCore {
00032   class Sprite : public RenderableComponent {
00033   public:
00034     Sprite(EntitySPTR, ModuleInterface*, LPDIRECT3DDEVICE9);
00035     virtual ~Sprite(void);
00036 
00037     void SetSpriteParams( float offX, float offY, std::string texName, unsigned int srcX, unsigned int srcY, unsigned int width, unsigned int height );
00038   private:
00039     void Render(LPDIRECT3DDEVICE9);
00040     LPD3DXSPRITE sprite;
00041     float offsetX, offsetY; // location
00042     LPDIRECT3DTEXTURE9 texture; // Source texture.
00043     RECT srcRect; // Source location in the texture.
00044   };
00045 }