Directx11 return code definition

Started by
5 comments, last by mjnhfgbdsafbxhg 10 years, 12 months ago
I'm using windows 8 with DirectX11 to create a desktop application.
The function D3D11CreateDeviceAndSwapChain has several possible return codes as described here.
Although I can check for many of them, the ones starting with D3DERR_, like D3DERR_INVALIDCALL are not defined.
Googling a bit I found out they should be defined in D3DX11core.h, which is not included in the sdk.
Am I missing something?
Advertisement

If you include d3d11.h that should be enough as that should include all of what you need, you might need to include dxgi.h as well.

Worked on titles: CMR:DiRT2, DiRT 3, DiRT: Showdown, GRID 2, theHunter, theHunter: Primal, Mad Max, Watch Dogs: Legion

I'm including the following, but it still can't find the definition.


#include <dxgi.h>
#include <d3dcommon.h>
#include <d3d11_1.h>
#include <d3dcompiler.h>
just use #include <d3dx11.h> (or 11_1 if there is such a thing)

this may not get you the compiler though. it does gets you a DXGI device context, so it seems to include DXGI.

D3DERR_INVALIDCALL is defined in D3DX11core.h:


#define D3DERR_INVALIDCALL MAKE_D3DHRESULT(2156)

note that this is from the june 2010 sdk version of directx 11, not the win8 sdk version of dx11. there may be an 11.0 vs 11.1 version thing going on between them.

Norm Barrows

Rockland Software Productions

"Building PC games since 1989"

rocklandsoftware.net

PLAY CAVEMAN NOW!

http://rocklandsoftware.net/beta.php

I searched the whole "windows kits\8.0\include" directory but the only definition of D3DERR_INVALIDCALL is inside d3d9helper.h.

Apparently the problem is just that the documentation is not updated about the fact that they dropped the error codes that begin with D3DERR_.

Inside winerror.h I could find all the definitions for dxgi, d3d10 and d3d11 errors, but they are named and defined differently, for example:


//
// DXGI error codes
//

//
// MessageId: DXGI_ERROR_INVALID_CALL
//
// MessageText:
//
// The application made a call that is invalid. Either the parameters of the call or the state of some object was incorrect.
// Enable the D3D debug layer in order to see details via debug messages.
//
#define DXGI_ERROR_INVALID_CALL          _HRESULT_TYPEDEF_(0x887A0001L)

where _HRESULT_TYPEDEF_ is just



#define _HRESULT_TYPEDEF_(_sc) ((HRESULT)_sc)

Apparently the problem is just that the documentation is not updated about the fact that they dropped the error codes that begin with D3DERR_.

i suspected something like this.

was there a specific directx 11.1 routine that said it returned d3derr_invalid call? no, cause you were using create dev & swap chain, just like i was a few days ago myself. so you were just trying to trap and process the documented return codes, eh? too bad their docs suck.

as soon as i saw that create dev and swap chain returned s_ok instead of d3d_ok, i realized dx11 error codes are a whole new ballgame.

they apparently have both the june 2010 and win 8 docs posted on msdn, identical info. apparently true for june 2010 sdk, and not for win8 sdk. you may want to "send a comment to microsoft about this document".

Norm Barrows

Rockland Software Productions

"Building PC games since 1989"

rocklandsoftware.net

PLAY CAVEMAN NOW!

http://rocklandsoftware.net/beta.php

Yes, I was getting some errors so I wanted to catch all the possible return codes.

I sent a mail, hopefully they will update the documentation.

This topic is closed to new replies.

Advertisement