Jump to content
  • Advertisement

Archived

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

shakazed

memory can´t be read during execution

This topic is 5935 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´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/

Share this post


Link to post
Share on other sites
Advertisement
without more info, i can only give general tips, which would be here and here.

---
Come to #directxdev IRC channel on AfterNET

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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

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!