1 | /*
|
---|
2 | * DirectDraw Palette class
|
---|
3 | *
|
---|
4 | * Copyright 1998 Sander van Leeuwen (sandervl@xs4all.nl)
|
---|
5 | *
|
---|
6 | * Project Odin Software License can be found in LICENSE.TXT
|
---|
7 | *
|
---|
8 | */
|
---|
9 | #ifndef __OS2PALETTE_H__
|
---|
10 | #define __OS2PALETTE_H__
|
---|
11 |
|
---|
12 | #include "os2ddraw.h"
|
---|
13 |
|
---|
14 | /* KSO Apr 19 1999: Set correct interface. *
|
---|
15 | * (INTERFACE is used in the THIS and THIS_ macros) */
|
---|
16 | #undef INTERFACE
|
---|
17 | #define INTERFACE IDirectDrawPalette
|
---|
18 |
|
---|
19 | class OS2IDirectDrawPalette
|
---|
20 | {
|
---|
21 | public:
|
---|
22 | //this one has to go first!
|
---|
23 | IDirectDrawPaletteVtbl *lpVtbl;
|
---|
24 | IDirectDrawPaletteVtbl Vtbl;
|
---|
25 |
|
---|
26 | OS2IDirectDrawPalette(OS2IDirectDraw *lpDirectDraw, int palsize, W32_LPPALETTEENTRY lpColorTable);
|
---|
27 | ~OS2IDirectDrawPalette();
|
---|
28 |
|
---|
29 | void SetPhysPalette();
|
---|
30 | void RestorePhysPalette();
|
---|
31 | int Referenced;
|
---|
32 | inline HRESULT GetLastError() { return lastError; };
|
---|
33 | private:
|
---|
34 |
|
---|
35 | protected:
|
---|
36 | HDIVE hDive;
|
---|
37 | ULONG nrColors;
|
---|
38 | HRESULT lastError;
|
---|
39 | W32_LPPALETTEENTRY os2pal;
|
---|
40 | OS2IDirectDraw *lpDraw;
|
---|
41 |
|
---|
42 | // Linked list management
|
---|
43 | OS2IDirectDrawPalette* next; // Next OS2IDirectDraw
|
---|
44 | static OS2IDirectDrawPalette* ddraw; // List of OS2IDirectDraw
|
---|
45 |
|
---|
46 | friend HRESULT __stdcall PalQueryInterface(THIS, REFIID riid, LPVOID FAR * ppvObj);
|
---|
47 | friend ULONG __stdcall PalAddRef(THIS);
|
---|
48 | friend ULONG __stdcall PalRelease(THIS);
|
---|
49 | friend HRESULT __stdcall PalGetCaps(THIS_ LPDWORD);
|
---|
50 | friend HRESULT __stdcall PalGetEntries(THIS_ DWORD,DWORD,DWORD,W32_LPPALETTEENTRY);
|
---|
51 | friend HRESULT __stdcall PalInitialize(THIS_ LPDIRECTDRAW, DWORD,W32_LPPALETTEENTRY);
|
---|
52 | friend HRESULT __stdcall PalSetEntries(THIS_ DWORD,DWORD,DWORD,W32_LPPALETTEENTRY);
|
---|
53 | };
|
---|
54 |
|
---|
55 |
|
---|
56 | HRESULT __stdcall PalQueryInterface(THIS, REFIID riid, LPVOID FAR * ppvObj);
|
---|
57 | ULONG __stdcall PalAddRef(THIS);
|
---|
58 | ULONG __stdcall PalRelease(THIS);
|
---|
59 | HRESULT __stdcall PalGetCaps(THIS_ LPDWORD);
|
---|
60 | HRESULT __stdcall PalGetEntries(THIS_ DWORD,DWORD,DWORD,W32_LPPALETTEENTRY);
|
---|
61 | HRESULT __stdcall PalInitialize(THIS_ LPDIRECTDRAW, DWORD,W32_LPPALETTEENTRY);
|
---|
62 | HRESULT __stdcall PalSetEntries(THIS_ DWORD,DWORD,DWORD,W32_LPPALETTEENTRY);
|
---|
63 |
|
---|
64 |
|
---|
65 | #endif
|
---|