<commit_before>#include <windows.h>
#include <d3d9.h>

#include "d3d9overlay.h"
#include "d3d9font.h"
#include "d3d9hook.h"
#include <OvRender.h>


Dx9Font* Dx9OvFont;
extern Dx9Overlay* D3D9Overlay;
IDirect3DDevice9* Dx9OvDevice;
OV_WINDOW_MODE D3D9Hook_WindowMode;


VOID UpdatePresentationParameters( D3DPRESENT_PARAMETERS* PresentationParameters )
{
    // Force vsync?
    
    if (D3D9Overlay->VsyncOverrideMode == VSYNC_FORCE_ON)
    {
        PresentationParameters->PresentationInterval = D3DPRESENT_INTERVAL_ONE;
    }
    else if (D3D9Overlay->VsyncOverrideMode == VSYNC_FORCE_OFF)
    {
        PresentationParameters->PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
    }

    if (D3D9Hook_WindowMode == WINDOW_WINDOWED)
    {
        RECT r;

        PresentationParameters->Windowed = TRUE;
        PresentationParameters->Flags = 0;
        PresentationParameters->FullScreen_RefreshRateInHz = 0;

        SetWindowLong(
            PresentationParameters->hDeviceWindow, 
            GWL_STYLE, 
            WS_POPUP | WS_CAPTION | WS_MINIMIZEBOX | WS_SYSMENU | WS_VISIBLE
            );

        GetClientRect(PresentationParameters->hDeviceWindow, &r);

        SetWindowPos(
            PresentationParameters->hDeviceWindow, 
            HWND_NOTOPMOST, 
            0, 
            0,
            PresentationParameters->BackBufferWidth + (PresentationParameters->BackBufferWidth - r.right),
            PresentationParameters->BackBufferHeight + (PresentationParameters->BackBufferHeight - r.bottom),
            SWP_FRAMECHANGED | SWP_SHOWWINDOW | SWP_NOMOVE
            );
    }
    else if (D3D9Hook_WindowMode == WINDOW_FULLSCREEN)
    {
        PresentationParameters->Windowed = FALSE;
    }
}


VOID Dx9Overlay_CreateDevice( D3DPRESENT_PARAMETERS* PresentationParameters )
{
    UpdatePresentationParameters(PresentationParameters);
}<commit_msg>export frame buffer width and height<commit_after>#include <windows.h>
#include <d3d9.h>

#include "d3d9overlay.h"
#include "d3d9font.h"
#include "d3d9hook.h"
#include <OvRender.h>


Dx9Font* Dx9OvFont;
extern Dx9Overlay* D3D9Overlay;
IDirect3DDevice9* Dx9OvDevice;
OV_WINDOW_MODE D3D9Hook_WindowMode;
UINT32 BackBufferWidth;
UINT32 BackBufferHeight;


VOID UpdatePresentationParameters( D3DPRESENT_PARAMETERS* PresentationParameters )
{
    // Force vsync?
    
    if (D3D9Overlay->VsyncOverrideMode == VSYNC_FORCE_ON)
    {
        PresentationParameters->PresentationInterval = D3DPRESENT_INTERVAL_ONE;
    }
    else if (D3D9Overlay->VsyncOverrideMode == VSYNC_FORCE_OFF)
    {
        PresentationParameters->PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
    }

    if (D3D9Hook_WindowMode == WINDOW_WINDOWED)
    {
        RECT r;

        PresentationParameters->Windowed = TRUE;
        PresentationParameters->Flags = 0;
        PresentationParameters->FullScreen_RefreshRateInHz = 0;

        SetWindowLong(
            PresentationParameters->hDeviceWindow, 
            GWL_STYLE, 
            WS_POPUP | WS_CAPTION | WS_MINIMIZEBOX | WS_SYSMENU | WS_VISIBLE
            );

        GetClientRect(PresentationParameters->hDeviceWindow, &r);

        SetWindowPos(
            PresentationParameters->hDeviceWindow, 
            HWND_NOTOPMOST, 
            0, 
            0,
            PresentationParameters->BackBufferWidth + (PresentationParameters->BackBufferWidth - r.right),
            PresentationParameters->BackBufferHeight + (PresentationParameters->BackBufferHeight - r.bottom),
            SWP_FRAMECHANGED | SWP_SHOWWINDOW | SWP_NOMOVE
            );
    }
    else if (D3D9Hook_WindowMode == WINDOW_FULLSCREEN)
    {
        PresentationParameters->Windowed = FALSE;
    }

    BackBufferHeight = PresentationParameters->BackBufferHeight;
    BackBufferWidth = PresentationParameters->BackBufferWidth;
}


VOID Dx9Overlay_CreateDevice( D3DPRESENT_PARAMETERS* PresentationParameters )
{
    UpdatePresentationParameters(PresentationParameters);
}
{'fraction_non_alphanumeric': 0.07919293820933165, 'fraction_numerical': 0.01866330390920555, 'mean_word_length': 3.2875675675675677, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 41, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2332403', 'n_tokens_mistral': 1309, 'n_tokens_neox': 1266, 'n_words': 181}