NLS Engine  v0.1
The Next Logical Step in game engine design.
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Defines
D3DFont.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 #include "../../../sharedbase/Envelope_fwd.h"
00024 #include "../../../sharedbase/Entity_fwd.h"
00025 
00026 // Forward Declarations
00027 class MessageRouter;
00028 
00029 // Typedefs
00030 
00031 // Constants
00032 
00033 // Classes
00034 namespace GraphicsCore {
00035   class D3DFont : public RenderableComponent {
00036   public:
00037     D3DFont(EntitySPTR, ModuleInterface*, LPDIRECT3DDEVICE9, MessageRouter* msgrtr, unsigned int width = 5, unsigned int height = 12, unsigned int weight = FW_NORMAL, bool italic = false);
00038     virtual ~D3DFont(void);
00039 
00040     void SetDialogRect( unsigned int offX, unsigned int offY, unsigned int width, unsigned int height );
00041     void SetText(EnvelopeSPTR env);
00042 
00043   private:
00044     void Render(LPDIRECT3DDEVICE9);
00045     LPD3DXFONT font;
00046     LPD3DXSPRITE sprite; // Sprite object for improved efficiency
00047     RECT dialogrect;
00048     unsigned int width, height, weight;
00049     bool italic;
00050     std::string text;
00051     MessageRouter* msgrouter;
00052   };
00053 }