void CDirect3D::Clear(DWORD dwColor)
{
pDevice->Clear( 0, NULL, D3DCLEAR_TARGET, dwColor, 1.0f, 0); //Points to this line!!!
}
Heres what the relevant part of the main cpp file looks like
void DrawScene()
{
d3dWindow.Clear(D3DCOLOR_XRGB(0, 0, 0));
d3dWindow.BeginScene();
d3dWindow.EndScene();
d3dWindow.Present();
}
int WINAPI WinMain( HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
window.makeWindow(hInstance,"Hardball","Hardball",0,0,800,600);
Direct3DInit();
while(1)
{
if (window.checkMsgs()==-1)
break;
// Quit if the users presses escape
if (GetAsyncKeyState(VK_ESCAPE))
PostQuitMessage(0);
// Update the scene each frame
UpdateScene();
// Draw the scene each frame
DrawScene(); //Crashes after next step over
}
// Release Direct3D
Direct3DRelease();
return 0;
}