Reviews / articles about OS/2 |
Operating systems: ArcaOS, eComStation, IBM OS/2 Warp |
|
|
DATE: 2002-02-04 12:19:52 AUTHOR: Artem Davidenko
DIVE (Direct Interface Video Extensions) ... .......... ... ........... ....... . ..... ....... . ..... API ..... ....... ... ".........." ........... ............. ......, ......... . ......... ....... ...... DIVE ............. ... ...... .......... ..... . ............. . ...... ..... ............., ... ......., 2D ....... .....-.......... ... ......... ........ ....... ........... ......... .......... DIVE ............ ......... .......:
....... .......:
........ .......:
.......... ... .... ............. DIVE: .......... DIVE-........ . ...... ...... . ....... ......... .................. .............. DIVE . .......... DIVE handle: ULONG ulErrorCode; HDIVE *phDiveInst; BOOL fNonScreenInstance; PPVOID ppFrameBuffer; ulErrorCode = DiveOpen(*phDiveInst, fNonScreenInstance, ppFrameBuffer); ....... DiveClose ...... .... ....... .. ......... ...... ........... .... DIVE .......... ........ . .....-....., .. fNonScreenInstance ...... .... ........... . FALSE, ....., .... DIVE ............ ...... ... ......... ....... ..... ... ......... ....... ...... ... ...... .. ..... fNonScreenInstance = TRUE. ..... DIVE ... ............ ....... 2D .......... ... ........ ...... ......, .. ...... .... ......... ... ...... DiveAllocImageBuffer. ......... ........ .......... ... ... .......: ULONG ulBufNum; FOURCC fccColorSpace; ULONG ulWidth, ulHeight, ulLineSizeBytes; PBYTE pbImageBuffer; ulErrorCode = DiveAllocImageBuffer ( hDive, /* DIVE ..... */ &ulBufNum, /* ..... ...... */ fccColorSpace, /* ...... */ ulWidth, ulHeight, /* ............ ...... ........... */ ulLineSizeBytes, &pbImageBuffer ); ..... .... ... ..... ........., ..... ....... . .... .......... ....... ....... DiveBeginImageBufferAccess ..., ... ... ........ . ......... .......: PBYTE pbImageBuffer; ULONG ulBufferScanLineBytes, ulBufferScanLines; ulErrorCode = DiveBeginImageBufferAccess ( hDiveInst, /* DIVE ..... */ ulBufferNumber, /* ..... ...... */ &pbImageBuffer, /* ......... .. ..... */ &ulBufferScanLineBytes, /* ...... ..... . ...... */ &ulBufferScanLines /* ..... ..... */ ); DIVE ......... .......... .... .. .... ..... ...... . .......... ........ . ulBufferScanLineBytes. ..... .......... ..... ......... ...... ...... . pbImageBuffer. ..... .... ... ...... .... ........, .......... ...... ....... DiveEndImageBufferAccess. .......... ...... ............. DIVE . ......... .......... ....... .. ..... ... ............. . ... ...... ..... ........ ... ............. .......... . ... .......... ......... WM_REALIZEPALETTE ...... .......... ......... ..................: BYTE pbPal 1024; /* ...... ....... .......... ....... . Presentation Manager */ GpiQueryRealColors(hps, 0, 0, 256, (PLONG)pbPal); /* ......... .. ... ....... ....... . DIVE */ DiveSetDestinationPalette(hDive, (PBYTE)pbPal); .... .......... .... .......... ....... (........, ... ...... ........... ........... .. .....), ... ...... .... ........ DIVE ........... DiveSetSourcePalette. .... .............. ..... ..... ........... . ..... ......., .. ..... ....... ......... ...... ..... ....... ....... ............ DIVE ............ ................ .......... ...... . ..... Presentation Manager. ... .......... ...... ......... . PM ........., DIVE .......... ...... ........ DIVE .. .......... ........ ....... .... .........., ...-.. .......... ..... ....... .............. ...... DIVE .......... .. ..... ............. ...... ............. ........... ........ ....... ......... .......: WinSetVisibleRegionNotify(hwnd, TRUE); ...... ........ .... ..... .... ... ............ ........... ........, ...... - ........ ........... ... ..... ..... .. ......... ...... .........., ...... .......... .......: WinSetVisibleRegionNotify(hwnd, FALSE); ... .......... ............ ... ......... ........ ....... ...., ........, ..... ... .... .......... ... ... ....... ... ...... ... ...... .... ... ...... ......... ... ... ........... ... ......... ......., .... ........ ......... WM_VRNDISABLED. . ..... .. ... ......... DIVE .......... ...... ....... DiveSetupBlitter(hDiveInst, 0); ..... .... ... ........... ........, .... ........ ......... WM_VRNENABLED. ......... ..... ...... ......... ...... ...... ........ ......., ........... ....... WinQueryVisibleRegion: hps = WinGetPS(hwnd); hrgn = GpiCreateRegion(hps, 0, NULL); WinQueryVisibleRegion(hwnd, hrgn); ....... DiveSetupBlitter ...... .......... ...... ... ... .......... ........ ......., ....... ....., ........ ......... . ........ ............ ... ...... ......... ........ ...: RECTL rctls; RGNRECT rgnCtl; SETUP_BLITTER SetupBlitter; POINTL pointl; SWP swp; HPS hps; HRGN hrgn; rgnCtl.ircStart = 0; rgnCtl.crc = 50; rgnCtl.ulDirection = RECTDIR_LFRT_TOPBOT; /* ......... ........ ....... */ GpiQueryRegionRects(hps, hrgn, NULL, &rgnCtl, rctls); /* ......... ....... ........ .... ............ .............. */ WinQueryWindowPos( hwnd, &swp ); /* ....... ....... .... .. ....... */ pointl.x = swp.x; pointl.y = swp.y; WinMapWindowPoints(WinQueryWindow(hwnd, QW_PARENT), HWND_DESKTOP, &pointl, 1); /* ........ .......... . ..... .......... . DIVE */ SIZEL sizlSrcImg; /* ...... ......... ........... */ FOURCC fccSrcColors /* ...... */ SetupBlitter.ulStructLen = sizeof (SETUP_BLITTER); SetupBlitter.fInvert = 0; SetupBlitter.fccSrcColorFormat = fccSrcColors; SetupBlitter.ulSrcLineSizeBytes = ulScanLineBytes; SetupBlitter.ulSrcWidth = sizlSrcImg.cx; SetupBlitter.ulSrcHeight = sizlSrcImg.cy; SetupBlitter.ulSrcPosX = 0; SetupBlitter.ulSrcPosY = 0; SetupBlitter.fccDstColorFormat = FOURCC_SCRN; SetupBlitter.ulDstLineSizeBytes = 0; SetupBlitter.ulDstWidth = swp.cx; SetupBlitter.ulDstHeight = swp.cy; SetupBlitter.ulDstPosX = 0; SetupBlitter.ulDstPosY = 0; SetupBlitter.lScreenPosX = pointl.x; SetupBlitter.lScreenPosY = pointl.y; SetupBlitter.ulNumDstRects = rgnCtl.crcReturned; SetupBlitter.pVisDstRects = rctls; DiveSetupBlitter (hDive, &SetupBlitter); ...... ..... ......... ........... ........... ........... fccSrcColors. . ........... .... ......., DIVE ....... ............... ... ...... . ........... .. ... .. ............ ....... ............. ......... .. ..... ........... ...-.. ... ......... ....... ..... ... ......... ....... . ....... . ...... ...... ....... ...... ..... ...... .... .......... . fccDstColorFormat. ulDstWidth . ulDstHeight ...... ......... ..... ...... ..........., ulNumDstRects ...... .... ..... 1 . pVisDstRects ...... ......... .. ....... . xLeft = yBottom = 0, xRight = ulDstWidth . yTop = ulDstHeight. ... ........... ....., *ppFrameBuffer ............ DiveOpen ...... ... ...... ......... . .....-....... .... ..... ....... ............, ... .......... ..... .... .............. ............., ......... ..... . ............ ....... ....... ........... ... ....... .......:
....... DiveQueryCaps ............ ... ......... .......... . .......... ..... .......... . banked ....... DiveCalcFrameBufferAddress ........ ........ ..... ....... PRECTL prectlDest; /* .......... . ........ */ PVOID pDestinationAddress; /* ..... ...... */ PULONG pulBankNumber; /* ..... ..... */ PULONG pulRemlinesInBank; /* ....., .......... . ..... */ ulErrorCode = DiveCalcFrameBufferAddress ( hDiveInst, &prectlDest, &pDestinationAddress, &pulBankNumber, &pulRemlinesInBank ); ... .......... ........... ............. prectlDest ...... .......... ...... ....... ....... .... ........... .... ....... ..... ..... ....... ............ ......, .. .......... .. ...... ........ ...... ... pulRemlinesInBank ..... ... ....... ...... ...... ......... . pDestinationAddress ...... .... .... .. ....... ... . .....-.....(... DiveQueryCaps) (... .......... .. . ..... .... ..... ............ ... ... .. DIVE). .... . ...., .... ....... ..... ........ .........., .. ...... ...... ............... .......... ........ ... ...... . ..... ...... .......... . DiveAcquireFrameBuffer . ............. DiveDeacquireFrameBuffer. ..... .... .......... .. ...... ........ ....... . .....-...... ..... ........... WM_VRNDISABLED . WM_VRNENABLED. ......... ........ ............ ...... ..... .....-..... ... ......... .. ...... .... fFBAccessOK ......... ..... .......... ........ ......... WM_VRNDISABLED . ............... ... ......... WM_VRNENABLED. BOOL fKeepBlitting = TRUE; BOOL fFBAccessOK; RECTL rectlOutput; RECTL rectlDest; ULONG ulMoreLines; LONG lBlitTop; PVOID pDestinationAddress; ULONG ulBankNumber; ULONG ulRemlinesInAperature; BOOL fAcquired = FALSE; while (fKeepBlitting) . /* ... ..... ..... DiveSetupBlitter ... . ...... ... */ /********************************************************/ /* .......... .......... ..... ... ....... ..... ...... */ /* ... ..... ....... ......... . ....... ..... */ /* ............ ...... .... ... ........... .. ..... */ /* ......... */ /********************************************************/ ulMoreLines = rectlDest.yTop - rectlDest.yBottom; memcpy(&rectlDest, &rectlOutput, sizeof(RECTL)); while (ulMoreLines && fFBAccessOK) . ulErrorCode = DiveCalcFrameBufferAddress ( hDive, rectlDest, &pDestinationAddress, &ulBankNumber, &ulRemlinesInAperture ); if (!fAcquired) if (!DiveAcquireFrameBuffer(hDive, ulBankNumber)) fAcquired = TRUE; else break; DiveSwitchBank(hDive, ulBankNumber); . if (ulRemlinesInAperture < ulMoreLines) . rectlDest.yTop -= ulRemlinesInAperture; ulMoreLines -= ulRemlinesInAperture; . else ulMoreLines = 0; . if (fAcquired) DiveDeacquireFrameBuffer(hDive); . /* end: .... .... ..... ... ...... */ . /* end: .... ...... */ .... .......:
..... .. ...... .......... .. ....... ............. DIVE
- ..... ......... aka sNOa aka 2:5036/12.777 P.S. .. .... ... ...... ........ ......... divestuff.zip, ........ . CD06. P.P.S. greetings .... ........ ....... ..... . .. ... . /2 .... ........ .... ... ..... .. #os2russian e-Deniska . e-co .. ............. ....... .. ....... Lelik - WarpVision ...... ..... [zuko] - .. ... ........ .... ...... .. ..... (....... ../...) nickk - . ......... .. ..... mkisofs RElf - .. ......... ........ ..........
Kommentare:
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
(C) OS2.GURU 2001-2021