source: trunk/src/ddraw/OS2PALETTE.H@ 5280

Last change on this file since 5280 was 2174, checked in by hugh, 26 years ago

Added ODIn lic header with ID to all files where missing

Cleaned up Surface handling by movefing colorfill and
colorconversion into own files and use functionpointers
setup during creation.

updated makefile to add files

removed inhertiance from IBASE in DDrectangle class

File size: 2.5 KB
Line 
1/* $Id: OS2PALETTE.H,v 1.7 1999-12-21 01:28:19 hugh Exp $ */
2
3/*
4 * DX palette class definition
5 *
6 * Copyright 1998 Sander va Leeuwen
7 * Copyright 1999 Markus Montkowski
8 *
9 * Project Odin Software License can be found in LICENSE.TXT
10 *
11 */
12
13#ifndef __OS2PALETTE_H__
14#define __OS2PALETTE_H__
15
16#include "divewrap.h"
17#define FAR
18#undef THIS
19#define THIS IDirectDrawPalette*
20
21#pragma pack(1) /* pack on wordboundary */
22
23typedef struct _RGB2 /* rgb2 */
24{
25 BYTE bBlue; /* Blue component of the color definition */
26 BYTE bGreen; /* Green component of the color definition*/
27 BYTE bRed; /* Red component of the color definition */
28 BYTE fcOptions; /* Reserved, must be zero */
29} RGB2;
30typedef RGB2 *PRGB2;
31#pragma pack()
32
33class OS2IDirectDrawPalette
34{
35 public:
36 //this one has to go first!
37 IDirectDrawPaletteVtbl *lpVtbl;
38 IDirectDrawPaletteVtbl Vtbl;
39
40 OS2IDirectDrawPalette( VOID *lpDirectDraw,
41 int palsize,
42 LPPALETTEENTRY lpColorTable,
43 DWORD dwPalFlags);
44 ~OS2IDirectDrawPalette();
45
46 void SetPhysPalette();
47 void RestorePhysPalette();
48 void SetIsPrimary(BOOL newValue);
49 int Referenced;
50 inline HRESULT GetLastError() { return lastError; };
51 WORD aPal16[256];
52 DWORD aPal24[256];
53 private:
54
55 protected:
56 HDIVE hDive;
57 HDIVE hDiveCC;
58 HRESULT lastError;
59 LPPALETTEENTRY os2pal;
60 VOID *lpDraw;
61 DWORD dwCaps;
62 DWORD dwSize;
63 BOOL fAttachedToPrimary;
64 friend HRESULT __stdcall PalQueryInterface(THIS, REFIID riid, LPVOID FAR * ppvObj);
65 friend ULONG __stdcall PalAddRef(THIS);
66 friend ULONG __stdcall PalRelease(THIS);
67 friend HRESULT __stdcall PalGetCaps(THIS, LPDWORD);
68 friend HRESULT __stdcall PalGetEntries(THIS, DWORD,DWORD,DWORD,LPPALETTEENTRY);
69 friend HRESULT __stdcall PalInitialize(THIS, LPDIRECTDRAW, DWORD, LPPALETTEENTRY);
70 friend HRESULT __stdcall PalSetEntries(THIS, DWORD,DWORD,DWORD,LPPALETTEENTRY);
71};
72
73
74HRESULT __stdcall PalQueryInterface(THIS, REFIID riid, LPVOID FAR * ppvObj);
75ULONG __stdcall PalAddRef(THIS);
76ULONG __stdcall PalRelease(THIS);
77HRESULT __stdcall PalGetCaps(THIS, LPDWORD);
78HRESULT __stdcall PalGetEntries(THIS, DWORD,DWORD,DWORD,LPPALETTEENTRY);
79HRESULT __stdcall PalInitialize(THIS, LPDIRECTDRAW, DWORD, LPPALETTEENTRY);
80HRESULT __stdcall PalSetEntries(THIS, DWORD,DWORD,DWORD,LPPALETTEENTRY);
81
82
83#endif
Note: See TracBrowser for help on using the repository browser.