| Line |  | 
|---|
| 1 | /* $Id: ddrawclipper.cpp,v 1.2 2002-02-17 20:40:06 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 | #define INITGUID | 
|---|
| 22 | #define ICOM_CINTERFACE 1 | 
|---|
| 23 | #define CINTERFACE | 
|---|
| 24 |  | 
|---|
| 25 | #include "os2ddraw.h" | 
|---|
| 26 | #include "os2clipper.h" | 
|---|
| 27 | #include "winerror.h" | 
|---|
| 28 |  | 
|---|
| 29 | #include <misc.h> | 
|---|
| 30 |  | 
|---|
| 31 | extern "C" { | 
|---|
| 32 |  | 
|---|
| 33 | //****************************************************************************** | 
|---|
| 34 | //****************************************************************************** | 
|---|
| 35 | HRESULT WIN32API OS2DirectDrawCreateClipper(DWORD dwFlags, | 
|---|
| 36 | LPDIRECTDRAWCLIPPER FAR *lplpDDClipper, | 
|---|
| 37 | IUnknown FAR *pUnkOuter) | 
|---|
| 38 | { | 
|---|
| 39 | OS2IDirectDrawClipper *newDDClipper; | 
|---|
| 40 | HRESULT         rc; | 
|---|
| 41 |  | 
|---|
| 42 | dprintf(("DDRAW-CLIPPER: DirectDrawCreateClipper(%08xh,%08xh,%08xh)\n", | 
|---|
| 43 | dwFlags, | 
|---|
| 44 | lplpDDClipper, | 
|---|
| 45 | pUnkOuter)); | 
|---|
| 46 |  | 
|---|
| 47 | // Verify parameters according to the docs | 
|---|
| 48 | if (pUnkOuter != NULL) | 
|---|
| 49 | return CLASS_E_NOAGGREGATION; | 
|---|
| 50 |  | 
|---|
| 51 | if (dwFlags != 0) | 
|---|
| 52 | return DDERR_INVALIDPARAMS; | 
|---|
| 53 |  | 
|---|
| 54 |  | 
|---|
| 55 | newDDClipper = new OS2IDirectDrawClipper(); | 
|---|
| 56 |  | 
|---|
| 57 | if(newDDClipper == NULL) | 
|---|
| 58 | { | 
|---|
| 59 | rc = DDERR_OUTOFMEMORY; | 
|---|
| 60 | } | 
|---|
| 61 | else | 
|---|
| 62 | { | 
|---|
| 63 | newDDClipper->Vtbl.AddRef((IDirectDrawClipper *)newDDClipper); | 
|---|
| 64 |  | 
|---|
| 65 | rc = newDDClipper->GetLastError(); | 
|---|
| 66 | if(rc != DD_OK) | 
|---|
| 67 | { | 
|---|
| 68 | *lplpDDClipper = NULL; | 
|---|
| 69 |  | 
|---|
| 70 | delete newDDClipper; | 
|---|
| 71 | } | 
|---|
| 72 | else | 
|---|
| 73 | *lplpDDClipper = (LPDIRECTDRAWCLIPPER)newDDClipper; | 
|---|
| 74 | } | 
|---|
| 75 | return(rc); | 
|---|
| 76 | } | 
|---|
| 77 |  | 
|---|
| 78 |  | 
|---|
| 79 | } /* extern "C" */ | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.