Last change
on this file since 21479 was 21479, checked in by dmik, 15 years ago |
Get rid of dd_obj_base.h which duplicates obj_base.h creating unnecessary mess (symbol/define duplication) and conflicts when both the DDarw and other COM-related headers are included.
|
File size:
1.7 KB
|
Line | |
---|
1 | /* $Id: ddclipper.cpp,v 1.1 2002-12-04 10:34:57 sandervl Exp $ */
|
---|
2 |
|
---|
3 | /*
|
---|
4 | * DXDrawClipper DLL implementaion
|
---|
5 | *
|
---|
6 | * Copyright 2001 Patrick Haller <patrick.haller@innotek.de>
|
---|
7 | *
|
---|
8 | *
|
---|
9 | * Project Odin Software License can be found in LICENSE.TXT
|
---|
10 | *
|
---|
11 | */
|
---|
12 |
|
---|
13 | // define the following as we include winnt.h
|
---|
14 | #define _OS2WIN_H
|
---|
15 | #define FAR
|
---|
16 |
|
---|
17 | #include <odin.h>
|
---|
18 | #include <winbase.h>
|
---|
19 | #include <memory.h>
|
---|
20 | #include <stdio.h>
|
---|
21 |
|
---|
22 | #define CINTERFACE
|
---|
23 | #include "ddraw2d.h"
|
---|
24 | #include "clipper.h"
|
---|
25 | #include "winerror.h"
|
---|
26 |
|
---|
27 | #include <misc.h>
|
---|
28 |
|
---|
29 | //******************************************************************************
|
---|
30 | //******************************************************************************
|
---|
31 | HRESULT WIN32API OS2DirectDrawCreateClipper(DWORD dwFlags,
|
---|
32 | LPDIRECTDRAWCLIPPER FAR *lplpDDClipper,
|
---|
33 | IUnknown FAR *pUnkOuter)
|
---|
34 | {
|
---|
35 | OS2IDirectDrawClipper *newDDClipper;
|
---|
36 | HRESULT rc;
|
---|
37 |
|
---|
38 | dprintf(("DDRAW-CLIPPER: DirectDrawCreateClipper(%08xh,%08xh,%08xh)\n",
|
---|
39 | dwFlags,
|
---|
40 | lplpDDClipper,
|
---|
41 | pUnkOuter));
|
---|
42 |
|
---|
43 | // Verify parameters according to the docs
|
---|
44 | if (pUnkOuter != NULL)
|
---|
45 | return CLASS_E_NOAGGREGATION;
|
---|
46 |
|
---|
47 | if (dwFlags != 0)
|
---|
48 | return DDERR_INVALIDPARAMS;
|
---|
49 |
|
---|
50 |
|
---|
51 | newDDClipper = new OS2IDirectDrawClipper();
|
---|
52 |
|
---|
53 | if(newDDClipper == NULL)
|
---|
54 | {
|
---|
55 | rc = DDERR_OUTOFMEMORY;
|
---|
56 | }
|
---|
57 | else
|
---|
58 | {
|
---|
59 | newDDClipper->Vtbl.fnAddRef((IDirectDrawClipper *)newDDClipper);
|
---|
60 |
|
---|
61 | rc = newDDClipper->GetLastError();
|
---|
62 | if(rc != DD_OK)
|
---|
63 | {
|
---|
64 | *lplpDDClipper = NULL;
|
---|
65 |
|
---|
66 | delete newDDClipper;
|
---|
67 | }
|
---|
68 | else
|
---|
69 | *lplpDDClipper = (LPDIRECTDRAWCLIPPER)newDDClipper;
|
---|
70 | }
|
---|
71 | return(rc);
|
---|
72 | }
|
---|
73 |
|
---|
74 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.