source: trunk/src/ddraw/OS2PALSET.CPP@ 210

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

DX 6 Version of ddraw rel files

File size: 1.7 KB
Line 
1#define INCL_GREALL
2#define INCL_GPI
3#include <os2wrap.h>
4#include <pmddi.h>
5#include <stdio.h>
6#include <stdlib.h>
7#include <string.h>
8#include "os2palset.h"
9#define FAR
10#include "misc.h"
11
12//******************************************************************************
13//******************************************************************************
14void OS2SetPhysPalette(void *pal)
15{
16 PALETTEENTRY *pDirectXPal = (PALETTEENTRY *)pal;
17 HPS hps;
18 HDC hdc;
19 RGB2 os2rgb[256];
20 int i;
21
22 hps = WinGetPS(HWND_DESKTOP);
23 hdc = GpiQueryDevice(hps);
24
25 for(i=0;i<256;i++)
26 {
27 os2rgb[i].bBlue = pDirectXPal[i].peBlue;
28 os2rgb[i].bGreen = pDirectXPal[i].peGreen;
29 os2rgb[i].bRed = pDirectXPal[i].peRed;
30 os2rgb[i].fcOptions = 0;
31 }
32
33 GpiCreateLogColorTable( hps, LCOL_PURECOLOR | LCOL_REALIZABLE,
34 LCOLF_CONSECRGB,
35 0,
36 256,
37 (PLONG)&os2rgb);
38 Gre32Entry3( hdc,
39 0L,
40 0x000060C6L);
41
42 WinInvalidateRect( HWND_DESKTOP,
43 (PRECTL)NULL,
44 TRUE);
45 WinReleasePS(hps);
46}
47//******************************************************************************
48//******************************************************************************
49void OS2ResetPhysPalette()
50{
51 HPS hps;
52 HDC hdc;
53
54 hps = WinGetPS( HWND_DESKTOP);
55
56 hdc = GpiQueryDevice( hps);
57
58 Gre32Entry3( hdc,
59 0L,
60 0x000060C7L);
61
62 WinInvalidateRect( HWND_DESKTOP,
63 (PRECTL)NULL,
64 TRUE);
65
66 WinReleasePS(hps);
67}
68//******************************************************************************
69//******************************************************************************
Note: See TracBrowser for help on using the repository browser.