Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


What the #%(%"/%/(¤%

This topic is 5561 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I´m soooo depressed.....or maybe not but man this progrblem is giving me headaches. After I pass my IDirect3DDevice9 object to my mesh handling class I get an error every time i try to use it outside the class when setting a new texture. I tried putting everything into one big class and then it worked fine, but that code was kinda hard to maintain. Here´s the code for loading my mesh.
bool CPlayer::LoadTankMesh(IDirect3DDevice9 *p_D3DDev9, char* cTankTexture)


		&p_D3DXMtrlBuffer,NULL, &lNumMtrls, &p_D3DXMesh)))
		MessageBox(NULL, "Failed to load mesh (tank)", "Error", MB_OK);
		return false;

	D3DXMATERIAL *p_D3DXMaterialBufferPtr = (D3DXMATERIAL*)p_D3DXMtrlBuffer->GetBufferPointer();

	p_D3DMaterials = new D3DMATERIAL9[lNumMtrls];
	p_D3DTextures  = new LPDIRECT3DTEXTURE9[lNumMtrls];

	for(unsigned long i = 0; i < lNumMtrls;i++)
		p_D3DMaterials[i] = p_D3DXMaterialBufferPtr[i].MatD3D;
		p_D3DMaterials[i].Ambient = p_D3DMaterials[i].Diffuse;

			MessageBox(NULL, "Failed to load texture subset (tank)", "Error",MB_OK);
			return 0;


	return true;
The error that I get is an unhandled exception in D3D9.DLL (acces violation).
Bad Monkey Productions

Share this post

Link to post
Share on other sites
General notes:

- Please choose meaningful titles for your topics
- Develop with the debug runtime.
- Always check the debug output.
- Check all HRESULTs

Muhammad Haggag

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!