DirectX SDK

Error Codes

Errors, defined by the CONST_D3DIMERR enumeration, are represented by negative values and cannot be combined. This table lists the error codes that can be generated by all Direct3D Immediate Mode methods. See the individual method descriptions for lists of the values each can return.

D3D_OK
No error occurred.
D3DERR_BADMAJORVERSION
The service you requested is unavailable in this major version of DirectX. (A "major version" denotes a primary release, such as DirectX 6.0.)
D3DERR_BADMINORVERSION
The service you requested is available in this major version of DirectX, but not in this minor version. Get the latest version of the component runtime from Microsoft. (A "minor version" denotes a secondary release, such as DirectX 6.1.)
D3DERR_COLORKEYATTACHED
The application attempted to create a texture with a surface that uses a color key for transparency.
D3DERR_CONFLICTINGTEXTUREFILTER
The current texture filters cannot be used together.
D3DERR_CONFLICTINGTEXTUREPALETTE
The current textures cannot be used simultaneously. This generally occurs when a multitexture device requires that all palettized textures simultaneously enabled also share the same palette.
D3DERR_CONFLICTINGRENDERSTATE
The currently set render states cannot be used together.
D3DERR_DEVICEAGGREGATED
The Direct3DDevice7.SetRenderTarget method was called on a device that was retrieved from the render target surface.
D3DERR_INITFAILED
A rendering device could not be created because the new device could not be initialized.
D3DERR_INBEGIN
The requested operation cannot be completed while scene rendering is taking place. Try again after the scene is completed and the Direct3DDevice7.EndScene method (or equivalent method) is called.
D3DERR_INBEGINSTATEBLOCK
The operation cannot be completed while recording states for a state block. Complete recording by calling the Direct3DDevice7.EndStateBlock method and try again.
D3DERR_INOVERLAYSTATEBLOCK
The operation cannot be completed while overlaying a state block. Remove the state block overlay and try again.
D3DERR_INVALID_DEVICE
The requested device type is not valid.
D3DERR_INVALIDCURRENTVIEWPORT
The currently selected viewport is not valid.
D3DERR_INVALIDMATRIX
The requested operation could not be completed because the combination of the currently set world, view, and projection matrices is invalid (the determinant of the combined matrix is zero).
D3DERR_INVALIDPALETTE
The palette associated with a surface is invalid.
D3DERR_INVALIDPRIMITIVETYPE
The primitive type specified by the application is invalid.
D3DERR_INVALIDRAMPTEXTURE
Ramp mode is being used and the texture handle in the current material does not match the current texture handle that is set as a render state.
D3DERR_INVALIDSTATEBLOCK
The state block handle is invalid.
D3DERR_INVALIDVERTEXFORMAT
The combination of flexible vertex format flags specified by the application is not valid.
D3DERR_INVALIDVERTEXTYPE
The vertex type specified by the application is invalid.
D3DERR_LIGHT_SET_FAILED
The attempt to set lighting parameters for a light object failed.
D3DERR_LIGHTHASVIEWPORT
The requested operation failed because the light object is associated with another viewport.
D3DERR_LIGHTNOTINTHISVIEWPORT
The requested operation failed because the light object has not been associated with this viewport.
D3DERR_MATERIAL_CREATE_FAILED
The material could not be created. This typically occurs when no memory is available to allocate for the material.
D3DERR_MATERIAL_DESTROY_FAILED
The memory for the material could not be deallocated.
D3DERR_MATERIAL_GETDATA_FAILED
The material parameters could not be retrieved.
D3DERR_MATERIAL_SETDATA_FAILED
The material parameters could not be set.
D3DERR_MATRIX_CREATE_FAILED
The matrix could not be created. This can occur when no memory is available to allocate for the matrix.
D3DERR_MATRIX_DESTROY_FAILED
The memory for the matrix could not be deallocated.
D3DERR_MATRIX_GETDATA_FAILED
The matrix data could not be retrieved. This can occur when the matrix was not created by the current device.
D3DERR_MATRIX_SETDATA_FAILED
The matrix data could not be set. This can occur when the matrix was not created by the current device.
D3DERR_NOCURRENTVIEWPORT
The viewport parameters could not be retrieved because none have been set.
D3DERR_NOTINBEGIN
The requested rendering operation could not be completed because scene rendering has not begun. Call Direct3DDevice7.BeginScene to begin rendering then try again.
D3DERR_NOTINBEGINSTATEBLOCK
The requested operation could not be completed because it is only valid while recording a state block. Call the Direct3DDevice7.BeginStateBlock method and try again.
D3DERR_NOVIEWPORTS
The requested operation failed because the device currently has no viewports associated with it.
D3DERR_SCENE_BEGIN_FAILED
Scene rendering could not begin.
D3DERR_SCENE_END_FAILED
Scene rendering could not be completed.
D3DERR_SCENE_IN_SCENE
Scene rendering could not begin because a previous scene was not completed by a call to the Direct3DDevice7.EndScene method.
D3DERR_SCENE_NOT_IN_SCENE
Scene rendering could not be completed because a scene was not started by a previous call to the Direct3DDevice7.BeginScene method.
D3DERR_SETVIEWPORTDATA_FAILED
The viewport parameters could not be set.
D3DERR_STENCILBUFFER_NOTPRESENT
The requested stencil buffer operation could not be completed because there is no stencil buffer attached to the render target surface.
D3DERR_SURFACENOTINVIDMEM
The device could not be created because the render target surface is not located in video-memory. (Hardware-accelerated devices require video-memory render target surfaces.)
D3DERR_TEXTURE_BADSIZE
The dimensions of a current texture are invalid. This can occur when an application attempts to use a texture that has non-power-of-two dimensions with a device that requires them.
D3DERR_TEXTURE_CREATE_FAILED
The texture handle for the texture could not be retrieved from the driver.
D3DERR_TEXTURE_DESTROY_FAILED
The device was unable to deallocate the texture memory.
D3DERR_TEXTURE_GETSURF_FAILED
The DirectDraw surface used to create the texture could not be retrieved.
D3DERR_TEXTURE_LOAD_FAILED
The texture could not be loaded.
D3DERR_TEXTURE_LOCK_FAILED
The texture could not be locked.
D3DERR_TEXTURE_LOCKED
The requested operation could not be completed because the texture surface is currently locked.
D3DERR_TEXTURE_NO_SUPPORT
The device does not support texture mapping.
D3DERR_TEXTURE_NOT_LOCKED
The requested operation could not be completed because the texture surface is not locked.
D3DERR_TEXTURE_SWAP_FAILED
The texture handles could not be swapped.
D3DERR_TEXTURE_UNLOCK_FAILED
The texture surface could not be unlocked.
D3DERR_TOOMANYOPERATIONS
The application is requesting more texture filtering operations than the device supports.
D3DERR_TOOMANYPRIMITIVES
The device is unable to render the provided quantity of primitives in a single pass.
D3DERR_UNSUPPORTEDALPHAARG
The device does not support one of the specified texture blending arguments for the alpha channel.
D3DERR_UNSUPPORTEDALPHAOPERATION
The device does not support one of the specified texture blending operations for the alpha channel.
D3DERR_UNSUPPORTEDCOLORARG
The device does not support the one of the specified texture blending arguments for color values.
D3DERR_UNSUPPORTEDCOLOROPERATION
The device does not support the one of the specified texture blending operations for color values.
D3DERR_UNSUPPORTEDFACTORVALUE
The specified texture factor value is not supported by the device.
D3DERR_UNSUPPORTEDTEXTUREFILTER
The specified texture filter is not supported by the device.
D3DERR_VBUF_CREATE_FAILED
The vertex buffer could not be created. This can happen when there is insufficient memory to allocate a vertex buffer.
D3DERR_VERTEXBUFFERLOCKED
The requested operation could not be completed because the vertex buffer is locked.
D3DERR_VERTEXBUFFEROPTIMIZED
The requested operation could not be completed because the vertex buffer is optimized. (The contents of optimized vertex buffers are driver specific, and considered private.)
D3DERR_VERTEXBUFFERUNLOCKFAILED
The vertex buffer could not be unlocked because the vertex buffer memory was overrun. Make sure that your application does not write beyond the size of the vertex buffer.
D3DERR_VIEWPORTDATANOTSET
The requested operation could not be completed because viewport parameters have not yet been set. Set the viewport parameters by calling Direct3DDevice7.SetViewport method and try again.
D3DERR_VIEWPORTHASNODEVICE
The requested operation could not be completed because the viewport has not yet been associated with a device.
D3DERR_WRONGTEXTUREFORMAT
The pixel format of the texture surface is not valid.
D3DERR_ZBUFF_NEEDS_SYSTEMMEMORY
The requested operation could not be completed because the specified device requires system-memory depth-buffer surfaces. (Software rendering devices require system-memory depth buffers.)
D3DERR_ZBUFF_NEEDS_VIDEOMEMORY
The requested operation could not be completed because the specified device requires video-memory depth-buffer surfaces. (Hardware-accelerated devices require video-memory depth buffers.)
D3DERR_ZBUFFER_NOTPRESENT
The requested operation could not be completed because the render target surface does not have an attached depth buffer.