little help trying to render to a typical Win32 window.

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Eagle_Eye
Posts: 16
Joined: Sun Feb 08, 2009 11:04 pm

little help trying to render to a typical Win32 window.

Post by Eagle_Eye »

Hello, i'm trying to render to a pre_made window and for some reason I get an access violation right here:

Code: Select all



bool CIrrlicht::CreateIrrlichtDeviceEx(video::E_DRIVER_TYPE Type /* = E_DRIVER_TYPE::EDT_DIRECT3D9 */,HWND windowHandle,int width, int height)
{
	ZeroMemory(&this->creationParams,sizeof(SIrrlichtCreationParameters));
	
	creationParams.WindowId = reinterpret_cast<void*>(windowHandle);
	creationParams.DriverType = Type;
	//creationParams.WindowSize = core::dimension2d<s32>(width, height);
	-> g_pDevice = createDeviceEx(creationParams);

	if(g_pDevice)
	{
		MessageBoxA(NULL,"Device Created","OK",MB_OK);
		return true;
	}

}
it returns 0x00000 and i did make sure to initialize it correctly, any advice?
I followed the tutorial but added my own classes and for some reason, the device wont create and it gives an access violation.
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Re: little help trying to render to a typical Win32 window.

Post by vitek »

Eagle_Eye wrote:

Code: Select all

	ZeroMemory(&this->creationParams,sizeof(SIrrlichtCreationParameters));
Do NOT do this. The SIrrlichtCreationParameters structure is not a plain old data type (it has a constructor, destructor, and assignment operator). This is unsafe, and I'm willing to bet that if you remove the call the problem will go away.

Travis
Eagle_Eye
Posts: 16
Joined: Sun Feb 08, 2009 11:04 pm

Post by Eagle_Eye »

you sir, are an angel
Post Reply