kirides / GD3D11

D3D11-Renderer for Gothic and Gothic 2
GNU General Public License v3.0
200 stars 18 forks source link

It is required to remove the front buffer limit of 256x256 pixels. #125

Open Jr13San opened 1 year ago

Jr13San commented 1 year ago

Describe the bug Using the Union API, I can't get a screenshot larger than 256x256 pixels, using front buffer copy.

To Reproduce

  1. Create a plugin with the following code:
// Plugin.cpp
void Game_Loop()
{
    // when pressing the "0" key
    if (zinput->KeyToggled(KEY_0))
    {
        // create new texture convert manager
        zCTextureConvert* texconv = zrenderer->CreateTextureConvert();

        // get buffer from screen
        zrenderer->Vid_GetFrontBufferCopy(*texconv);

        // get source format
        zCTextureInfo texInfo = texconv->GetTextureInfo();

        // Test on screen resolution 1920x1080 (windowed mode).
        // With DX11 Return: 256x256, format = 2.
        // Without DX11 Return: 1920x1080, format = 3.
        Say::Box(string::Combine("%ix%i, format = %i", texInfo.sizeX, texInfo.sizeY, texInfo.texFormat));

        // remove manager
        delete texconv;
    }
}
  1. Launch the Game in resolution 1920 x 1080 x 32bit
  2. Press key 0.
  3. See message box with results.

Screenshots Original ZenGin Test: ZENGIN_DEFAULT_GAME

ZenGin+DX11 Test: DX11_TEST_GAME

As a result, the buffer contains an image of too low quality, which, when stretched to full screen, looks like this: DX11_TEST2

Test front buffer texture image (without DX11): DX11_TEST3

Expected behavior I expected that the buffer of the convert-manager would receive an image with the same size as the screen resolution. Expected: 1920x1080, format = 3. Received: 256x256, format = 2.

Information:

Other: You may need to look at the functions:

void D3D11GraphicsEngine::GetBackbufferData( byte** data, int& pixelsize )
HRESULT MyDirectDrawSurface7::Lock( LPRECT lpDestRect, LPDDSURFACEDESC2 lpDDSurfaceDesc, DWORD dwFlags, HANDLE hEvent )