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