source: trunk/src/ddraw/ddraw.CPP@ 46

Last change on this file since 46 was 46, checked in by sandervl, 26 years ago

* empty log message *

File size: 3.2 KB
Line 
1/*
2 * DirectDraw exported APIs
3 *
4 * Copyright 1998 Sander van Leeuwen (sandervl@xs4all.nl)
5 *
6 * Project Odin Software License can be found in LICENSE.TXT
7 *
8 */
9
10/*@Const************************************************************************
11* Defined Constants *
12*******************************************************************************/
13#define INITGUID
14#define INCL_GUIDS
15#define WIN32SDK_NOPOSTWRAPPER
16
17/*@Header***********************************************************************
18* Header Files *
19*******************************************************************************/
20#include <os2win.h>
21#include <memory.h>
22#include <builtin.h>
23#include <dive.h>
24
25#include <w_windows.h>
26#include <ddraw.h>
27#include <d3d.h>
28#include <Win32SDKPostWrapper.h>
29
30#include "os2ddraw.h"
31#include "misc.h"
32
33//******************************************************************************
34//******************************************************************************
35HRESULT WIN32API OS2DirectDrawCreate(GUID FAR *lpGUID,
36 LPDIRECTDRAW FAR *lplpDD,
37 IUnknown FAR *pUnkOuter)
38{
39 OS2IDirectDraw *newdraw = new OS2IDirectDraw(lpGUID);;
40 HRESULT rc;
41
42 dprintf(("DirectDrawCreate %X %X %X\n", lpGUID, lplpDD, pUnkOuter));
43
44 if(newdraw == NULL) return(DDERR_NODIRECTDRAWHW);
45
46// newdraw->Vtbl.AddRef((IDirectDraw *)newdraw);
47 rc = newdraw->GetLastError();
48 if(rc != DD_OK) {
49 *lplpDD = NULL;
50 delete newdraw;
51 }
52 else *lplpDD = (LPDIRECTDRAW)newdraw;
53 return(rc);
54}
55//******************************************************************************
56#if 0 //KSO Apr 19 1999: not needed any longer!
57typedef BOOL (FAR PASCAL * LPDDENUMCALLBACKA)(GUID FAR *, LPSTR, LPSTR, LPVOID);
58#endif
59//******************************************************************************
60HRESULT WIN32API OS2DirectDrawEnumerateA(LPDDENUMCALLBACKA lpCallback,
61 LPVOID lpContext)
62{
63 dprintf(("DirectDrawEnumerateA\n"));
64 //call it twice for the DirectDraw & Direct3D classes
65 if(lpCallback(NULL, "DIVE DirectDraw for OS/2",
66 "DirectDraw/2 v0.1", lpContext) == DDENUMRET_CANCEL) {
67 return(DD_OK);
68 }
69 else //now for Direct3D
70 if(lpCallback((GUID *)&IID_IDirect3D, "3Dfx Voodoo Direct3D/2",
71 "Direct3D/2 v0.1", lpContext) == DDENUMRET_CANCEL) {
72 return(DD_OK);
73 }
74 return(DD_OK);
75}
76//******************************************************************************
77//******************************************************************************
78DWORD WIN32API DDHAL32_VidMemFree(DWORD address)
79{
80 dprintf(("DDHAL32_VidMemFree, not supported\n"));
81 return(0);
82}
83//******************************************************************************
84//******************************************************************************
85DWORD WIN32API DDHAL32_VidMemAlloc(DWORD size)
86{
87 dprintf(("DDHAL32_VidMemAlloc, not supported\n"));
88 return(0);
89}
90//******************************************************************************
91//******************************************************************************
Note: See TracBrowser for help on using the repository browser.