Here is some additional info, but it's still somewhat incomplete.
Here is the esc code to get the framebuffer info.
EXT_FRAMEBUFF_INFO = 0x20000
The name is something different, but I can't find the actual doc/definition for this.
So this is how to get framebuffer ptr using ExtEscape.
- Code:
#define EXT_FRAMEBUFF_INFO 0x20000
struct FrameBuffAddr {
DWORD size;
DWORD addr;
char pad[0x7C];
};
HDC screenDC = ::GetDC(NULL);
FrameBuffAddr addr;
addr.size = sizeof(FrameBuffAddr);
ExtEscape(screenDC, EXT_FRAMEBUFF_INFO, 0, 0, sizeof(FrameBuffAddr), &addr);
DWORD fbPtr = addr.addr;
::ReleaseDC(NULL, screenDC);
Actual code used in GAPI is more complex, i.e. it's necessary to check if EXT_FRAMEBUFF_INFO is actually supported by the driver (and escape code to check the range of accepted codes is another driver code used by GAPI.dll, I believe it's documented in the standard SDK docs, but I don't have the docs handy right now to check this).
Also struct passed to ExtEscape is more complex than that (contains alignment, BPL, orientation etc. info), but I can't find actual definition either :(
Padding is necessary because some drivers seems to ignore size settings and always use fixed size for the struct.
GAPI works like this (more or less):
1. Check if there is GAPI DMA driver. If found use it for transfers.
2. See if video driver supports FRAMEBUFF_INFO code. If it's supported use it to get the info.
3. If none of the above is found, there are some hardcoded addresses for some devices (J580 & Aero).
Step 1 ensures that the same GAPI dll (search for GAPI driver) could be used on the future/non-standard devices.
HTH,
SC