ReactOS  0.4.14-dev-323-g6fe6a88
callbacks_dd_hel.c
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: See COPYING in the top level directory
3  * PROJECT: ReactOS DirectX
4  * FILE: dll/directx/ddraw/Ddraw/callbacks_dd_hel.c
5  * PURPOSE: HEL Callbacks for Direct Draw
6  * PROGRAMMER: Magnus Olsen
7  *
8  */
9 
10 #include "rosdraw.h"
11 
12 
15 
16 /*
17  * Direct Draw Callbacks
18  */
19 
21 {
22  DX_STUB;
23 }
24 
26 {
27  DX_STUB;
28 }
29 
30 
32 {
33  DX_STUB;
34 }
35 
36 
38 {
39  DEVMODE DevMode;
40 
41  DX_STUB_str("in hel");
42 
43  DevMode.dmSize = (WORD)sizeof(DEVMODE);
44  DevMode.dmDriverExtra = 0;
45 
46  SetMode->ddRVal = DDERR_UNSUPPORTEDMODE;
47 
48  if (EnumDisplaySettingsEx(NULL, SetMode->dwModeIndex, &DevMode, 0 ) != 0)
49  {
50 
51 
52  if (ChangeDisplaySettings(&DevMode, CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL)
53  {
54  DX_STUB_str("FAIL");
55  SetMode->ddRVal = DDERR_UNSUPPORTEDMODE;
56  }
57  else
58  {
59  DX_STUB_str("OK");
60  SetMode->ddRVal = DD_OK;
61  }
62  }
63 
64  return DDHAL_DRIVER_HANDLED;
65 }
66 
68 {
69  DX_STUB;
70 }
71 
73 {
74  DX_STUB;
75 }
76 
78 {
79  DDRAWI_DDRAWPALETTE_GBL* ddPalGbl = lpCreatePalette->lpDDPalette;
80  LOGPALETTE* logPal ;
81  WORD size=1;
82 
83  if(ddPalGbl->dwFlags & DDRAWIPAL_2)
84  size = 2;
85  else if(ddPalGbl->dwFlags & DDRAWIPAL_4)
86  size = 4;
87  else if(ddPalGbl->dwFlags & DDRAWIPAL_16)
88  size = 16;
89  else if(ddPalGbl->dwFlags & DDRAWIPAL_256)
90  size = 256;
91 
92  DxHeapMemAlloc(logPal, sizeof(LOGPALETTE) + size*sizeof(PALETTEENTRY));
93  if(logPal == NULL)
94  {
95  lpCreatePalette->ddRVal = DDERR_OUTOFMEMORY;
96  return DDHAL_DRIVER_HANDLED;
97  }
98 
99  logPal->palVersion = 0x300;
100  logPal->palNumEntries = size;
101  CopyMemory(&logPal->palPalEntry[0], lpCreatePalette->lpColorTable, size*sizeof(PALETTEENTRY));
102 
103  ddPalGbl->hHELGDIPalette = CreatePalette(logPal);
104 
105  if (ddPalGbl->hHELGDIPalette == NULL)
106  {
107  DxHeapMemFree(logPal);
108  lpCreatePalette->ddRVal = DDERR_INVALIDOBJECT;
109  return DDHAL_DRIVER_HANDLED;
110  }
111 
112  DxHeapMemFree(logPal);
113  ddPalGbl->lpColorTable = lpCreatePalette->lpColorTable;
114  ddPalGbl->dwFlags |= DDRAWIPAL_INHEL | DDRAWIPAL_GDI ;
115  lpCreatePalette->ddRVal = DD_OK;
116  return DDHAL_DRIVER_HANDLED;
117 }
118 
120 {
121  DX_STUB;
122 }
123 
125 {
126  DX_WINDBG_trace();
127  DX_STUB_str("Not implement yet, return DD_OK for not bsod\n");
128  lpSetExclusiveMode->ddRVal = DD_OK;
129 
130  return DDHAL_DRIVER_HANDLED;
131 }
132 
134 {
135  DX_STUB;
136 }
137 
#define DX_WINDBG_trace()
Definition: rosdraw.h:262
DWORD CALLBACK HelDdGetScanLine(LPDDHAL_GETSCANLINEDATA lpGetScanLine)
DWORD CALLBACK HelDdFlipToGDISurface(LPDDHAL_FLIPTOGDISURFACEDATA lpFlipToGDISurface)
WORD dmSize
Definition: wingdi.h:1563
#define DDRAWIPAL_GDI
Definition: ddrawi.h:1563
#define DDRAWIPAL_256
Definition: ddrawi.h:1561
WORD dmDriverExtra
Definition: wingdi.h:1564
#define CDS_FULLSCREEN
Definition: winuser.h:183
#define CALLBACK
Definition: compat.h:27
DWORD CALLBACK HelDdCreateSurface(LPDDHAL_CREATESURFACEDATA lpCreateSurface)
#define DX_STUB_str(x)
Definition: rosdraw.h:254
#define DDERR_OUTOFMEMORY
Definition: ddraw.h:111
#define DxHeapMemFree(p)
Definition: rosdraw.h:120
DDPIXELFORMAT pixelformats[]
DWORD pixelformatsCount
LPPALETTEENTRY lpColorTable
Definition: ddrawi.h:1550
WORD palVersion
Definition: wingdi.h:1828
HRESULT ddRVal
Definition: ddrawi.h:768
#define DDHAL_DRIVER_HANDLED
Definition: ddrawi.h:321
#define DD_OK
Definition: ddraw.h:186
#define DDERR_INVALIDOBJECT
Definition: ddraw.h:78
#define DDRAWIPAL_16
Definition: ddrawi.h:1562
smooth NULL
Definition: ftsmooth.c:416
LPDDRAWI_DDRAWPALETTE_GBL lpDDPalette
Definition: ddrawi.h:793
DWORD CALLBACK HelDdWaitForVerticalBlank(LPDDHAL_WAITFORVERTICALBLANKDATA lpWaitForVerticalBlank)
LPPALETTEENTRY lpColorTable
Definition: ddrawi.h:794
GLsizeiptr size
Definition: glext.h:5919
HPALETTE WINAPI CreatePalette(_In_reads_(_Inexpressible_(2 *sizeof(WORD)+plpal->palNumEntries *sizeof(PALETTEENTRY))) const LOGPALETTE *)
#define DxHeapMemAlloc(p, m)
Definition: rosdraw.h:113
#define DISP_CHANGE_SUCCESSFUL
Definition: winuser.h:190
#define CopyMemory
Definition: winbase.h:1640
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
#define DDERR_UNSUPPORTEDMODE
Definition: ddraw.h:164
#define DDRAWIPAL_INHEL
Definition: ddrawi.h:1568
#define DDRAWIPAL_2
Definition: ddrawi.h:1572
DWORD CALLBACK HelDdSetMode(LPDDHAL_SETMODEDATA SetMode)
#define DDRAWIPAL_4
Definition: ddrawi.h:1571
#define DX_STUB
Definition: rosdraw.h:224
DWORD CALLBACK HelDdSetExclusiveMode(LPDDHAL_SETEXCLUSIVEMODEDATA lpSetExclusiveMode)
DWORD CALLBACK HelDdDestroyDriver(LPDDHAL_DESTROYDRIVERDATA lpDestroyDriver)
DWORD CALLBACK HelDdSetColorKey(LPDDHAL_DRVSETCOLORKEYDATA lpDrvSetColorKey)
DWORD CALLBACK HelDdCreatePalette(LPDDHAL_CREATEPALETTEDATA lpCreatePalette)
DWORD CALLBACK HelDdCanCreateSurface(LPDDHAL_CANCREATESURFACEDATA lpCanCreateSurface)
WORD palNumEntries
Definition: wingdi.h:1829
DWORD dwModeIndex
Definition: ddrawi.h:767