• FEATURED

View more

View more

View more

### Image of the Day Submit

IOTD | Top Screenshots

### The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

# Directx11 return code definition

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

6 replies to this topic

### #1senpegasus  Members

Posted 25 April 2013 - 04:03 AM

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?

### #2NightCreature83  Members

Posted 25 April 2013 - 08:32 AM

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

### #3senpegasus  Members

Posted 26 April 2013 - 03:26 AM

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>


### #4Norman Barrows  Members

Posted 26 April 2013 - 02:05 PM

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.

Edited by Norman Barrows, 26 April 2013 - 02:13 PM.

Norm Barrows

Rockland Software Productions

"Building PC games since 1989"

rocklandsoftware.net

PLAY CAVEMAN NOW!

http://rocklandsoftware.net/beta.php

### #5senpegasus  Members

Posted 27 April 2013 - 06:33 AM

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)


### #6Norman Barrows  Members

Posted 27 April 2013 - 02:48 PM

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

### #7senpegasus  Members

Posted 28 April 2013 - 01:46 AM

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.

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.