Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma once
- #include <windows.h>
- #include "Library/ObjComponent.h"
- #include "Library/Bitmap.h"
- #include <gdiplus.h>
- //#include <gdiplus/gdiplusgraphics.h>
- //#include <Graphics>
- // Component Type Val: 3
- class RenderComponent : public ObjComponent
- {
- public:
- RenderComponent(int parentid, const wchar_t * a_ImagePath); // Create RenderComponent from File
- virtual ~RenderComponent();
- virtual void OnUpdate() {};
- virtual void OnMessage(ObjMessage&);
- Gdiplus::Image* Image_Get() { return m_pImage; };
- Bitmap* Bitmap_Get() { return m_pBitmap; };
- int RenderType_Get() { return RenderType; };
- protected:
- Gdiplus::Image* m_pImage;
- const wchar_t* m_ImagePath;
- int RenderType; // 0 for bitmap, 1 for Gdiplus::Image
- Bitmap* m_pBitmap;
- };
- RenderComponent::RenderComponent(int parentid, const wchar_t * a_ImagePath)
- : ObjComponent(parentid)
- {
- RenderType = 1;
- SetType(3);
- m_pImage = new Gdiplus::Image(L"Player.bmp");
- }
- RenderComponent::~RenderComponent()
- {
- delete m_pImage;
- }
- void RenderComponent::OnMessage(ObjMessage& m)
- {
- if (m.msgType == "Set Rotation") // Will work on once images work
- {
- /*//Gdiplus::Image* pIm = NULL;
- //pIm = new Image("");
- Gdiplus::Graphics *g;
- Gdiplus::Image *i;
- g->FromImage(m_pBitmap);*/
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement