I am using Cegui 6.2, direct 3D/ Direct X 9 renderer.
we are trying to run the game at 1024x768
however, the game actually runs at 1034 x 786 (edit: maybe this is wrong), which ruins our aspect ratio.
update: After testing, changing the input resolution to 1014 x 758 produces the correct 1024x768 resolution when we run the application. I'll test this with different resolutions.
Update 2: Okay it seems like it adds 10 pixels no matter what to the width and the height, this is easy to fix, just subtract 10 pixels when you set the resolution.
this is the relevant code to change the window size
Code: Select all
GAME_WINDOW_X_SIZE = 1024; //global
GAME_WINDOW_Y_SIZE = 768; // global
RECT wnd_size = {0,0,GAME_WINDOW_X_SIZE,GAME_WINDOW_Y_SIZE};
AdjustWindowRect(&wnd_size, WS_OVERLAPPEDWINDOW, FALSE);
// create new window
pimpl->d_window = CreateWindow(APPLICATION_NAME, APPLICATION_NAME,
WS_EX_TOPMOST | WS_CAPTION /*WS_POPUP*/,
0, 0,
wnd_size.right - wnd_size.left,
wnd_size.bottom - wnd_size.top,
0, 0, GetModuleHandle(0), 0);
The problem is simple, the game window is too big! It is something like one percent bigger than the resolution we want. This causes all of our images to be stretched. We tried using native resolutions to fix the blurry text from re-sized images and that's how we discovered this problem.
So am I doing something wrong? I can post more of the renderer code if it is necessary. This seems like a bug/feature inherent to the API for creating windows, so I feel like I may need a workaround like using a modified resolution to compensate. Hopefully there is a better solution.