OS/2, eCS & ArcaOS - Technical > Programming
ClassiCube porting thread
Jochen Schäfer:
--- Quote from: Dave Yeo on April 20, 2024, 04:35:29 pm ---Code from Mozilla (widget\os2\nswindow.cpp #405), for querying whether the shadow buffer is enabled
--- Code: --- // Don't use DIVE if the Panorama video driver is in use
// unless its shadow buffer is turned off.
HMODULE hmod;
if (!DosQueryModuleHandle("PANOGREX", &hmod)) {
char str[8];
if (PrfQueryProfileString(HINI_USERPROFILE, "PANORAMA", "VBEShadowBuffer",
0, str, sizeof(str)) && !strcmp(str, "0")) {
sUseDive = TRUE;
printf("Video driver is Panorama - shadow-buffer is disabled\n");
}
else
printf("DIVE is disabled - Panorama's shadow-buffer is enabled\n");
return;
}
sUseDive = TRUE;
--- End code ---
--- End quote ---
Thanks.
Jochen Schäfer:
--- Quote from: Flashback on April 21, 2024, 12:15:55 am ---
--- Quote from: Jochen Schäfer on April 20, 2024, 02:52:58 pm ---Yes, I do use the Dive functions, but WM_VRNDISABLED AND WM_VRNENABLED are not much use for me, since Classicube gives me the rectangles it wants to paint to, anyway. Moreover, SDL2 works without using the window messages, so it seems optional.
--- End quote ---
Really? Does it correctly handle the situation when the application window is partly obscured by another desktop window?
--- End quote ---
No need to get snarky. I don’t get anything, so I‘m really not interested in obscured windows in the first place.
Lars:
I don't think that checking for shadow buffer is worth the effort. Todays systems with the video memory addressable as write combined memory are more than fast enough for your purposes. Just always use DiveBlitImage, following the beehive sample. That sample works perfectly well with the shadow buffer enabled.
Lars:
--- Quote from: Jochen Schäfer on April 20, 2024, 02:52:58 pm ---
--- Quote from: Lars on April 20, 2024, 12:39:55 pm ---Look at the OS/2 toolkit, in the "beehive" sample code (in that code you can ignore everything that centers around sprite creation. You can also ignore everything that centers around full screen DIVE unless you really want to do that, that includes loading GAMESVR [deprecated since Warp 4] or PMMERGE Dive Fullscreen Init procedure).
I think you will need to support the WM_VRNDISABLED and WM_VRNENABLED window messages and use DiveAllocImageBuffer,DiveBlitImage,DivFreeImageBuffer. Note that the sample does the blitting from a secondary thread.
--- End quote ---
Yes, I do use the Dive functions, but WM_VRNDISABLED AND WM_VRNENABLED are not much use for me, since Classicube gives me the rectangles it wants to paint to, anyway. Moreover, SDL2 works without using the window messages, so it seems optional.
--- End quote ---
Look at the help for the "DiveSetupBlitter" function. You need to support WM_VRNDISABLED and WM_VRNENABLED in order to notify the Dive Blitter via "DiveSetupBlitter" that changes to the visible regions will start or end to occur.
On a reception of WM_VRNDISABLED you need to disable the blitter, on a reception of WM_VRNENABLED you will need to set up again the blitter with the proper values.
Jochen Schäfer:
I understand that, but Classicube calls the draw buffer function with a rectangle to paint, so I setup the blitter in the draw function. This should work I would think.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version