НОВОЕ: OS/2 GURU - Вопросы и ответы

Reviews / articles about OS/2

Operating systems:
ArcaOS, eComStation, IBM OS/2 Warp
eComStation myths 

Latest  
 
 

Unsorted

 

 

Upgrade ArcaOS to NeoWPS level

  • Install original PNG icons drawed by designer, specialized at OS/2 adornation.
  • Install eSchemes 2018 to change colors and buttons on desktop.

Usage of DIVE for developing graphics applications


TITLE: Usage of DIVE for developing graphics applications

DATE: 2002-02-04 12:19:52

AUTHOR: Artem Davidenko
Please use online translator
go to http://translate.google.com
and request the translation of http://ru.ecomstation./projects/reviews/index.php?id=46
to your language

DIVE (Direct Interface Video Extensions) ... .......... ... ........... ....... . ..... ....... . ..... API ..... ....... ... ".........." ........... ............. ......, ......... . ......... ....... ...... DIVE ............. ... ...... .......... ..... . ............. . ...... ..... ............., ... ......., 2D ....... .....-.......... ... ......... ........ .......

........... ......... .......... DIVE ............ ......... .......:

  • ...... .......... ........ ...........
  • ............. . ............... DIVE
  • ............ ........ .......
  • ........... ..... ......
  • ......... .....-..... ... .....-..... ......... (........... ........)
  • ......... ............. .......
  • ....... ........... ... ....... ......., ....... ....... .......... .......... ...... ....
  • ....... ............ ...... (... banked-.......)

....... .......:

  • CLUT 8 (256 color) - "LUT8"
  • 8-bit grayscale - "GREY"
  • RGB 16 (5-6-5, 5-5-5) - "R565", "R555", "R664"
  • RGB 24 (R-G-B, B-G-R) - "RGB3", "BGR3"
  • RGB 32 (R-G-B, B-G-R) - "RGB4", "BGR4"
  • YUV 9 - DVI/Indeo three-plane color subsampled - "YUV9"
  • YUV 411 - "YUV411"
  • YUV 422 - "YUV422"
  • YUV CCIR601 - three-plane 2x2 color subsampled (MJPEG, MPEG) - "Y2X2"
  • YUV CCIR601 - three-plane 4x4 color subsampled? - "Y4X4"

........ .......:

  • CLUT 8 (256 ......)
  • RGB 16 (5-6-5, 5-5-5, 6-6-4)
  • RGB 24 (R-G-B, B-G-R)
  • RGB 32 (R-G-B-x,? B-G-R-x)
  • Blitter Operation

.......... ... .... ............. 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 ...... ... ...... ......... . .....-....... .... ..... ....... ............, ... .......... ..... .... .............. ............., ......... ..... . ............ ....... ....... ........... ... ....... .......:

  • DiveAcquireFrameBuffer
  • DiveDeacquireFrameBuffer
  • DiveSwitchBank
  • DiveCalcFrameBufferAddress

....... 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 ..... . ....... - book/mmref2.inf
  • ....... ... . ...-.. ....... - samples/mm/dive/ . /samples/mm/fsdive/
  • ..... ........ ...... ....... .......... ........ ...... ......... ................ ... /2 (. . ......... .......).
  • ...-.. ....... ................ RDM2.

..... .. ...... .......... .. ....... ............. DIVE

........... ..... . .. ...... ... dos'a (......... .....-...... dpmi ...... (os/2 . ........ ....... ........:))
... ...... "the Matrix" :)
......., ... . ........ ...........

- ..... ......... 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 - .. ......... ........ ..........

Test the program:

NetDrive - attach ftp-directory to a drive letter (webDAV, .iso, NTFS volume, ..)

Kommentare:

Validator
2002-02-04 16:00:00

...... "........" - ......... ..... ......... :-). . .... . .. .. Warp4+XRRM15+14.082c+SDD b44 - ... ........ ...... ......... ....... .... . .. ....., ...... . ....... .........? |-)

sNOa
2002-02-04 17:33:34

...... ... .. ........., . ........ .....(.......... ... ..... ...... ........... ..... .......... . ......). ... ........ .. ACP2+SDD b43.

......
2002-02-04 17:44:35

2sNOa: . ... .....-...... ..... ....? .... .....-...... ........., .. ..........?

