RenderWindow.h 547 B

1234567891011121314151617181920212223
  1. #pragma once
  2. #include "EgoInterface.h"
  3. #include <thread>
  4. class CRenderWindow:public IRender
  5. {
  6. public:
  7. CRenderWindow();
  8. void Start();
  9. void Stop();
  10. virtual void OnRender(std::unique_ptr<uint8_t>& pBuffer,int32_t width,int32_t height) override;
  11. static LRESULT CALLBACK WndProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam);
  12. void OnPaint(HWND hWnd);
  13. void SetSize(int32_t width, int32_t height);
  14. private:
  15. void Run();
  16. HWND m_hWnd;
  17. std::thread m_Thread;
  18. bool m_bRun;
  19. BITMAPINFO bmi_;
  20. bool start_;
  21. std::unique_ptr<uint8_t> image_;
  22. };