Changeset 5820 for trunk/src


Ignore:
Timestamp:
May 28, 2001, 7:18:33 PM (24 years ago)
Author:
phaller
Message:

Implemented DirectDrawCreateClipper

Location:
trunk/src/ddraw
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/ddraw/OS2CLIPPER.CPP

    r5472 r5820  
    1 /* $Id: OS2CLIPPER.CPP,v 1.11 2001-04-04 09:02:14 sandervl Exp $ */
     1/* $Id: OS2CLIPPER.CPP,v 1.12 2001-05-28 17:17:09 phaller Exp $ */
    22
    33/*
     
    2222#include <winerror.h>
    2323#include <winuser.h>
     24
     25//******************************************************************************
     26//******************************************************************************
     27OS2IDirectDrawClipper::OS2IDirectDrawClipper(void) :
     28                 Referenced(0), lastError(DD_OK),
     29                 clipWindow(0)
     30{
     31  // this constructor creates an unassociated instance of the ddraw clipper,
     32  // no ddraw object is associated
     33
     34  lpVtbl                  = &Vtbl;
     35  Vtbl.AddRef             = ClipAddRef;
     36  Vtbl.Release            = ClipRelease;
     37  Vtbl.QueryInterface     = ClipQueryInterface;
     38  Vtbl.GetClipList        = ClipGetClipList;
     39  Vtbl.GetHWnd            = ClipGetHWnd;
     40  Vtbl.Initialize         = ClipInitialize;
     41  Vtbl.IsClipListChanged  = ClipIsClipListChanged;
     42  Vtbl.SetClipList        = ClipSetClipList;
     43  Vtbl.SetHWnd            = ClipSetHWnd;
     44
     45  lpDraw                  = NULL;
     46  // lpDraw->Vtbl.AddRef(lpDraw);
     47  // hDive                   = lpDirectDraw->GetDiveInstance();
     48  windowRect.left = windowRect.right = windowRect.top = windowRect.bottom = 0;
     49}
    2450
    2551//******************************************************************************
     
    147173HRESULT WIN32API ClipGetHWnd(THIS This, HWND FAR *pHwnd)
    148174{
    149  OS2IDirectDrawClipper *me = (OS2IDirectDrawClipper *)This;
     175  OS2IDirectDrawClipper *me = (OS2IDirectDrawClipper *)This;
    150176
    151177  dprintf(("DDRAW: ClipGetHWnd %x %x", This, me->clipWindow));
     
    158184HRESULT WIN32API ClipInitialize(THIS This, LPDIRECTDRAW lpDD, DWORD dwFlags)
    159185{
     186  OS2IDirectDrawClipper *me = (OS2IDirectDrawClipper *)This;
     187
    160188  dprintf(("DDRAW: ClipInitialize %x %x %x", This, lpDD, dwFlags));
    161189
    162   return(DDERR_ALREADYINITIALIZED); // Init is done during creation see M$ Doc
     190  // check parameters
     191  if (dwFlags != 0)
     192      return DDERR_INVALIDPARAMS;
     193
     194  // check if already initialized
     195  if (me->hDive != NULL)
     196    return(DDERR_ALREADYINITIALIZED); // Init is done during creation see M$ Doc
     197
     198  // initialize this instance (created with DirectDrawCreateClipper)
     199
     200  if (lpDD != NULL)
     201  {
     202      OS2IDirectDraw *os2DD = (OS2IDirectDraw *)lpDD;
     203      me->lpDraw = os2DD;
     204      me->lpDraw->Vtbl.AddRef(me->lpDraw);
     205      me->hDive = me->lpDraw->GetDiveInstance();
     206  }
     207  else
     208  {
     209      // we're supposed to create an independent DirectDrawClipper object
     210      // now.
     211      if (me->lpDraw != NULL)
     212      {
     213          // we're not handling this any other currently
     214          return(DDERR_ALREADYINITIALIZED);
     215      }
     216      // else
     217      //   we've been independent and remain so ...
     218  }
     219
     220  return(DD_OK);
    163221}
    164222//******************************************************************************
  • trunk/src/ddraw/OS2CLIPPER.H

    r4146 r5820  
    1 /* $Id: OS2CLIPPER.H,v 1.7 2000-09-02 08:27:05 sandervl Exp $ */
     1/* $Id: OS2CLIPPER.H,v 1.8 2001-05-28 17:17:12 phaller Exp $ */
    22
    33/*
     
    2424
    2525  OS2IDirectDrawClipper(OS2IDirectDraw *lpDirectDraw);
    26        ~OS2IDirectDrawClipper();
     26  OS2IDirectDrawClipper(void);
     27  ~OS2IDirectDrawClipper();
    2728
    2829        int             Referenced;
  • trunk/src/ddraw/ddraw.DEF

    r5326 r5820  
    1 ; $Id: ddraw.DEF,v 1.8 2001-03-18 21:44:44 mike Exp $
     1; $Id: ddraw.DEF,v 1.9 2001-05-28 17:17:14 phaller Exp $
    22
    33;
     
    77DATA MULTIPLE NONSHARED READWRITE LOADONCALL
    88CODE LOADONCALL
     9
     10DESCRIPTION 'Odin32 System DLL - DDraw'
    911
    1012IMPORTS
     
    2123; DSoundHelp                @8
    2224 DirectDrawCreate         = _OS2DirectDrawCreate@12             @9
    23 ; DirectDrawCreateClipper         @10
     25 DirectDrawCreateClipper  = _OS2DirectDrawCreateClipper@12      @10
    2426 DirectDrawCreateEx       = _DirectDrawCreateEx@16              @11
    2527 DirectDrawEnumerateA     = _OS2DirectDrawEnumerateA@8          @12
  • trunk/src/ddraw/makefile

    r5326 r5820  
    1 # $Id: makefile,v 1.27 2001-03-18 21:44:45 mike Exp $
     1# $Id: makefile,v 1.28 2001-05-28 17:17:15 phaller Exp $
    22
    33#
     
    1919OBJS = \
    2020$(OBJDIR)\ddraw.obj \
     21$(OBJDIR)\ddrawclipper.obj \
    2122$(OBJDIR)\os2ddraw.obj \
    2223$(OBJDIR)\os2clipper.obj \
Note: See TracChangeset for help on using the changeset viewer.