Why can't I create direct3d objects?

Posted by quakkels on Game Development See other posts from Game Development or by quakkels
Published on 2012-04-15T14:40:38Z Indexed on 2012/04/15 17:50 UTC
Read the original article Hit count: 309

Filed under:
|

I've been programming professionally for years using languages like VBScript, JavaScript, and C#. As a hobby, I'm getting into some c/c++ and games programming with DirectX.

I am running into an issue where I cannot create direct3d objects. I am using Visual C++ 2010 Express. After I installed vc++2010express I then installed the June 2010 release of DirectX.

I am trying to include DirectX via #pragma statements. This is the code I have so far in my winmain.cpp source file:

#include <Windows.h>
#include <d3d11.h>
#include <time.h>
#include <iostream>
using namespace std;

#pragma comment(lib, "d3d11.lib")
#pragma comment(lib, "d3dx11.lib")

// program settings
const string AppTitle = "Direct3D in a Window";
const int ScreenWidth = 1024;
const int ScreenHeight = 768;

// direct3d objects
LPDIRECT3D11 d3d = NULL; // this line is showing an error

The type LPDIRECT3D11 is showing an error:

Error: Identifier "LPDIRECT3D11" is undefined

Am I missing something here to get VC++2010Express to recognize and load the DirectX libs?

Thanks for any help.

© Game Development or respective owner

Related posts about c++

Related posts about directx