ddrawwnd.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #ifndef __DDRAWWND_H
  2. #define __DDRAWWND_H
  3. #include <ddraw.h>
  4. #include "../bfc/basewnd.h"
  5. class DDSurfaceCanvas;
  6. class DDrawWnd;
  7. class api_region;
  8. #define DDRAWWND_PARENT BaseWnd
  9. class NOVTABLE DDrawWnd : public DDRAWWND_PARENT {
  10. public:
  11. DDrawWnd();
  12. virtual ~DDrawWnd();
  13. virtual int virtualBeforePaint(api_region *r);
  14. virtual int virtualAfterPaint(api_region *r);
  15. virtual void virtualCanvasCommit(Canvas *canvas, RECT *r, double ratio);
  16. virtual Canvas *createFrameBuffer(int w, int h);
  17. virtual void deleteFrameBuffer(Canvas *canvas);
  18. virtual int onInit();
  19. virtual void invalidate();
  20. virtual void invalidateRect(RECT *r);
  21. virtual void invalidateRgn(api_region *rgn);
  22. virtual void validate();
  23. virtual void validateRect(RECT *r);
  24. virtual void validateRgn(api_region *rgn);
  25. private:
  26. void initDDraw();
  27. void startThread();
  28. void stopThread();
  29. LPDIRECTDRAW m_lpDD;
  30. LPDIRECTDRAWSURFACE m_lpRenderSurf, m_lpPrimSurf;
  31. DDSurfaceCanvas *fb_canvas;
  32. int w, h;
  33. LPDIRECTDRAWCLIPPER lpClipper;
  34. static int allow_dd;
  35. static int sleep_val;
  36. static CRITICAL_SECTION cs;
  37. static HANDLE thread;
  38. static int quitthread;
  39. static PtrList<DDrawWnd> ddlist;
  40. static unsigned int WINAPI renderThread(void *);
  41. };
  42. #endif