IDirect3DDevice9 interface (d3d9helper.h)

Applications use the methods of the IDirect3DDevice9 interface to perform DrawPrimitive-based rendering, create resources, work with system-level variables, adjust gamma ramp levels, work with palettes, and create shaders.


The IDirect3DDevice9 interface inherits from the IUnknown interface. IDirect3DDevice9 also has these types of members:


The IDirect3DDevice9 interface has these methods.

Method Description
IDirect3DDevice9::BeginScene Begins a scene.
IDirect3DDevice9::BeginStateBlock Signals Direct3D to begin recording a device-state block.
IDirect3DDevice9::Clear Clears one or more surfaces such as a render target, multiple render targets, a stencil buffer, and a depth buffer.
IDirect3DDevice9::ColorFill Allows an application to fill a rectangular area of a D3DPOOL_DEFAULT surface with a specified color.
IDirect3DDevice9::CreateAdditionalSwapChain Creates an additional swap chain for rendering multiple views.
IDirect3DDevice9::CreateCubeTexture Creates a cube texture resource.
IDirect3DDevice9::CreateDepthStencilSurface Creates a depth-stencil resource.
IDirect3DDevice9::CreateIndexBuffer Creates an index buffer.
IDirect3DDevice9::CreateOffscreenPlainSurface Create an off-screen surface.
IDirect3DDevice9::CreatePixelShader Creates a pixel shader.
IDirect3DDevice9::CreateQuery Creates a status query.
IDirect3DDevice9::CreateRenderTarget Creates a render-target surface.
IDirect3DDevice9::CreateStateBlock Creates a new state block that contains the values for all device states, vertex-related states, or pixel-related states.
IDirect3DDevice9::CreateTexture Creates a texture resource.
IDirect3DDevice9::CreateVertexBuffer Creates a vertex buffer.
IDirect3DDevice9::CreateVertexDeclaration Create a vertex shader declaration from the device and the vertex elements.
IDirect3DDevice9::CreateVertexShader Creates a vertex shader.
IDirect3DDevice9::CreateVolumeTexture Creates a volume texture resource.
IDirect3DDevice9::DeletePatch Frees a cached high-order patch.
IDirect3DDevice9::DrawIndexedPrimitive Based on indexing, renders the specified geometric primitive into an array of vertices.
IDirect3DDevice9::DrawIndexedPrimitiveUP Renders the specified geometric primitive with data specified by a user memory pointer.
IDirect3DDevice9::DrawPrimitive Renders a sequence of nonindexed, geometric primitives of the specified type from the current set of data input streams.
IDirect3DDevice9::DrawPrimitiveUP Renders data specified by a user memory pointer as a sequence of geometric primitives of the specified type.
IDirect3DDevice9::DrawRectPatch Draws a rectangular patch using the currently set streams.
IDirect3DDevice9::DrawTriPatch Draws a triangular patch using the currently set streams.
IDirect3DDevice9::EndScene Ends a scene that was begun by calling IDirect3DDevice9::BeginScene.
IDirect3DDevice9::EndStateBlock Signals Direct3D to stop recording a device-state block and retrieve a pointer to the state block interface.
IDirect3DDevice9::EvictManagedResources Evicts all managed resources, including both Direct3D and driver-managed resources.
IDirect3DDevice9::GetAvailableTextureMem Returns an estimate of the amount of available texture memory.
IDirect3DDevice9::GetBackBuffer Retrieves a back buffer from the device's swap chain.
IDirect3DDevice9::GetClipPlane Retrieves the coefficients of a user-defined clipping plane for the device.
IDirect3DDevice9::GetClipStatus Retrieves the clip status.
IDirect3DDevice9::GetCreationParameters Retrieves the creation parameters of the device.
IDirect3DDevice9::GetCurrentTexturePalette Retrieves the current texture palette.
IDirect3DDevice9::GetDepthStencilSurface Gets the depth-stencil surface owned by the Direct3DDevice object.
IDirect3DDevice9::GetDeviceCaps Retrieves the capabilities of the rendering device.
IDirect3DDevice9::GetDirect3D Returns an interface to the instance of the Direct3D object that created the device.
IDirect3DDevice9::GetDisplayMode Retrieves the display mode's spatial resolution, color resolution, and refresh frequency.
IDirect3DDevice9::GetFrontBufferData Generates a copy of the device's front buffer and places that copy in a system memory buffer provided by the application.
IDirect3DDevice9::GetFVF Gets the fixed vertex function declaration.
IDirect3DDevice9::GetGammaRamp Retrieves the gamma correction ramp for the swap chain.
IDirect3DDevice9::GetIndices Retrieves index data.
IDirect3DDevice9::GetLight Retrieves a set of lighting properties that this device uses.
IDirect3DDevice9::GetLightEnable Retrieves the activity status - enabled or disabled - for a set of lighting parameters within a device.
IDirect3DDevice9::GetMaterial Retrieves the current material properties for the device.
IDirect3DDevice9::GetNPatchMode Gets the N-patch mode segments.
IDirect3DDevice9::GetNumberOfSwapChains Gets the number of implicit swap chains.
IDirect3DDevice9::GetPaletteEntries Retrieves palette entries.
IDirect3DDevice9::GetPixelShader Retrieves the currently set pixel shader.
IDirect3DDevice9::GetPixelShaderConstantB Gets a Boolean shader constant.
IDirect3DDevice9::GetPixelShaderConstantF Gets a floating-point shader constant.
IDirect3DDevice9::GetPixelShaderConstantI Gets an integer shader constant.
IDirect3DDevice9::GetRasterStatus Returns information describing the raster of the monitor on which the swap chain is presented.
IDirect3DDevice9::GetRenderState Retrieves a render-state value for a device.
IDirect3DDevice9::GetRenderTarget Retrieves a render-target surface.
IDirect3DDevice9::GetRenderTargetData Copies the render-target data from device memory to system memory.
IDirect3DDevice9::GetSamplerState Gets the sampler state value.
IDirect3DDevice9::GetScissorRect Gets the scissor rectangle.
IDirect3DDevice9::GetSoftwareVertexProcessing Gets the vertex processing (hardware or software) mode.
IDirect3DDevice9::GetStreamSource Retrieves a vertex buffer bound to the specified data stream.
IDirect3DDevice9::GetStreamSourceFreq Gets the stream source frequency divider value.
IDirect3DDevice9::GetSwapChain Gets a pointer to a swap chain.
IDirect3DDevice9::GetTexture Retrieves a texture assigned to a stage for a device.
IDirect3DDevice9::GetTextureStageState Retrieves a state value for an assigned texture.
IDirect3DDevice9::GetTransform Retrieves a matrix describing a transformation state.
IDirect3DDevice9::GetVertexDeclaration Gets a vertex shader declaration.
IDirect3DDevice9::GetVertexShader Retrieves the currently set vertex shader.
IDirect3DDevice9::GetVertexShaderConstantB Gets a Boolean vertex shader constant.
IDirect3DDevice9::GetVertexShaderConstantF Gets a floating-point vertex shader constant.
IDirect3DDevice9::GetVertexShaderConstantI Gets an integer vertex shader constant.
IDirect3DDevice9::GetViewport Retrieves the viewport parameters currently set for the device.
IDirect3DDevice9::LightEnable Enables or disables a set of lighting parameters within a device.
IDirect3DDevice9::MultiplyTransform Multiplies a device's world, view, or projection matrices by a specified matrix.
IDirect3DDevice9::Present Presents the contents of the next buffer in the sequence of back buffers owned by the device.
IDirect3DDevice9::ProcessVertices Applies the vertex processing defined by the vertex shader to the set of input data streams, generating a single stream of interleaved vertex data to the destination vertex buffer.
IDirect3DDevice9::Reset Resets the type, size, and format of the swap chain.
IDirect3DDevice9::SetClipPlane Sets the coefficients of a user-defined clipping plane for the device.
IDirect3DDevice9::SetClipStatus Sets the clip status.
IDirect3DDevice9::SetCurrentTexturePalette Sets the current texture palette.
IDirect3DDevice9::SetCursorPosition Sets the cursor position and update options.
IDirect3DDevice9::SetCursorProperties Sets properties for the cursor.
IDirect3DDevice9::SetDepthStencilSurface Sets the depth stencil surface.
IDirect3DDevice9::SetDialogBoxMode This method allows the use of GDI dialog boxes in full-screen mode applications.
IDirect3DDevice9::SetFVF Sets the current vertex stream declaration.
IDirect3DDevice9::SetGammaRamp Sets the gamma correction ramp for the implicit swap chain. This method will affect the entire screen (not just the active window if you are running in windowed mode).
IDirect3DDevice9::SetIndices Sets index data.
IDirect3DDevice9::SetLight Assigns a set of lighting properties for this device.
IDirect3DDevice9::SetMaterial Sets the material properties for the device.
IDirect3DDevice9::SetNPatchMode Enable or disable N-patches.
IDirect3DDevice9::SetPaletteEntries Sets palette entries.
IDirect3DDevice9::SetPixelShader Sets the current pixel shader to a previously created pixel shader.
IDirect3DDevice9::SetPixelShaderConstantB Sets a Boolean shader constant.
IDirect3DDevice9::SetPixelShaderConstantF Sets a floating-point shader constant.
IDirect3DDevice9::SetPixelShaderConstantI Sets an integer shader constant.
IDirect3DDevice9::SetRenderState Sets a single device render-state parameter.
IDirect3DDevice9::SetRenderTarget Sets a new color buffer for the device.
IDirect3DDevice9::SetSamplerState Sets the sampler state value.
IDirect3DDevice9::SetScissorRect Sets the scissor rectangle.
IDirect3DDevice9::SetSoftwareVertexProcessing Use this method to switch between software and hardware vertex processing.
IDirect3DDevice9::SetStreamSource Binds a vertex buffer to a device data stream. For more information, see Setting the Stream Source (Direct3D 9).
IDirect3DDevice9::SetStreamSourceFreq Sets the stream source frequency divider value. This may be used to draw several instances of geometry.
IDirect3DDevice9::SetTexture Assigns a texture to a stage for a device.
IDirect3DDevice9::SetTextureStageState Sets the state value for the currently assigned texture.
IDirect3DDevice9::SetTransform Sets a single device transformation-related state.
IDirect3DDevice9::SetVertexDeclaration Sets a Vertex Declaration (Direct3D 9).
IDirect3DDevice9::SetVertexShader Sets the vertex shader.
IDirect3DDevice9::SetVertexShaderConstantB Sets a Boolean vertex shader constant.
IDirect3DDevice9::SetVertexShaderConstantF Sets a floating-point vertex shader constant.
IDirect3DDevice9::SetVertexShaderConstantI Sets an integer vertex shader constant.
IDirect3DDevice9::SetViewport Sets the viewport parameters for the device.
IDirect3DDevice9::ShowCursor Displays or hides the cursor.
IDirect3DDevice9::StretchRect Copy the contents of the source rectangle to the destination rectangle. The source rectangle can be stretched and filtered by the copy. This function is often used to change the aspect ratio of a video stream.
IDirect3DDevice9::TestCooperativeLevel Reports the current cooperative-level status of the Direct3D device for a windowed or full-screen application.
IDirect3DDevice9::UpdateSurface Copies rectangular subsets of pixels from one surface to another.
IDirect3DDevice9::UpdateTexture Updates the dirty portions of a texture.
IDirect3DDevice9::ValidateDevice Reports the device's ability to render the current texture-blending operations and arguments in a single pass.


The IDirect3DDevice9 interface is obtained by calling the IDirect3D9::CreateDevice method.

This interface, like all COM interfaces, inherits the IUnknown interface methods.

The LPDIRECT3DDEVICE9 and PDIRECT3DDEVICE9 types are defined as pointers to the IDirect3DDevice9 interface.

typedef struct IDirect3DDevice9 *LPDIRECT3DDEVICE9, *PDIRECT3DDEVICE9;


Target Platform Windows
Header d3d9helper.h (include D3D9.h)

See also

Direct3D Interfaces