1
0

ifc_bitmap.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #ifndef NULLSOFT_WASABI_IFC_BITMAP_H
  2. #define NULLSOFT_WASABI_IFC_BITMAP_H
  3. #include <bfc/dispatch.h>
  4. #include <bfc/platform/types.h>
  5. #include <bfc/platform/platform.h>
  6. #warning move this typedef to bfc/platform/platform.h
  7. #ifdef _WIN32
  8. typedef HBITMAP OSBITMAPHANDLE;
  9. #elif defined(__APPLE__)
  10. typedef CGImageRef OSBITMAPHANDLE;
  11. #else
  12. #error port me
  13. #endif
  14. class ifc_bitmap : public Dispatchable
  15. {
  16. protected:
  17. ifc_bitmap() {}
  18. ~ifc_bitmap() {}
  19. public:
  20. OSBITMAPHANDLE GetBitmap();
  21. uint8_t *GetBits();
  22. void UpdateBits(uint8_t *bits); // call to signify that you've modified the underlying bits.
  23. DISPATCH_CODES
  24. {
  25. IFC_BITMAP_GETBITMAP = 10,
  26. IFC_BITMAP_GETBITS = 20,
  27. IFC_BITMAP_UPDATEBITS = 30,
  28. };
  29. };
  30. inline OSBITMAPHANDLE ifc_bitmap::GetBitmap()
  31. {
  32. return _call(IFC_BITMAP_GETBITMAP, (OSBITMAPHANDLE)0);
  33. }
  34. inline uint8_t *ifc_bitmap::GetBits()
  35. {
  36. return _call(IFC_BITMAP_GETBITS, (uint8_t *)0);
  37. }
  38. inline void ifc_bitmap::UpdateBits(uint8_t *bits)
  39. {
  40. _voidcall(IFC_BITMAP_UPDATEBITS, bits);
  41. }
  42. #endif