Original Post
I am trying to set up a simple DX8 application, based on the tuts provided by MS in their help files. I was sort of learning DX7, so this isn't all that new to me, but the tutorial doesn't seem to work...here is my code that I'm using:
) it gives me an access violation error (something like 0xC000000005) and plops me in debug mode on that line. I don't get it, is their something I'm doing wrong (duh)? Well, if you can see what it is, I'd appreciate it.
-Sponge99
Edited by - Sponge99 on January 24, 2001 4:16:05 AM
#include windows.h // removed brace things for web
#include d3d8.h
#include d3d8types.h
#include d3d.h
LPDIRECT3D8 d3d8;
D3DDISPLAYMODE d3ddm;
int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
if (Direct3DCreate8(D3D_SDK_VERSION) == NULL)
{
MessageBox(NULL, "Direct3DCreate8 - Failed!", "Error", MB_OK);
return E_FAIL;
}
else
MessageBox(NULL, "Direct3DCreate8 - Passed!", "OK", MB_OK);
if (FAILED(d3d8->GetAdapterDisplayMode(D3DADAPTER_DEFAULT, &d3ddm)))
{
MessageBox(NULL, "GetAdapterDisplayMode - Failed!", "Error", MB_OK);
return E_FAIL;
}
else
MessageBox(NULL, "GetAdapterDisplayMode - Passed!", "OK", MB_OK);
return 0;
}
But when it reaches the second DX function (GetAdapterDisplayMode) on run-time (compiles fine