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