d3d11.DeviceState

A device state. These objects can be aquired from d3d11.Device.getState(), d3d11.Device.createBlendState() and some other state creator methods. A DeviceState can contain up to four states: depth stencil, blend, rasterizer and sampler state (altough the sampler state is pretty useless).

Methods

class DeviceState
combine(DeviceState other) → DeviceState

Combines the other state with self and returns a new DeviceState. For example if this object has only depth stencil state but the source has blend- and rasterizer-states the returned state has all three states. If both objects have the same state an exception is raised.

blendState = device.createBlendState(...)
depthState = device.createDepthStencilState(...)
rasterState = device.createRasterizerState(...)

#Combine all three states into one.
combinedState = blendState.combine(depthState).combine(rasterState)

Depth stencil state

getStencilRef() → int

Returns the stencil reference value.

hasDepthStencilState() → bool

Returns True if the object has a depth stencil state.

setStencilRef(int ref) → None

Sets the stencil reference value.

Blend state

getBlendFactor() → r, g, b, a

Returns the blend factor as floats.

getSampleMask() → int

Returns the blending sample mask.

hasBlendState() → bool

Returns True if the object has a blend state.

setBlendFactor(rgba) → None

Sets the blend factor (4-tuple of floats, RGBA order).

setSampleMask(int mask) → None

Sets the blending sample mask.

Rasterizer state

hasRasterizerState() → bool

Returns True if the object has a rasterizer state.

Sampler state

hasSamplerState() → bool

Returns True if the object has a sampler state.

Table Of Contents

Get DirectPython 11 at SourceForge.net. Fast, secure and Free Open Source software downloads