Sergey Posokhov
2002-02-04 18:49:19

Bugs, ........... .....-.. ..........

..... ..... ..... . ........ .....!!!

... ..... .. 5 .. 8 ........ :-)

zuko
2002-02-04 20:05:44

sNOa: ../...

sNOa
2002-02-04 21:28:57

2zuko: .......

2......: .....-.. .... . ... . ........ .......

.. .... .. ........ ... ... :(

Max Droganow
2002-02-05 09:48:34

....- .. ... .......-.. ......... ??? ....... ... .... - .. .... ....-.-.-.-..... (........ .... .... . ....... .. ......... - .... .. .. ... ........ ...... ;-))))) )

Max Droganow
2002-02-05 09:50:31

. ...... - .... ......... ........... ......... (PSSST-4 ZX Speccy)

RElf
2002-02-05 11:16:29

. ....... .. ... . ....... ... . DIVE .........:

Fix for DIVE.DLL to allow hicolor. Look for 0BC0C745F000 and replace the latest 00 with 01. Don't forget to unpack by lxLite before!

SERG
2002-02-05 11:57:07

..... ......... ............

........ .... ... .. .....

.... ......... ............ ......... .... ........ . .... xonex.

Eugene Gorbunoff
2002-02-05 13:13:02

........ .... ... ............ ...-...... .... "...... ........ ..... .........".

Eugene
2002-02-05 14:28:15

.. FAQ .. ...... ".......":

Q: ... ... .. ........ ..... . .... .......?

A: ... ..... . ......... .......... ........ ..... ........ .........

sNOa
2002-02-05 14:58:02

eros2: ......., .....

RElf: .... .., .... ..... ....., .... ..... .......(........... .... .... ............ . ......).

ppl: . ... ...... .. ...... ........ ..... ........

Max Droganow
2002-02-07 12:11:18

... ..... .... ..... ........... .... ....... ......... ... ........ ... . ......... ........... - ..... ............ .... - ........ ...... . .........., .. ......... .. .......

.... ........
2002-02-11 07:19:45

. ...... Matrix .......... ... ...... . ............, .?

..... ........

sNOa
2002-02-12 22:14:04

2 .... ........: . . ...... ........?

RElf
2002-02-13 04:35:31

... . ....., ....... .....

[url]

ErOS2 ...... ......... DIVE ....... . ...., ....... ... ......... IFSIM2. .. ..... ..... .. ... ........ [url]

... ..., ..... . .... .......... .. ..............

ErOs2
2002-02-13 14:35:13

..... .......... ...... ... ........ .... . ...... .............. ...... ....... . ..... ........ . ScreenSaver (by ....... .....) . Blanker. ...... .... .. ........

Deniska
2002-02-13 15:15:15

. .......... exe .. ..... ........? . .. ....... ... .... .. ......., . ... .. IFSIM - ..... ........ ......

ErOs2
2002-02-13 17:19:42

to Deniska: .... ....

.... ........
2002-03-04 07:16:36

to ErOs2 & sNOa: ...., ......, .. ........ "......." . ..............

sNOa
2002-03-04 18:45:52

...., ....... ..:) ....

LightElf
2002-03-16 10:31:02

........ .. ............ .. .... ........:

1. ....... .......... ........... ..... .......... (. .....-.. .......) .. ....... .......... ......... . ...... .............. ....... ........, ....... .......... ....... DiveQueryCaps. .... .......... ......... ..., .. ...... (........ ................ . ..... ...... DIVE) ..... FOURCC_R565. ... ....... . ....... ........... ............ ....... . ...... ..... ......., .............. .............. ... ..... .... ....... ... ..., ... ..... ............. .............

2. ... ....... .......... ..........., ..... .......... .. DiveAllocImageBuffer ....... ............. . ........... .. ..... ........... ............. (........... .. .......... .. ...... . ......, ...... ...... ..... .........), ... ... . .... ..... .... ...... ...... . ... ..... ..... .......

Do you have problems with Network (slow, no connection, ..), Audio (hangs, clicks, ..), USB (attached devices are not visible, slow work, etc)? Start point: Configuring ACPI driver for eComStation 2.0 + Latest updates ACPI Frequently Asked Questions and Answers in 2011

 


 

(C) OS2.GURU 2001-2021