Page 1 of 1

0.6.1 bug if using only dx10 to compile samples

Posted: Mon Jul 21, 2008 16:10
by rajkosto

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

Posted: Mon Jul 21, 2008 16:37
by rajkosto
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

Posted: Tue Jul 22, 2008 07:58
by scriptkid
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