Changeset 3598 for trunk/src/opengl/mesa/mesadive.c
- Timestamp:
- May 23, 2000, 10:41:28 PM (25 years ago)
- 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:32jeroen Exp $ */1 /* $Id: mesadive.c,v 1.2 2000-05-23 20:40:41 jeroen Exp $ */ 2 2 /*****************************************************************************/ 3 3 /* */ … … 6 6 /*****************************************************************************/ 7 7 8 #ifdef DIVE 8 9 #define INCL_BASE 9 10 #define INCL_WIN 10 11 #define INCL_GPI 11 12 13 12 14 #include <os2wrap.h> 15 #include "..\..\ddraw\divewrap.h" 13 16 #include <memory.h> 14 17 #include <malloc.h> 18 #include <fourcc.h> 15 19 #include <misc.h> 16 #include <dive.h>17 #include <fourcc.h>18 20 19 21 #define mmioFOURCC( ch0, ch1, ch2, ch3 ) \ … … 37 39 extern void WMesaUpdateScreenPos(PWMC c,HWND hWnd); 38 40 extern HWND Win32ToOS2Handle(HWND); 41 extern INT WINAPI MessageBoxA(HWND,LPCSTR,LPCSTR,UINT); 39 42 40 43 extern PWMC Current; … … 95 98 { 96 99 case PF_8A8B8G8R: 97 dprintf(("OPENGL32: FOURCC(PF_8A8B8G8R)\n"));98 100 return FOURCC_BGR4; 99 101 100 102 case PF_8R8G8B: 101 dprintf(("OPENGL32: FOURCC(PF_8R8G8B)\n"));102 103 return FOURCC_RGB3; 103 104 104 105 case PF_5R6G5B: 105 dprintf(("OPENGL32: FOURCC(PF_5R6G5B)\n"));106 106 return FOURCC_R565; 107 107 108 108 case PF_DITHER8: 109 dprintf(("OPENGL32: FOURCC(PF_DITHER8)\n"));110 109 break; 111 110 112 111 case PF_LOOKUP: 113 dprintf(("OPENGL32: FOURCC(PF_LOOKUP)\n"));114 112 return FOURCC_LUT8; 115 113 116 114 case PF_GRAYSCALE: 117 dprintf(("OPENGL32: FOURCC(PF_GRAYSCALE)\n"));118 115 return FOURCC_GREY; 119 116 120 117 case PF_BADFORMAT: 121 dprintf(("OPENGL32: FOURCC(PF_BADFORMAT)\n"));122 118 return FOURCC_RGB3; 123 119 124 120 case PF_INDEX8: 125 dprintf(("OPENGL32: FOURCC(PF_INDEX8)\n"));126 121 return FOURCC_LUT8; 127 122 128 123 default: 129 dprintf(("OPENGL32: FOURCC(???) -> %d\n",pf));130 124 break; 131 125 } … … 136 130 void DiveWriteBackbuffer( PWMC pwc, int iScanLine, int iPixel, BYTE r, BYTE g, BYTE b) 137 131 { 138 /* dprintf(("OPENGL32: Accessing the BackBuffer %08X\n",pwc->pbPixels));*/139 132 PBYTE lpb = pwc->pbPixels; 140 133 PDWORD lpdw; … … 143 136 ULONG nOffset = iPixel % nBypp; 144 137 145 //dprintf(("OPENGL32: wmSetPixel(%d,%d) - lpb= %08X, nBypp=%d\n",iPixel,iScanLine,lpb,nBypp));146 147 138 lpb += pwc->ScanWidth * iScanLine; 148 139 … … 150 141 lpdw = (LPDWORD)lpb; 151 142 lpw = (LPWORD)lpb; 152 153 /* dprintf(("OPENGL32: wmSetPixel - lpb= %08X, lpdw=%08X\n",lpb,lpdw));*/154 143 155 144 if(nBypp == 1) … … 186 175 if(DiveCaps.fBankSwitched) 187 176 { 188 dprintf(("OPENGL32: Bank-switched DIVE access not yet implemented\n"));177 MessageBoxA( NULL, "Bank-Switched DIVE access currently not supported", "", MB_OK ); 189 178 } 190 179 else … … 224 213 ULONG rc; 225 214 226 dprintf(("DiveFlush -- Blitting will now occur\n"));227 228 215 if(!pwc->hDiveInstance) 229 216 { 230 dprintf((" OPENGL32: wmFlush ->> No backbuffer allocated yet!\n"));217 dprintf(("DIVE ERROR : no instance!")); 231 218 return; 232 219 } … … 239 226 /* routine that uses the native output-format... */ 240 227 241 dprintf(("OPENGL32: Dive -->> Software BLIT!\n"));242 243 228 PBYTE lpb = (PBYTE)pwc->ppFrameBuffer; 244 229 PBYTE lpbb = pwc->pbPixels; … … 264 249 pwc->BackBufferNumber); 265 250 266 dprintf(("OPENGL32: DiveEndImageBufferAccess rc %d\n",rc));267 268 251 rc=DiveBlitImage(pwc->hDiveInstance, 269 252 pwc->BackBufferNumber, 270 253 DIVE_BUFFER_SCREEN); 271 272 dprintf(("OPENGL32: DiveBlitImage rc %d\n",rc));273 254 274 255 ULONG bsl; … … 279 260 &pwc->ScanWidth, 280 261 &bsl); 281 282 dprintf(("OPENGL32: Buffered ->> DiveBeginImageBufferAccess rc %d, buffer #%d, pbPixels %08X\n",rc,pwc->BackBufferNumber,pwc->pbPixels));283 262 } 284 263 } … … 290 269 ULONG rc; 291 270 292 dprintf(("OPENGL32: DiveDefineRegion - hwnd %08X",hwnd));293 271 294 272 rgnCtl.ircStart=0; … … 304 282 wc->hps=WinGetPS(hwnd); 305 283 306 dprintf(("OPENGL32: DiveDefineRegion - hps %08X",wc->hps));307 308 284 wc->hrgn=(ULONG)GpiCreateRegion(wc->hps,0,NULL); 309 285 310 dprintf(("OPENGL32: DiveDefineRegion - hrgn %08X",wc->hrgn));311 312 286 rc=WinQueryVisibleRegion(hwnd,wc->hrgn); 313 287 314 dprintf(("OPENGL32: DiveDefineRegion - WinQueryVisibleRegion rc %d",rc));315 316 288 rc=GpiQueryRegionRects(wc->hps,wc->hrgn,NULL,&rgnCtl,(RECTL *)wc->rctls); 317 318 dprintf(("OPENGL32: DiveDefineRegion - GpiQueryRegionRects rc %d",rc));319 289 320 290 wc->NumClipRects=rgnCtl.crcReturned; … … 327 297 SWP swp; 328 298 ULONG rc; 329 330 dprintf(("OPENGL32: Entering DiveBlitSetup - wc %08X, fActivate %d\n",331 wc,fActivate));332 299 333 300 if(!wc) … … 375 342 376 343 rc=DiveSetupBlitter(wc->hDiveInstance,&setup); 377 378 dprintf(("OPENGL32: DiveSetupBlitter rc %d\n",rc));379 344 380 345 if(rc==DIVE_ERR_INVALID_CONVERSION) … … 397 362 PFNWP f=QueryFn(hwnd); 398 363 ULONG rc; 399 400 dprintf(("OPENGL32: DiveWndMsgRecv %d\n",msg));401 364 402 365 switch(msg) … … 440 403 *s=width*4; 441 404 442 dprintf(("OPENGL32: Allocating buffer(%d/%d): %d bytes\n",443 width,height,width*height*4));444 445 405 return (PBYTE)malloc(width*height*4); 446 406 } … … 454 414 ULONG rc; 455 415 RECT rect; 456 457 dprintf(("OPENGL32: DiveInit on context %08X\n",wc));458 416 459 417 /* wc->fullScreen = displayOptions.fullScreen; … … 479 437 &wc->ppFrameBuffer); 480 438 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)); 482 443 483 444 if(rc) … … 510 471 0); 511 472 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)); 513 474 514 475 if(rc==DIVE_ERR_SOURCE_FORMAT) … … 533 494 wc->pbPixels); 534 495 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)); 536 497 } 537 498 else … … 554 515 &bsl); 555 516 556 dprintf(("OPENGL32: Buffered ->> DiveBeginImageBufferAccess rc %d, buffer #%d, pbPixels %08X\n",rc,wc->BackBufferNumber,wc->pbPixels));557 558 517 if(rc) 559 518 { … … 579 538 { 580 539 ULONG rc; 581 582 dprintf(("OPENGL32: DiveFree ctx %08X\n",wc));583 540 584 541 if(wc->hDiveInstance!=0) … … 589 546 wc->BackBufferNumber); 590 547 591 dprintf(("OPENGL32: DiveEndImageBufferAccess rc %d\n",rc));592 593 548 rc=DiveFreeImageBuffer(wc->hDiveInstance, 594 549 wc->BackBufferNumber); 595 550 596 dprintf(("OPENGL32: DiveFreeImageBuffer rc %d\n",rc));597 551 } 598 552 … … 601 555 rc=DiveClose(wc->hDiveInstance); 602 556 603 dprintf(("OPENGL32: DiveClose rc %d\n",rc));604 605 557 wc->hDiveInstance=0; 606 558 } … … 610 562 { 611 563 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 */ 627 580 } 628 581 … … 676 629 677 630 default: 678 dprintf(("OPENGL32: Color encoding %X not matched\n",DiveCaps.fccColorEncoding));679 631 break; 680 632 } … … 686 638 { 687 639 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));691 640 692 641 if(!Current) … … 706 655 Current->BackBufferNumber); 707 656 708 dprintf(("OPENGL32: DiveEndImageBufferAccess rc %d\n",rc));709 710 657 rc=DiveFreeImageBuffer(Current->hDiveInstance, 711 658 Current->BackBufferNumber); 712 659 713 dprintf(("OPENGL32: DiveFreeImageBuffer rc %d\n",rc));714 715 660 if(Current->BackBufferOwnAllocation) 716 661 { 717 dprintf(("OPENGL32: Reallocating OWN BlitBuffer %d/%d\n",718 Current->awidth,Current->aheight));719 720 662 free(Current->pbPixels); 721 663 … … 745 687 else 746 688 { 747 dprintf(("OPENGL32: Reallocating BlitBuffer %d/%d\n",748 Current->awidth,Current->aheight));749 750 689 Current->BackBufferNumber=0; 751 690 … … 770 709 DiveBlitSetup(Current,TRUE); 771 710 } 711 #endif
Note:
See TracChangeset
for help on using the changeset viewer.