Originally Posted by
valaris
? You are setting a pointer to NULL and expecting to dereference it? Big mistake hehe. Post the creation code and preferrably snippet where the creation code gets called if it's a seperate function. Remember that if the creation code doesn't get called in the constructor then it should be called BEFORE you call a function that tries and use these pointers.
lol yeah, my bad, I think that I want to get this working so badly that i'm forgetting the basics although I fixed that error! I didn't create the device before I set the capabilities, silly me. But now I get another:
Unhandled exception at 0x0014238a in DXEngine.exe: 0xC0000005: Access violation reading location 0xcccccccc.
in:
DXGraphics.h
Code:
bool DXGraphics::bDisplay() /*Function Definition*/
{
if(m_d3dDevice) /*If the object exists*/
{
m_d3dDevice->Clear(0, /*Number of rectangles in the following array...*/
0, /*An array of screen rectanges to clear*/
D3DCLEAR_TARGET | /*The render target surface, most likely the backbuffer*/
D3DCLEAR_ZBUFFER, /*The depth(z) buffer*/
0x00000000, /*Colour that we wish to clear the render targer to (black)*/
1.0f, /*The value that we wish to set the depth(z) buffer to*/
0); /*The value that we wish to set the stencil buffer to*/ <-Right here :S
/*Function to Present the contents of the next buffer*/
m_d3dDevice->Present(0, /*This must be NULL as we didn't specify the swap chain as "D3DSWAPEFFECT_COPY"
as it is NULL, the whole surface is presented*/
0, /*This must also be NULL for the same reason, as it is NULL, the entire client area is filled*/
0, /*This is the destination window, if NULL, then the handle from D3DPRESENT_PARAMETERS is taken*/
0); /*This must also be NULL as "D3DSWAPEFFECT_COPY" wasn't specified*/
}
return true; /*Return a true value, indicating that the program can continue*/
}