Vram.h 706 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #ifndef VRAM_H
  2. #define VRAM_H
  3. #include <memory>
  4. #include "common/TypeDefine.h"
  5. #include "common/Surface.h"
  6. class Vram
  7. {
  8. private:
  9. Vram();
  10. public:
  11. static std::unique_ptr<Vram> MakeInstance()
  12. {
  13. return std::unique_ptr<Vram>(new Vram());
  14. }
  15. virtual ~Vram();
  16. u16 GetWidth() const;
  17. u16 GetHeight() const;
  18. void Save( const Ogre::String& file );
  19. void AddImageBuffer( u16 x, u16 y, u16 width, u16 height, u8* buffer );
  20. void PutU8( u16 x, u16 y, u8 byte );
  21. u8 GetU8( u16 x, u16 y ) const;
  22. void PutU16( u16 x, u16 y, u16 bytes );
  23. u16 GetU16( u16 x, u16 y ) const;
  24. private:
  25. u8 m_Vram[ 2048 * 512 ];
  26. u16 m_Width;
  27. u16 m_Height;
  28. };
  29. #endif