[fixed] beginScene(false,false) unnecessary errors

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
DavidJE13
Posts: 165
Joined: Tue Jan 09, 2007 7:17 pm

[fixed] beginScene(false,false) unnecessary errors

Post by DavidJE13 »

Using Irrlicht 1.5.1

Just a little bug, but quite annoying because it fills the debug console, drowning other messages;

The Direct3D9 driver has these lines in beginScene;

Code: Select all

	hr = pID3DDevice->Clear( 0, NULL, flags, color.color, 1.0, 0);
	if (FAILED(hr))
		os::Printer::log("DIRECT3D9 clear failed.", ELL_WARNING);
but if it is called with false, false (i.e. clear nothing) hr = 0 anyway, so the error message is shown.

A simple fix;

Code: Select all

	hr = pID3DDevice->Clear( 0, NULL, flags, color.color, 1.0, 0);
	if (FAILED(hr)&&flags)
		os::Printer::log("DIRECT3D9 clear failed.", ELL_WARNING);
or even;

Code: Select all

	if(flags){
		hr = pID3DDevice->Clear( 0, NULL, flags, color.color, 1.0, 0);
		if (FAILED(hr))
			os::Printer::log("DIRECT3D9 clear failed.", ELL_WARNING);
	}
Post Reply