Commit 4e1426e4 authored by hybrid's avatar hybrid

Remove event handling in device constructor. Seems it was not really the cause...

Remove event handling in device constructor. Seems it was not really the cause for the problems, only the missing size update of the d3d9 driver. To avoid complications, only the least change was left in.
Also improved the userclipplane test to really show errors in case of the original problem.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@4303 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 8443d2d1
...@@ -1035,9 +1035,7 @@ CIrrDeviceWin32::CIrrDeviceWin32(const SIrrlichtCreationParameters& params) ...@@ -1035,9 +1035,7 @@ CIrrDeviceWin32::CIrrDeviceWin32(const SIrrlichtCreationParameters& params)
KEYBOARD_INPUT_HKL = GetKeyboardLayout(0); KEYBOARD_INPUT_HKL = GetKeyboardLayout(0);
KEYBOARD_INPUT_CODEPAGE = LocaleIdToCodepage( LOWORD(KEYBOARD_INPUT_HKL) ); KEYBOARD_INPUT_CODEPAGE = LocaleIdToCodepage( LOWORD(KEYBOARD_INPUT_HKL) );
// now handle events which may be required for proper driver usage // inform driver about the window size etc.
// without this, at least user clip planes under D3D won't work in each situation
handleSystemMessages();
resizeIfNecessary(); resizeIfNecessary();
} }
......
...@@ -12,6 +12,7 @@ static bool withSphere(video::E_DRIVER_TYPE type) ...@@ -12,6 +12,7 @@ static bool withSphere(video::E_DRIVER_TYPE type)
video::IVideoDriver* driver = device->getVideoDriver(); video::IVideoDriver* driver = device->getVideoDriver();
scene::ISceneManager* smgr = device->getSceneManager(); scene::ISceneManager* smgr = device->getSceneManager();
driver->setClipPlane(0, core::plane3df(core::vector3df(0,18,0), core::vector3df(0,-1,0)), true);
smgr->addLightSceneNode(0, core::vector3df(30,30,50)); smgr->addLightSceneNode(0, core::vector3df(30,30,50));
// create first sphere // create first sphere
scene::ISceneNode* sphere = smgr->addMeshSceneNode(smgr->addSphereMesh("sphere", 10, 64, 64)); scene::ISceneNode* sphere = smgr->addMeshSceneNode(smgr->addSphereMesh("sphere", 10, 64, 64));
...@@ -27,20 +28,16 @@ static bool withSphere(video::E_DRIVER_TYPE type) ...@@ -27,20 +28,16 @@ static bool withSphere(video::E_DRIVER_TYPE type)
smgr->addCameraSceneNode(0, core::vector3df(-25,30,20), core::vector3df()); smgr->addCameraSceneNode(0, core::vector3df(-25,30,20), core::vector3df());
driver->setTransform(video::ETS_WORLD, core::IdentityMatrix); driver->setClipPlane(1, core::plane3df(core::vector3df(0,2,0), core::vector3df(0,1,0)), true);
driver->setMaterial(video::IdentityMaterial);
driver->setClipPlane(0, core::plane3df(core::vector3df(0,18,0), core::vector3df(0,-1,0)), true);
driver->setClipPlane(1, core::plane3df(core::vector3df(0,2,0), core::vector3df(0,1,0)));
driver->setClipPlane(2, core::plane3df(core::vector3df(8,0,0), core::vector3df(-1,0,0))); driver->setClipPlane(2, core::plane3df(core::vector3df(8,0,0), core::vector3df(-1,0,0)));
device->run();
// while(device->run()) // while(device->run())
{ {
driver->beginScene(true, true, video::SColor(255,113,113,133)); driver->beginScene(true, true, video::SColor(255,113,113,133));
driver->setClipPlane(3, core::plane3df(core::vector3df(-8,0,0), core::vector3df(1,0,0)), true); driver->setClipPlane(3, core::plane3df(core::vector3df(-8,0,0), core::vector3df(1,0,0)), true);
driver->setClipPlane(4, core::plane3df(core::vector3df(0,0,8), core::vector3df(0,0,-1))); driver->setClipPlane(4, core::plane3df(core::vector3df(0,0,8), core::vector3df(0,0,-1)));
driver->setClipPlane(5, core::plane3df(core::vector3df(0,0,-8), core::vector3df(0,0,1))); driver->setClipPlane(5, core::plane3df(core::vector3df(0,0,-8), core::vector3df(0,0,1)));
driver->enableClipPlane(1, true);
driver->enableClipPlane(2, true); driver->enableClipPlane(2, true);
driver->enableClipPlane(4, true); driver->enableClipPlane(4, true);
driver->enableClipPlane(5, true); driver->enableClipPlane(5, true);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment