0.6.1 bug if using only dx10 to compile samples

Forum for general chit-chat or off-topic discussion.

Moderators: CEGUI MVP, CEGUI Team

rajkosto
Just popping in
Just popping in
Posts: 6
Joined: Fri Jan 11, 2008 00:22

0.6.1 bug if using only dx10 to compile samples

Postby rajkosto » Mon Jul 21, 2008 16:10

Code: Select all

#ifdef CEGUI_SAMPLES_USE_DIRECTX_9
                if (id.find("Official Direct3D 9") != id.npos)
                    DeviceReset_Direct3D9(hWnd, renderer);
#endif
#ifdef CEGUI_SAMPLES_USE_DIRECTX_10
                else if (id.find("Official Direct3D 10") != id.npos)
                    DeviceReset_Direct3D10(hWnd, renderer);
#endif
#ifdef CEGUI_SAMPLES_USE_DIRECTX_8
                else if (id.find("Official Direct3D 8.1") != id.npos)
                    DeviceReset_Direct3D81(hWnd, renderer);
#endif


if you only have CEGUI_SAMPLES_USE_DIRECTX_10 defined as i do, you get a error C2181: illegal else without matching if

so remove the elses :D
Last edited by rajkosto on Mon Jul 21, 2008 16:37, edited 1 time in total.

rajkosto
Just popping in
Just popping in
Posts: 6
Joined: Fri Jan 11, 2008 00:22

Postby rajkosto » Mon Jul 21, 2008 16:37

i also propose the following change in

Code: Select all

HWND Win32AppHelper::createApplicationWindow(int width, int height)


modify the createwindow part as so

Code: Select all

      RECT wnd_size = {0,0,width,height};

      AdjustWindowRect(&wnd_size, WS_OVERLAPPEDWINDOW, FALSE);

        // create new window
        window = CreateWindow(APPLICATION_NAME, APPLICATION_NAME, WS_OVERLAPPEDWINDOW,
                              0, 0, wnd_size.right - wnd_size.left, wnd_size.bottom - wnd_size.top,
                       0, 0, GetModuleHandle(0), 0);


this will make a TRUE 800x600 viewport instead of the 756x548 or whatever one it was making before....thus preventing the blur you get in the d3d10 samples and the cropping or whatever in the d3d9 samples

its just a proper way of doing it since before you were fitting a 800x600 viewport into a smaller client area

User avatar
scriptkid
Home away from home
Home away from home
Posts: 1178
Joined: Wed Jan 12, 2005 12:06
Location: The Hague, The Netherlands
Contact:

Postby scriptkid » Tue Jul 22, 2008 07:58

Thanks, good catches! IIRC i already changed the order of the if statements when building the latest SDK. But that builds all renders :)

So we won't forget: http://www.cegui.org.uk/mantis/view.php?id=222
Check out my released snake game using Cegui!


Return to “Offtopic Discussion”

Who is online

Users browsing this forum: No registered users and 8 guests