Vram.h 689 B

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