The Device class represents the actual physical (or software) device which will be used.
Parameters: |
|
---|
The constructor creates a new device.
Parameters: |
|
---|
Checks support for multisampling, returns the supported quality level.
Parameters: |
|
---|
Creates a new DeviceState with a blend state. Use setState() to set the returned object.
#Creates a default state.
defaultBlendState = device.createBlendState({})
#Create two state that disable and enable alpha blending from the first render target.
disableAlphaBlendState = device.createBlendState({"BlendEnable[0]" : False})
enableAlphaBlendState = device.createBlendState({"BlendEnable[0]" : True})
#Create a depth stencil state.
depthStencilState = device.createDepthStencilState({"StencilEnable" : True,
"BackFace.StencilFailOp" : STENCIL_OP_KEEP})
Creates a new DeviceState with a depth stencil state. See createBlendState().
Creates a new DeviceState with a rasterizer state. See createBlendState().
Creates a new DeviceState with a sampler state. See createBlendState().
Parameters: |
|
---|
Execute a command list from a thread group, used with compute shaders.
Parameters: |
|
---|
Draws vertices.
Draw geometry of an unknown size.
Parameters: |
|
---|
Draws instanced vertices.
Parameters: |
|
---|
Draws indexed vertices.
Parameters: |
|
---|
Draws indexed and instanced vertices.
Flushes all pending operations. There is usually no need to call this.
Note
Internal data, call the release() method of the returned object as soon as possible.
Returns the default depth stencil Texture or None.
Note
Internal data, call the release() method of the returned object as soon as possible.
Returns the default depth stencil View or None.
Note
Internal data, call the release() method of the returned object as soon as possible.
Returns the default render target Texture or None.
Note
Internal data, call the release() method of the returned object as soon as possible.
Returns the default render target View or None.
Returns the feature level of the device. You can use d3d11x.featureLevel() to get more representable value.
Returns all valid display modes (width, height, format) for the device. If format is 0 current backbuffer format is used.
Returns scissor rects as named tuples.
A convenience method which returns swap chain information as a named tuple.
Returns depth stencil state, blend state and rasterizer state as a DeviceState.
Returns viewports as named tuples.
Changes the Device into a fullscreen mode or out of it. Make sure that you are in windowed mode when your application exits (or you release the device). If width and height are both zero and the device is going into a fullscreen mode the main monitor’s resolution will be used.
Parameters: |
|
---|
Binds the given index buffer to the device.
Parameters: |
|
---|
Binds an input layout object to the device.
Parameters: |
|
---|
Set the primitve topology.
Parameters: |
|
---|
Binds given views to the device.
Parameters: |
|
---|
A convenience method which clears and sets the default render target and depth stencil. These are managed by DirectPython. This is functionally similar to:
rt = device.getDefaultRTView() #Render target
rt.clearRenderTarget()
ds = device.getDefaultDSView() #Depth stencil
ds.clearDepthStencil()
device.setRenderTargets([rt], ds)
#Must be released.
ds.release()
rt.release()
Sets scissor rects. A scissor rect in a tuple of 4 int elements: (x, y, width, height).
Parameters: |
|
---|
Applies the state object.
Parameters: |
|
---|
Binds buffers to stream output.
Parameters: |
|
---|
Binds buffers to the device.
Sets viewports. A viewport is a tuple of 6 float elements: (x, y, width, height, minDepth, maxDepth).
Parameters: |
|
---|
Presents the backbuffer to the window.
Resets some device settings, for example when the window size has changed. There is usually no reason to call this method directly unless you are using some third party windowing toolkit (wxWindows etc.).
A convenience method which restores the default depth stencil state.
A convenience method which restores the default blend state.
A convenience method which restores the default rasterizer state.
A convenience method which restores the default sampler state. There is usually no reason to call this.