use ini window resolution (#410)

* use ini window resolution

* use arguments for directx window size

* default 640x480 not 320x240

* kick off a build

* and revert

* default config 640x480 not 320x240

* add todo

Co-authored-by: briaguya <briaguya@alice>
This commit is contained in:
briaguya 2022-07-05 20:02:47 -04:00 committed by GitHub
commit 1ad2931f80
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 29 additions and 20 deletions

View file

@ -278,7 +278,7 @@ static LRESULT CALLBACK gfx_dxgi_wnd_proc(HWND h_wnd, UINT message, WPARAM w_par
return 0;
}
void gfx_dxgi_init(const char *game_name, bool start_in_fullscreen) {
void gfx_dxgi_init(const char *game_name, bool start_in_fullscreen, uint32_t width, uint32_t height) {
LARGE_INTEGER qpc_init, qpc_freq;
QueryPerformanceCounter(&qpc_init);
QueryPerformanceFrequency(&qpc_freq);
@ -319,7 +319,7 @@ void gfx_dxgi_init(const char *game_name, bool start_in_fullscreen) {
run_as_dpi_aware([&] () {
// We need to be dpi aware when calculating the size
RECT wr = {0, 0, DESIRED_SCREEN_WIDTH, DESIRED_SCREEN_HEIGHT};
RECT wr = {0, 0, width, height};
AdjustWindowRect(&wr, WS_OVERLAPPEDWINDOW, FALSE);
dxgi.h_wnd = CreateWindowW(WINCLASS_NAME, w_title, WS_OVERLAPPEDWINDOW,