d3drm: Remove wrong description.
[wine] / dlls / d3drm / d3drm.c
1 /*
2  * Implementation of IDirect3DRM Interface
3  *
4  * Copyright 2010 Christian Costa
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19  */
20
21 #include "wine/debug.h"
22
23 #define COBJMACROS
24
25 #include "winbase.h"
26 #include "wingdi.h"
27
28 #include "d3drm_private.h"
29 #include "d3drm.h"
30
31 WINE_DEFAULT_DEBUG_CHANNEL(d3drm);
32
33 typedef struct {
34     const IDirect3DRMVtbl *lpVtbl;
35     LONG ref;
36 } IDirect3DRMImpl;
37
38 static const struct IDirect3DRMVtbl Direct3DRM_Vtbl;
39
40 HRESULT Direct3DRM_create(LPDIRECT3DRM* ppDirect3DRM)
41 {
42     IDirect3DRMImpl* object;
43
44     TRACE("(%p)\n", ppDirect3DRM);
45
46     object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DRMImpl));
47     if (!object)
48     {
49         ERR("Out of memory\n");
50         return E_OUTOFMEMORY;
51     }
52
53     object->lpVtbl = &Direct3DRM_Vtbl;
54     object->ref = 1;
55
56     *ppDirect3DRM = (IDirect3DRM*)object;
57
58     return S_OK;
59 }
60
61 /*** IUnknown methods ***/
62 static HRESULT WINAPI IDirect3DRMImpl_QueryInterface(IDirect3DRM* iface, REFIID riid, void** ppvObject)
63 {
64     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
65
66     TRACE("(%p/%p)->(%s,%p)\n", iface, This, debugstr_guid(riid), ppvObject);
67
68     if (IsEqualGUID(riid, &IID_IUnknown) ||
69         IsEqualGUID(riid, &IID_IDirect3DRM))
70     {
71         IClassFactory_AddRef(iface);
72         *ppvObject = This;
73         return S_OK;
74     }
75
76     ERR("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppvObject);
77     return E_NOINTERFACE;
78 }
79
80 static ULONG WINAPI IDirect3DRMImpl_AddRef(IDirect3DRM* iface)
81 {
82     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
83
84     TRACE("(%p/%p)\n", iface, This);
85
86     return InterlockedIncrement(&This->ref);
87 }
88
89 static ULONG WINAPI IDirect3DRMImpl_Release(IDirect3DRM* iface)
90 {
91     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
92     ULONG ref = InterlockedDecrement(&This->ref);
93
94     TRACE("(%p/%p)\n", iface, This);
95
96     if (!ref)
97         HeapFree(GetProcessHeap(), 0, This);
98
99     return ref;
100 }
101
102 /*** IDirect3DRM methods ***/
103 static HRESULT WINAPI IDirect3DRMImpl_CreateObject(IDirect3DRM* iface, REFCLSID rclsid, LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObj)
104 {
105     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
106
107     FIXME("(%p/%p)->(%s,%p,%s,%p): stub\n", iface, This, debugstr_guid(rclsid), pUnkOuter, debugstr_guid(riid), ppvObj);
108
109     return E_NOTIMPL;
110 }
111
112 static HRESULT WINAPI IDirect3DRMImpl_CreateFrame(IDirect3DRM* iface, LPDIRECT3DRMFRAME pFrameParent, LPDIRECT3DRMFRAME * ppFrame)
113 {
114     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
115
116     FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, pFrameParent, ppFrame);
117
118     return E_NOTIMPL;
119 }
120
121 static HRESULT WINAPI IDirect3DRMImpl_CreateMesh(IDirect3DRM* iface, LPDIRECT3DRMMESH * ppMesh)
122 {
123     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
124
125     FIXME("(%p/%p)->(%p): stub\n", iface, This, ppMesh);
126
127     return E_NOTIMPL;
128 }
129
130 static HRESULT WINAPI IDirect3DRMImpl_CreateMeshBuilder(IDirect3DRM* iface, LPDIRECT3DRMMESHBUILDER * ppMeshBuilder)
131 {
132     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
133
134     TRACE("(%p/%p)->(%p)\n", iface, This, ppMeshBuilder);
135
136     return Direct3DRMMeshBuilder_create(ppMeshBuilder);
137 }
138
139 static HRESULT WINAPI IDirect3DRMImpl_CreateFace(IDirect3DRM* iface, LPDIRECT3DRMFACE * ppFace)
140 {
141     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
142
143     FIXME("(%p/%p)->(%p): stub\n", iface, This, ppFace);
144
145     return E_NOTIMPL;
146 }
147
148 static HRESULT WINAPI IDirect3DRMImpl_CreateAnimation(IDirect3DRM* iface, LPDIRECT3DRMANIMATION * ppAnimation)
149 {
150     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
151
152     FIXME("(%p/%p)->(%p): stub\n", iface, This, ppAnimation);
153
154     return E_NOTIMPL;
155 }
156
157 static HRESULT WINAPI IDirect3DRMImpl_CreateAnimationSet(IDirect3DRM* iface, LPDIRECT3DRMANIMATIONSET * ppAnimationSet)
158 {
159     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
160
161     FIXME("(%p/%p)->(%p): stub\n", iface, This, ppAnimationSet);
162
163     return E_NOTIMPL;
164 }
165
166 static HRESULT WINAPI IDirect3DRMImpl_CreateTexture(IDirect3DRM* iface, LPD3DRMIMAGE pImage, LPDIRECT3DRMTEXTURE * ppTexture)
167 {
168     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
169
170     FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, pImage, ppTexture);
171
172     return E_NOTIMPL;
173 }
174
175 static HRESULT WINAPI IDirect3DRMImpl_CreateLight(IDirect3DRM* iface, D3DRMLIGHTTYPE type, D3DCOLOR color, LPDIRECT3DRMLIGHT * ppLight)
176 {
177     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
178
179     FIXME("(%p/%p)->(%d,%d,%p): stub\n", iface, This, type, color, ppLight);
180
181     return E_NOTIMPL;
182 }
183
184 static HRESULT WINAPI IDirect3DRMImpl_CreateLightRGB(IDirect3DRM* iface, D3DRMLIGHTTYPE type,  D3DVALUE red, D3DVALUE green, D3DVALUE blue, LPDIRECT3DRMLIGHT * ppLight)
185 {
186     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
187
188     FIXME("(%p/%p)->(%d,%f,%f,%f,%p): stub\n", iface, This, type, red, green, blue, ppLight);
189
190     return E_NOTIMPL;
191 }
192
193 static HRESULT WINAPI IDirect3DRMImpl_Material(IDirect3DRM* iface, D3DVALUE m, LPDIRECT3DRMMATERIAL * ppMaterial)
194 {
195     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
196
197     FIXME("(%p/%p)->(%f,%p): stub\n", iface, This, m, ppMaterial);
198
199     return E_NOTIMPL;
200 }
201
202 static HRESULT WINAPI IDirect3DRMImpl_CreateDevice(IDirect3DRM* iface, DWORD width, DWORD height, LPDIRECT3DRMDEVICE * ppDevice)
203 {
204     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
205
206     FIXME("(%p/%p)->(%d,%d,%p): stub\n", iface, This, width, height, ppDevice);
207
208     return E_NOTIMPL;
209 }
210
211 static HRESULT WINAPI IDirect3DRMImpl_CreateDeviceFromSurface(IDirect3DRM* iface, LPGUID pGUID, LPDIRECTDRAW pDD, LPDIRECTDRAWSURFACE pDDSBack, LPDIRECT3DRMDEVICE * ppDevice)
212 {
213     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
214
215     FIXME("(%p/%p)->(%s,%p,%p,%p): stub\n", iface, This, debugstr_guid(pGUID), pDD, pDDSBack, ppDevice);
216
217     return E_NOTIMPL;
218 }
219
220 static HRESULT WINAPI IDirect3DRMImpl_CreateDeviceFromD3D(IDirect3DRM* iface, LPDIRECT3D pD3D, LPDIRECT3DDEVICE pD3DDev, LPDIRECT3DRMDEVICE * ppDevice)
221 {
222     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
223
224     FIXME("(%p/%p)->(%p,%p,%p): stub\n", iface, This, pD3D, pD3DDev, ppDevice);
225
226     return E_NOTIMPL;
227 }
228
229 static HRESULT WINAPI IDirect3DRMImpl_CreateDeviceFromClipper(IDirect3DRM* iface, LPDIRECTDRAWCLIPPER pDDClipper, LPGUID pGUID, int width, int height, LPDIRECT3DRMDEVICE * ppDevice)
230 {
231     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
232
233     FIXME("(%p/%p)->(%p,%s,%d,%d,%p): stub\n", iface, This, pDDClipper, debugstr_guid(pGUID), width, height, ppDevice);
234
235     return E_NOTIMPL;
236 }
237
238 static HRESULT WINAPI IDirect3DRMImpl_CreateShadow(IDirect3DRM* iface, LPDIRECT3DRMVISUAL pVisual, LPDIRECT3DRMLIGHT pLight, D3DVALUE px, D3DVALUE py, D3DVALUE pz, D3DVALUE nx, D3DVALUE ny, D3DVALUE nz, LPDIRECT3DRMVISUAL * ppVisual)
239 {
240     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
241
242     FIXME("(%p/%p)->(%p,%p,%f,%f,%f,%f,%f,%f,%p): stub\n", iface, This, pVisual, pLight, px, py, pz, nx, ny, nz, ppVisual);
243
244     return E_NOTIMPL;
245 }
246
247 static HRESULT WINAPI IDirect3DRMImpl_CreateTextureFromSurface(IDirect3DRM* iface, LPDIRECTDRAWSURFACE pDDS, LPDIRECT3DRMTEXTURE * ppTexture)
248 {
249     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
250
251     FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, pDDS, ppTexture);
252
253     return E_NOTIMPL;
254 }
255
256 static HRESULT WINAPI IDirect3DRMImpl_CreateViewport(IDirect3DRM* iface, LPDIRECT3DRMDEVICE pDevice, LPDIRECT3DRMFRAME pFrame, DWORD xpos, DWORD ypos, DWORD width, DWORD height, LPDIRECT3DRMVIEWPORT * ppViewport)
257 {
258     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
259
260     FIXME("(%p/%p)->(%p,%p,%d,%d,%d,%d,%p): stub\n", iface, This, pDevice, pFrame, xpos, ypos, width, height, ppViewport);
261
262     return E_NOTIMPL;
263 }
264
265 static HRESULT WINAPI IDirect3DRMImpl_CreateWrap(IDirect3DRM* iface, D3DRMWRAPTYPE type, LPDIRECT3DRMFRAME pFrame, D3DVALUE ox, D3DVALUE oy, D3DVALUE oz, D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, D3DVALUE ux, D3DVALUE uy, D3DVALUE uz, D3DVALUE ou, D3DVALUE ov, D3DVALUE su, D3DVALUE sv, LPDIRECT3DRMWRAP * ppWrap)
266 {
267     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
268
269     FIXME("(%p/%p)->(%d,%p,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%p): stub\n", iface, This, type, pFrame, ox, oy, oz, dx, dy, dz, ux, uy, uz, ou, ov, su, sv, ppWrap);
270
271     return E_NOTIMPL;
272 }
273
274 static HRESULT WINAPI IDirect3DRMImpl_CreateUserVisual(IDirect3DRM* iface, D3DRMUSERVISUALCALLBACK cb, LPVOID pArg, LPDIRECT3DRMUSERVISUAL * ppUserVisual)
275 {
276     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
277
278     FIXME("(%p/%p)->(%p,%p,%p): stub\n", iface, This, cb, pArg, ppUserVisual);
279
280     return E_NOTIMPL;
281 }
282
283 static HRESULT WINAPI IDirect3DRMImpl_LoadTexture(IDirect3DRM* iface, const char * filename, LPDIRECT3DRMTEXTURE * ppTexture)
284 {
285     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
286
287     FIXME("(%p/%p)->(%s,%p): stub\n", iface, This, filename, ppTexture);
288
289     return E_NOTIMPL;
290 }
291
292 static HRESULT WINAPI IDirect3DRMImpl_LoadTextureFromResource(IDirect3DRM* iface, HRSRC rs, LPDIRECT3DRMTEXTURE * ppTexture)
293 {
294     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
295
296     FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, rs, ppTexture);
297
298     return E_NOTIMPL;
299 }
300
301 static HRESULT WINAPI IDirect3DRMImpl_SetSearchPath(IDirect3DRM* iface, LPCSTR path)
302 {
303     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
304
305     FIXME("(%p/%p)->(%s): stub\n", iface, This, path);
306
307     return E_NOTIMPL;
308 }
309
310 static HRESULT WINAPI IDirect3DRMImpl_AddSearchPath(IDirect3DRM* iface, LPCSTR path)
311 {
312     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
313
314     FIXME("(%p/%p)->(%s): stub\n", iface, This, path);
315
316     return E_NOTIMPL;
317 }
318
319 static HRESULT WINAPI IDirect3DRMImpl_GetSearchPath(IDirect3DRM* iface, DWORD *size_return, LPSTR path_return)
320 {
321     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
322
323     FIXME("(%p/%p)->(%p,%s): stub\n", iface, This, size_return, path_return);
324
325     return E_NOTIMPL;
326 }
327
328 static HRESULT WINAPI IDirect3DRMImpl_SetDefaultTextureColors(IDirect3DRM* iface, DWORD nb_colors)
329 {
330     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
331
332     FIXME("(%p/%p)->(%d): stub\n", iface, This, nb_colors);
333
334     return E_NOTIMPL;
335 }
336
337 static HRESULT WINAPI IDirect3DRMImpl_SetDefaultTextureShades(IDirect3DRM* iface, DWORD nb_shades)
338 {
339     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
340
341     FIXME("(%p/%p)->(%d): stub\n", iface, This, nb_shades);
342
343     return E_NOTIMPL;
344 }
345
346 static HRESULT WINAPI IDirect3DRMImpl_GetDevices(IDirect3DRM* iface, LPDIRECT3DRMDEVICEARRAY * ppDeviceArray)
347 {
348     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
349
350     FIXME("(%p/%p)->(%p): stub\n", iface, This, ppDeviceArray);
351
352     return E_NOTIMPL;
353 }
354
355 static HRESULT WINAPI IDirect3DRMImpl_GetNamedObject(IDirect3DRM* iface, const char * pName, LPDIRECT3DRMOBJECT * ppObject)
356 {
357     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
358
359     FIXME("(%p/%p)->(%s,%p): stub\n", iface, This, pName, ppObject);
360
361     return E_NOTIMPL;
362 }
363
364 static HRESULT WINAPI IDirect3DRMImpl_EnumerateObjects(IDirect3DRM* iface, D3DRMOBJECTCALLBACK cb, LPVOID pArg)
365 {
366     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
367
368     FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, cb, pArg);
369
370     return E_NOTIMPL;
371 }
372
373 static HRESULT WINAPI IDirect3DRMImpl_Load(IDirect3DRM* iface, LPVOID pObjSource, LPVOID pObjID, LPIID * ppGUIDs, DWORD nb_GUIDs, D3DRMLOADOPTIONS LOFlags, D3DRMLOADCALLBACK LoadProc, LPVOID pArgLP, D3DRMLOADTEXTURECALLBACK LoadTextureProc, LPVOID pArgLTP, LPDIRECT3DRMFRAME pParentFrame)
374 {
375     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
376
377     FIXME("(%p/%p)->(%p,%p,%p,%d,%d,%p,%p,%p,%p,%p): stub\n", iface, This, pObjSource, pObjID, ppGUIDs, nb_GUIDs, LOFlags, LoadProc, pArgLP, LoadTextureProc, pArgLTP, pParentFrame);
378
379     return E_NOTIMPL;
380 }
381
382 static HRESULT WINAPI IDirect3DRMImpl_Tick(IDirect3DRM* iface, D3DVALUE tick)
383 {
384     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
385
386     FIXME("(%p/%p)->(%f): stub\n", iface, This, tick);
387
388     return E_NOTIMPL;
389 }
390
391 static const struct IDirect3DRMVtbl Direct3DRM_Vtbl =
392 {
393     IDirect3DRMImpl_QueryInterface,
394     IDirect3DRMImpl_AddRef,
395     IDirect3DRMImpl_Release,
396     IDirect3DRMImpl_CreateObject,
397     IDirect3DRMImpl_CreateFrame,
398     IDirect3DRMImpl_CreateMesh,
399     IDirect3DRMImpl_CreateMeshBuilder,
400     IDirect3DRMImpl_CreateFace,
401     IDirect3DRMImpl_CreateAnimation,
402     IDirect3DRMImpl_CreateAnimationSet,
403     IDirect3DRMImpl_CreateTexture,
404     IDirect3DRMImpl_CreateLight,
405     IDirect3DRMImpl_CreateLightRGB,
406     IDirect3DRMImpl_Material,
407     IDirect3DRMImpl_CreateDevice,
408     IDirect3DRMImpl_CreateDeviceFromSurface,
409     IDirect3DRMImpl_CreateDeviceFromD3D,
410     IDirect3DRMImpl_CreateDeviceFromClipper,
411     IDirect3DRMImpl_CreateShadow,
412     IDirect3DRMImpl_CreateTextureFromSurface,
413     IDirect3DRMImpl_CreateViewport,
414     IDirect3DRMImpl_CreateWrap,
415     IDirect3DRMImpl_CreateUserVisual,
416     IDirect3DRMImpl_LoadTexture,
417     IDirect3DRMImpl_LoadTextureFromResource,
418     IDirect3DRMImpl_SetSearchPath,
419     IDirect3DRMImpl_AddSearchPath,
420     IDirect3DRMImpl_GetSearchPath,
421     IDirect3DRMImpl_SetDefaultTextureColors,
422     IDirect3DRMImpl_SetDefaultTextureShades,
423     IDirect3DRMImpl_GetDevices,
424     IDirect3DRMImpl_GetNamedObject,
425     IDirect3DRMImpl_EnumerateObjects,
426     IDirect3DRMImpl_Load,
427     IDirect3DRMImpl_Tick
428 };