Ignore:
Timestamp:
May 23, 2000, 10:41:28 PM (25 years ago)
Author:
jeroen
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/opengl/mesa/mesadive.c

    r2962 r3598  
    1 /* $Id: mesadive.c,v 1.1 2000-03-01 18:49:32 jeroen Exp $ */
     1/* $Id: mesadive.c,v 1.2 2000-05-23 20:40:41 jeroen Exp $ */
    22/*****************************************************************************/
    33/*                                                                           */
     
    66/*****************************************************************************/
    77
     8#ifdef DIVE
    89#define INCL_BASE
    910#define INCL_WIN
    1011#define INCL_GPI
    1112
     13
    1214#include <os2wrap.h>
     15#include "..\..\ddraw\divewrap.h"
    1316#include <memory.h>
    1417#include <malloc.h>
     18#include <fourcc.h>
    1519#include <misc.h>
    16 #include <dive.h>
    17 #include <fourcc.h>
    1820
    1921#define mmioFOURCC( ch0, ch1, ch2, ch3 )                         \
     
    3739extern void WMesaUpdateScreenPos(PWMC c,HWND hWnd);
    3840extern HWND Win32ToOS2Handle(HWND);
     41extern INT WINAPI MessageBoxA(HWND,LPCSTR,LPCSTR,UINT);
    3942
    4043extern PWMC Current;
     
    9598    {
    9699      case PF_8A8B8G8R:
    97         dprintf(("OPENGL32: FOURCC(PF_8A8B8G8R)\n"));
    98100        return FOURCC_BGR4;
    99101
    100102      case PF_8R8G8B:
    101         dprintf(("OPENGL32: FOURCC(PF_8R8G8B)\n"));
    102103        return FOURCC_RGB3;
    103104
    104105      case PF_5R6G5B:
    105         dprintf(("OPENGL32: FOURCC(PF_5R6G5B)\n"));
    106106        return FOURCC_R565;
    107107
    108108      case PF_DITHER8:
    109         dprintf(("OPENGL32: FOURCC(PF_DITHER8)\n"));
    110109        break;
    111110
    112111      case PF_LOOKUP:
    113         dprintf(("OPENGL32: FOURCC(PF_LOOKUP)\n"));
    114112        return FOURCC_LUT8;
    115113
    116114      case PF_GRAYSCALE:
    117         dprintf(("OPENGL32: FOURCC(PF_GRAYSCALE)\n"));
    118115        return FOURCC_GREY;
    119116
    120117      case PF_BADFORMAT:
    121         dprintf(("OPENGL32: FOURCC(PF_BADFORMAT)\n"));
    122118        return FOURCC_RGB3;
    123119
    124120      case PF_INDEX8:
    125         dprintf(("OPENGL32: FOURCC(PF_INDEX8)\n"));
    126121        return FOURCC_LUT8;
    127122
    128123      default:
    129         dprintf(("OPENGL32: FOURCC(???) -> %d\n",pf));
    130124        break;
    131125    }
     
    136130void DiveWriteBackbuffer( PWMC pwc, int iScanLine, int iPixel, BYTE r, BYTE g, BYTE b)
    137131{
    138   /* dprintf(("OPENGL32: Accessing the BackBuffer %08X\n",pwc->pbPixels));*/
    139132  PBYTE   lpb = pwc->pbPixels;
    140133  PDWORD  lpdw;
     
    143136  ULONG   nOffset = iPixel % nBypp;
    144137
    145 //dprintf(("OPENGL32: wmSetPixel(%d,%d) - lpb= %08X, nBypp=%d\n",iPixel,iScanLine,lpb,nBypp));
    146 
    147138  lpb += pwc->ScanWidth * iScanLine;
    148139
     
    150141  lpdw = (LPDWORD)lpb;
    151142  lpw = (LPWORD)lpb;
    152 
    153     /* dprintf(("OPENGL32: wmSetPixel - lpb= %08X, lpdw=%08X\n",lpb,lpdw));*/
    154143
    155144  if(nBypp == 1)
     
    186175  if(DiveCaps.fBankSwitched)
    187176    {
    188       dprintf(("OPENGL32: Bank-switched DIVE access not yet implemented\n"));
     177      MessageBoxA( NULL, "Bank-Switched DIVE access currently not supported", "", MB_OK );
    189178    }
    190179  else
     
    224213  ULONG rc;
    225214
    226   dprintf(("DiveFlush -- Blitting will now occur\n"));
    227 
    228215  if(!pwc->hDiveInstance)
    229216    {
    230       dprintf(("OPENGL32: wmFlush ->> No backbuffer allocated yet!\n"));
     217      dprintf(("DIVE ERROR : no instance!"));
    231218      return;
    232219    }
     
    239226      /* routine that uses the native output-format...         */
    240227
    241       dprintf(("OPENGL32: Dive -->> Software BLIT!\n"));
    242 
    243228      PBYTE  lpb   = (PBYTE)pwc->ppFrameBuffer;
    244229      PBYTE  lpbb  = pwc->pbPixels;
     
    264249                                  pwc->BackBufferNumber);
    265250
    266       dprintf(("OPENGL32: DiveEndImageBufferAccess rc %d\n",rc));
    267 
    268251      rc=DiveBlitImage(pwc->hDiveInstance,
    269252                       pwc->BackBufferNumber,
    270253                       DIVE_BUFFER_SCREEN);
    271 
    272       dprintf(("OPENGL32: DiveBlitImage rc %d\n",rc));
    273254
    274255      ULONG bsl;
     
    279260                                    &pwc->ScanWidth,
    280261                                    &bsl);
    281 
    282       dprintf(("OPENGL32: Buffered ->> DiveBeginImageBufferAccess rc %d, buffer #%d, pbPixels %08X\n",rc,pwc->BackBufferNumber,pwc->pbPixels));
    283262    }
    284263}
     
    290269  ULONG         rc;
    291270
    292   dprintf(("OPENGL32: DiveDefineRegion - hwnd %08X",hwnd));
    293271
    294272  rgnCtl.ircStart=0;
     
    304282  wc->hps=WinGetPS(hwnd);
    305283
    306   dprintf(("OPENGL32: DiveDefineRegion - hps %08X",wc->hps));
    307 
    308284  wc->hrgn=(ULONG)GpiCreateRegion(wc->hps,0,NULL);
    309285
    310   dprintf(("OPENGL32: DiveDefineRegion - hrgn %08X",wc->hrgn));
    311 
    312286  rc=WinQueryVisibleRegion(hwnd,wc->hrgn);
    313287
    314   dprintf(("OPENGL32: DiveDefineRegion - WinQueryVisibleRegion rc %d",rc));
    315 
    316288  rc=GpiQueryRegionRects(wc->hps,wc->hrgn,NULL,&rgnCtl,(RECTL *)wc->rctls);
    317 
    318   dprintf(("OPENGL32: DiveDefineRegion - GpiQueryRegionRects rc %d",rc));
    319289
    320290  wc->NumClipRects=rgnCtl.crcReturned;
     
    327297  SWP           swp;
    328298  ULONG         rc;
    329 
    330   dprintf(("OPENGL32: Entering DiveBlitSetup - wc %08X, fActivate %d\n",
    331            wc,fActivate));
    332299
    333300  if(!wc)
     
    375342
    376343  rc=DiveSetupBlitter(wc->hDiveInstance,&setup);
    377 
    378   dprintf(("OPENGL32: DiveSetupBlitter rc %d\n",rc));
    379344
    380345  if(rc==DIVE_ERR_INVALID_CONVERSION)
     
    397362  PFNWP f=QueryFn(hwnd);
    398363  ULONG rc;
    399 
    400   dprintf(("OPENGL32: DiveWndMsgRecv %d\n",msg));
    401364
    402365  switch(msg)
     
    440403  *s=width*4;
    441404
    442   dprintf(("OPENGL32: Allocating buffer(%d/%d): %d bytes\n",
    443            width,height,width*height*4));
    444 
    445405  return (PBYTE)malloc(width*height*4);
    446406}
     
    454414    ULONG rc;
    455415    RECT  rect;
    456 
    457     dprintf(("OPENGL32: DiveInit on context %08X\n",wc));
    458416
    459417/*  wc->fullScreen = displayOptions.fullScreen;
     
    479437                &wc->ppFrameBuffer);
    480438
    481     dprintf(("OPENGL32: DiveOpen rc %d - Framebuffer address %08X\n",rc,wc->ppFrameBuffer));
     439    dprintf(("OPENGL32: Created a new dive-instance (%08X) - pfb %08X - rc was %d",
     440             wc->hDiveInstance,
     441             wc->ppFrameBuffer,
     442             rc));
    482443
    483444    if(rc)
     
    510471                               0);
    511472
    512        dprintf(("OPENGL32: Buffered ->> DiveAllocImageBuffer rc %d, buffer #%d\n",rc,wc->BackBufferNumber));
     473       dprintf(("Allocated imagebuffer %d (double-buffered screen). rc is %d",wc->BackBufferNumber,rc));
    513474
    514475       if(rc==DIVE_ERR_SOURCE_FORMAT)
     
    533494                                   wc->pbPixels);
    534495
    535            dprintf(("OPENGL32: Buffered ->> OwnAlloc %08X: DiveAllocImageBuffer rc %d, buffer #%d\n",wc->pbPixels,rc,wc->BackBufferNumber));
     496           dprintf(("Allocated imagebuffer @%08X. rc is %d",wc->pbPixels,rc));
    536497         }
    537498       else
     
    554515                                     &bsl);
    555516
    556        dprintf(("OPENGL32: Buffered ->> DiveBeginImageBufferAccess rc %d, buffer #%d, pbPixels %08X\n",rc,wc->BackBufferNumber,wc->pbPixels));
    557 
    558517       if(rc)
    559518         {
     
    579538{
    580539  ULONG rc;
    581 
    582   dprintf(("OPENGL32: DiveFree ctx %08X\n",wc));
    583540
    584541  if(wc->hDiveInstance!=0)
     
    589546                                      wc->BackBufferNumber);
    590547
    591           dprintf(("OPENGL32: DiveEndImageBufferAccess rc %d\n",rc));
    592 
    593548          rc=DiveFreeImageBuffer(wc->hDiveInstance,
    594549                                 wc->BackBufferNumber);
    595550
    596           dprintf(("OPENGL32: DiveFreeImageBuffer rc %d\n",rc));
    597551        }
    598552
     
    601555        rc=DiveClose(wc->hDiveInstance);
    602556
    603         dprintf(("OPENGL32: DiveClose rc %d\n",rc));
    604 
    605557        wc->hDiveInstance=0;
    606558    }
     
    610562{
    611563  DiveQueryCaps(&DiveCaps,DIVE_BUFFER_SCREEN);
    612 
    613   dprintf(("OPENGL32: Dive Capabilities\n"));
    614   dprintf(("OPENGL32: ulPlaneCount %d\n",DiveCaps.ulPlaneCount));
    615   dprintf(("OPENGL32: fScreenDirect %d\n",DiveCaps.fScreenDirect));
    616   dprintf(("OPENGL32: fBankSwitched %d\n",DiveCaps.fBankSwitched));
    617   dprintf(("OPENGL32: ulDepth %d\n",DiveCaps.ulDepth));
    618   dprintf(("OPENGL32: ulHorizontalResolution %d\n",DiveCaps.ulHorizontalResolution));
    619   dprintf(("OPENGL32: ulVerticalResolution %d\n",DiveCaps.ulVerticalResolution));
    620   dprintf(("OPENGL32: ulScanLineBytes %d\n",DiveCaps.ulScanLineBytes));
    621   dprintf(("OPENGL32: fccColorEncoding %08X\n",DiveCaps.fccColorEncoding));
    622   dprintf(("OPENGL32: ulApertureSize %d\n",DiveCaps.ulApertureSize));
    623   dprintf(("OPENGL32: ulInputFormats %d\n",DiveCaps.ulInputFormats));
    624   dprintf(("OPENGL32: ulOutputFormats %d\n",DiveCaps.ulOutputFormats));
    625   dprintf(("OPENGL32: ulFormatLength %d\n",DiveCaps.ulFormatLength));
    626   dprintf(("OPENGL32: pFormatData %08X\n",DiveCaps.pFormatData));
     564/*
     565  WriteLog("OPENGL32: Dive Capabilities\n");
     566  WriteLog("OPENGL32: ulPlaneCount %d\n",DiveCaps.ulPlaneCount);
     567  WriteLog("OPENGL32: fScreenDirect %d\n",DiveCaps.fScreenDirect);
     568  WriteLog("OPENGL32: fBankSwitched %d\n",DiveCaps.fBankSwitched);
     569  WriteLog("OPENGL32: ulDepth %d\n",DiveCaps.ulDepth);
     570  WriteLog("OPENGL32: ulHorizontalResolution %d\n",DiveCaps.ulHorizontalResolution);
     571  WriteLog("OPENGL32: ulVerticalResolution %d\n",DiveCaps.ulVerticalResolution);
     572  WriteLog("OPENGL32: ulScanLineBytes %d\n",DiveCaps.ulScanLineBytes);
     573  WriteLog("OPENGL32: fccColorEncoding %08X\n",DiveCaps.fccColorEncoding);
     574  WriteLog("OPENGL32: ulApertureSize %d\n",DiveCaps.ulApertureSize);
     575  WriteLog("OPENGL32: ulInputFormats %d\n",DiveCaps.ulInputFormats);
     576  WriteLog("OPENGL32: ulOutputFormats %d\n",DiveCaps.ulOutputFormats);
     577  WriteLog("OPENGL32: ulFormatLength %d\n",DiveCaps.ulFormatLength);
     578  WriteLog("OPENGL32: pFormatData %08X\n",DiveCaps.pFormatData);
     579*/
    627580}
    628581
     
    676629
    677630      default:
    678         dprintf(("OPENGL32: Color encoding %X not matched\n",DiveCaps.fccColorEncoding));
    679631        break;
    680632    }
     
    686638{
    687639  ULONG rc;
    688 
    689   dprintf(("OPENGL32: DiveResizeBuffers to %d/%d\n",width,height));
    690   dprintf(("OPENGL32: DiveResizeBuffers Current size %d/%d\n",Current->awidth,Current->aheight));
    691640
    692641  if(!Current)
     
    706655                                  Current->BackBufferNumber);
    707656
    708       dprintf(("OPENGL32: DiveEndImageBufferAccess rc %d\n",rc));
    709 
    710657      rc=DiveFreeImageBuffer(Current->hDiveInstance,
    711658                             Current->BackBufferNumber);
    712659
    713       dprintf(("OPENGL32: DiveFreeImageBuffer rc %d\n",rc));
    714 
    715660      if(Current->BackBufferOwnAllocation)
    716661        {
    717           dprintf(("OPENGL32: Reallocating OWN BlitBuffer %d/%d\n",
    718                    Current->awidth,Current->aheight));
    719 
    720662          free(Current->pbPixels);
    721663
     
    745687      else
    746688        {
    747           dprintf(("OPENGL32: Reallocating BlitBuffer %d/%d\n",
    748                    Current->awidth,Current->aheight));
    749 
    750689          Current->BackBufferNumber=0;
    751690
     
    770709  DiveBlitSetup(Current,TRUE);
    771710}
     711#endif
Note: See TracChangeset for help on using the changeset viewer.