memory can´t be read during execution

Started by
2 comments, last by shakazed 21 years, 9 months ago
I´ve made a class to help me with dgraphics, I´ll dump the code on you here. bool cDGraph::D3DInit(HWND hWnd) //Start initialization of d3d { m_iD3D8 = Direct3DCreate8(D3D_SDK_VERSION); //Create the main interface pointer if(m_iD3D8 == NULL) return false; ZeroMemory(&m_d3ddm, sizeof(m_d3ddm)); m_d3ddm.Width = 640; m_d3ddm.Height = 480; m_d3ddm.RefreshRate = 0; m_d3ddm.Format = D3DFMT_A8R8G8B8; ZeroMemory(&m_d3dpp, sizeof(m_d3dpp)); m_d3dpp.Windowed = false; m_d3dpp.SwapEffect = D3DSWAPEFFECT_FLIP; m_d3dpp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT; m_d3dpp.FullScreen_PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT; m_d3dpp.BackBufferFormat = m_d3ddm.Format; if(FAILED(m_iD3D8->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &m_d3dpp, &m_iD3DDev8))) return false; return true; } Now, i try to create a device and then go fullscreen. It works in windowed mode, but when I try to go full. I get a memory can´t be "read" error. sHaKaZeD

http://www26.brinkster.com/shakazed/
Advertisement
without more info, i can only give general tips, which would be here and here.

---
Come to #directxdev IRC channel on AfterNET
Is that a cut & paste from your code? Why does your backbuffer have an alpha channel?
Have you checked the return code from every D3D funcrion?
What variable (or value) can''t be read? If its something along the lines of "Unable to read memory at 0x00000000", look for NULL pointers.

HTH, Steve

Steve
DirectX Programmer
Soon to be the new Bill Gates
Member of the Unban Mindwipe Society (UMWS)
As Evil Bill said, this is problably due to your back buffer format. When creating fullscreen surface, the front buffer must be X8R8G8B8 even if you intend to use alpha.

I suppose that you get your memory error simply because a Direct3D object wasn''t created.

Good Luck

This topic is closed to new replies.

Advertisement