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