d3d9

package module
v1.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2023 License: MIT Imports: 5 Imported by: 22

README

d3d9

This library is a pure Go wrapper for Microsoft's Direct3D9 API.

Games

Here you can see the library in action, it was used for two 48 hour game jams.

This is my entry to the GopherGala 2016:

Gophette Screenshot

And here is my entry for the Ludum Dare Game Jam 2016:

Reinventing the Wheel Screenshot

Installation

Get and build the library with:

go get -u github.com/gonutz/d3d9

To run a Direct3D9 application you need to have d3d9.dll installed on your system. Luckily, all Windows versions starting with Windows XP have this pre-installed. This means that you will not need to ship any additional DLL with your application when using this library.

Obsolete CGo Version 1

This library does not use CGo anymore. With this change the API has incompatibly changed in some places. If you have a project using the old API and do not want to update everything right now, you can use a copy of version 1.0.0 of this library at github.com/gonutz/cgo/d3d9. All you have to do is go get that library and update your imports from github.com/gonutz/d3d9 to github.com/gonutz/cgo/d3d9.

Usage

All Direct3D9 interfaces are translated to Go types and their methods are translated to functions on the types so the usage is very close to the C++ API.

There are some differences in the names in Go, since the package is named d3d9, all names in that package drop the D3D and 9 parts because they would be redundant. The changes are:

  • Interfaces drop the IDirect3D prefix and the 9 suffix, e.g. IDirect3DDevice9 becomes d3d9.Device. The only exception is IDirect3D9 which in Go becomes Direct3D.
  • Constants and enumerations drop the D3D prefix, otherwise they are the same and keep the upper case convention so users of Direct3D can easily find what they are looking for. For example D3DADAPTER_DEFAULT becomes d3d9.ADAPTER_DEFAULT, D3DFMT_R8G8B8 becomes d3d9.FMT_R8G8B8 etc.
  • Structs, like constants, only drop the D3D prefix, they too keep the upper case naming convention, so D3DRANGE becomes d3d9.RANGE.
  • Error constants also drop the D3D prefix so D3DERR_OUTOFVIDEOMEMORY becomes ERR_OUTOFVIDEOMEMORY. However, the interface functions do not return these constants, they return Go errors instead of HRESULTs.
  • Instead of returning HRESULT, functions return d3d9.Error which implements the standard Go error interface and has an additional function Code() int32 which returns the error code. This code can be checked against the defined error constants. If a function succeeds it returns nil (and not D3D_OK) as the d3d9.Error.

Note that Direct3D9 needs a window handle for setting it up. This means that you need some way to create a native window and get the handle to pass it to d3d9. In the samples you can see how to do it using the SDL2 Go wrapper and Allen Dang's w32. You could also use other Windows wrapper libraries, like the walk library, or just write a little CGo code to set up a window yourself. This library does not provide window creation or event handling functionality, only the Direct3D9 wrapper.

All calls to Direct3D9 must happen from the same thread that creates the Direct3D9 object so make sure to add this code in your main package:

func init() {
    runtime.LockOSThread()
}

There are some additional convenience functions. IndexBuffer and VertexBuffer have Lock functions which return void* pointers in the C API and would thus return uintptrs in Go. You can use these pointers to read and write various types from/to that memory. However, using uintptr or unsafe.Pointer is not idiomatic Go so the Lock functions return a wrapper around the uintptr instead, providing functions of the form GetFloat32s and SetFloat32s which take a slice of []float32 and handle copying the data for you. See the documentation of these functions for further information.

Similarly, when locking a two-dimensional resource, like a texture, you will get a d3d9.LOCKED_RECT. It too has a wrapper function for setting its 2D data. There is however no function to read the data, yet, and no functions for reading and writing sub-rectangles which could be useful. These functions can be added when needed by a real application to see the use case first and implement the functions according to that instead of guessing what might work. If you need such a function, create a pull request or an issue and it can be incorporated in this library.

Documentation

See the GoDoc for the Go API. The functions are only documented very generally, to get more detailed information about the Direct3D9 API see the MSDN documentation.

Examples

The samples folder contains some example programs that show the basics of setting up and using the library.

A real world usage of this library is my entry to the GopherGala 2016. It was first built using SDL2 and after the competition I ported it to DirectX, see main_windows.go for the implementation.

Another real world example is my entry for the Ludum Dare Game Jam 2016 which is Windows only.

The prototype library also uses d3d9 on Windows.

Status

The code started out as a rough version generated from the MSDN online documentation and was then manually refined to work well with Go and its conventions. It wraps the whole Direct3D9 API right now and adds some additional convenience functions for easy Go usage. However, LOCKED_RECT only has one function for setting the whole data rectangle at once, there is no simple way to set only sub-rectangles right now. Similarly the CubeTexture's LOCKED_BOX has no wrapper functions for getting and setting its data, yet. For now the raw uintptr memory pointers can be used along with the pitch values and in the future such functions can be added when needed.

Help improve this library

Only real world use and feedback can improve the usability of this library, so please use it, fork it, send pull requests and create issues to help improve this library.

Documentation

Rendered for windows/amd64

Overview

Package d3d9 provides a wrapper for Microsoft's Direct3D9 API in pure Go. It can only be used on Windows.

When running a Direct3D application you need to have d3d9.dll installed on the system, which fortunately has been deployed with all Windows versions since XP. This means if you have Go installed, you also have the DLL installed. This also means that your application can be deployed without the DirectX DLLs and if you have no other dependencies you can just give the executable file to the users.

To get going with this wrapper there are some basic samples that demonstrate how to set up and use the library at: https://github.com/gonutz/d3d9/tree/master/samples

Index

Constants

View Source
const (
	// ADAPTER_DEFAULT is used to specify the primary display adapter.
	ADAPTER_DEFAULT = 0

	// CAPS_READ_SCANLINE means the display hardware is capable of returning
	// the current scan line.
	CAPS_READ_SCANLINE = 0x20000

	// CAPS2_CANAUTOGENMIPMAP indicates that the driver is capable of
	// automatically generating mipmaps.
	CAPS2_CANAUTOGENMIPMAP = 0x40000000

	// CAPS2_CANCALIBRATEGAMMA indicates that the system has a calibrator
	// installed that can automatically adjust the gamma ramp so that the
	// result is identical on all systems that have a calibrator. To invoke the
	// calibrator when setting new gamma levels, use the SGR_CALIBRATE flag
	// when calling SetGammaRamp. Calibrating gamma ramps incurs some
	// processing overhead and should not be used frequently.
	CAPS2_CANCALIBRATEGAMMA = 0x00100000

	// CAPS2_CANMANAGERESOURCE indicates that the driver is capable of managing
	// resources. On such drivers, POOL_MANAGED resources will be managed by
	// the driver. To have Direct3D override the driver so that Direct3D
	// manages resources, use the CREATE_DISABLE_DRIVER_MANAGEMENT flag when
	// calling CreateDevice.
	CAPS2_CANMANAGERESOURCE = 0x10000000

	// CAPS2_DYNAMICTEXTURES indicates that the driver supports dynamic
	// textures.
	CAPS2_DYNAMICTEXTURES = 0x20000000

	// CAPS2_FULLSCREENGAMMA indicates that the driver supports dynamic gamma
	// ramp adjustment in full-screen mode.
	CAPS2_FULLSCREENGAMMA = 0x00020000

	// CAPS3_ALPHA_FULLSCREEN_FLIP_OR_DISCARD indicates that the device can
	// respect the RS_ALPHABLENDENABLE render state in full-screen mode while
	// using the FLIP or DISCARD swap effect. This only applies when the
	// RS_SRCBLEND or RS_DESTBLEND states are set to one of the following:
	// BLEND_DESTALPHA, BLEND_INVDESTALPHA, BLEND_DESTCOLOR, BLEND_INVDESTCOLOR
	CAPS3_ALPHA_FULLSCREEN_FLIP_OR_DISCARD = 0x00000020

	// CAPS3_COPY_TO_VIDMEM indicates that the device can accelerate a memory
	// copy from system memory to local video memory. This cap guarantees that
	// UpdateSurface and UpdateTexture calls will be hardware accelerated. If
	// this cap is absent, these calls will succeed but will be slower.
	CAPS3_COPY_TO_VIDMEM = 0x00000100

	// CAPS3_COPY_TO_SYSTEMMEM indicates that the device can accelerate a
	// memory copy from local video memory to system memory. This cap
	// guarantees that GetRenderTargetData calls will be hardware accelerated.
	// If this cap is absent, this call will succeed but will be slower.
	CAPS3_COPY_TO_SYSTEMMEM = 0x00000200

	// CAPS3_LINEAR_TO_SRGB_PRESENTATION indicates that the device can perform
	// gamma correction from a windowed back buffer (containing linear content)
	// to an sRGB desktop.
	CAPS3_LINEAR_TO_SRGB_PRESENTATION = 0x00000080

	// CLEAR_STENCIL clears the stencil buffer.
	CLEAR_STENCIL = 0x00000004

	// CLEAR_TARGET clears a render target, or all targets in a multiple render
	// target.
	CLEAR_TARGET = 0x00000001

	// CLEAR_ZBUFFER clears the depth buffer.
	CLEAR_ZBUFFER = 0x00000002

	// CREATE_ADAPTERGROUP_DEVICE asks the device to drive all the heads that
	// this master adapter owns. The flag is illegal on nonmaster adapters. If
	// this flag is set, the presentation parameters passed to CreateDevice
	// should point to an array of PRESENT_PARAMETERS. The number of elements
	// in PRESENT_PARAMETERS should equal the number of adapters defined by the
	// NumberOfAdaptersInGroup member of the CAPS9 structure. The DirectX
	// runtime will assign each element to each head in the numerical order
	// specified by the AdapterOrdinalInGroup member of CAPS9.
	CREATE_ADAPTERGROUP_DEVICE = 0x00000200

	// CREATE_DISABLE_DRIVER_MANAGEMENT instructs Direct3D to manage resources
	// instead of the driver. Direct3D calls will not fail for resource errors
	// such as insufficient video memory.
	CREATE_DISABLE_DRIVER_MANAGEMENT = 0x00000400

	// CREATE_DISABLE_DRIVER_MANAGEMENT_EX instructs Direct3D to manage
	// resources instead of the driver. Unlike
	// CREATE_DISABLE_DRIVER_MANAGEMENT, CREATE_DISABLE_DRIVER_MANAGEMENT_EX
	// will return errors for conditions such as insufficient video memory.
	CREATE_DISABLE_DRIVER_MANAGEMENT_EX = 0x00000400

	// CREATE_DISABLE_PRINTSCREEN causes the runtime not register hotkeys for
	// Printscreen, Ctrl-Printscreen and Alt-Printscreen to capture the desktop
	// or window content.
	// This flag is available in Direct3D 9Ex only.
	CREATE_DISABLE_PRINTSCREEN = 0x00008000

	// CREATE_DISABLE_PSGP_THREADING restricts computation to the main
	// application thread. If the flag is not set, the runtime may perform
	// software vertex processing and other computations in worker thread to
	// improve performance on multi-processor systems. Differences between
	// Windows XP and Windows Vista: This flag is available on Windows Vista,
	// Windows Server 2008, and Windows 7.
	CREATE_DISABLE_PSGP_THREADING = 0x00002000

	// CREATE_ENABLE_PRESENTSTATS enables the gathering of present statistics
	// on the device. Calls to GetPresentStatistics will return valid data.
	// This flag is available in Direct3D 9Ex only.
	CREATE_ENABLE_PRESENTSTATS = 0x00004000

	// CREATE_FPU_PRESERVE sets the precision for Direct3D floating-point
	// calculations to the precision used by the calling thread. If you do not
	// specify this flag, Direct3D defaults to single-precision
	// round-to-nearest mode for two reasons:
	// 1) Double-precision mode will reduce Direct3D performance.
	// 2) Portions of Direct3D assume floating-point unit exceptions are
	// masked; unmasking these exceptions may result in undefined behavior.
	CREATE_FPU_PRESERVE = 0x00000002

	// CREATE_HARDWARE_VERTEXPROCESSING specifies hardware vertex processing.
	CREATE_HARDWARE_VERTEXPROCESSING = 0x00000040

	// CREATE_MIXED_VERTEXPROCESSING specifies mixed (both software and
	// hardware) vertex processing.
	CREATE_MIXED_VERTEXPROCESSING = 0x00000080

	// CREATE_MULTITHREADED indicates that the application requests Direct3D to
	// be multithread safe. This makes a Direct3D thread take ownership of its
	// global critical section more frequently, which can degrade performance.
	// If an application processes window messages in one thread while making
	// Direct3D API calls in another, the application must use this flag when
	// creating the device. This window must also be destroyed before unloading
	// d3d9.dll.
	CREATE_MULTITHREADED = 0x00000004

	// CREATE_NOWINDOWCHANGES indicates that Direct3D must not alter the focus
	// window in any way.
	// Note: If this flag is set, the application must fully support all focus
	// management events, such as ALT+TAB and mouse click events.
	CREATE_NOWINDOWCHANGES = 0x00000800

	// CREATE_PUREDEVICE specifies that Direct3D does not support Get* calls
	// for anything that can be stored in state blocks. It also tells Direct3D
	// not to provide any emulation services for vertex processing. This means
	// that if the device does not support vertex processing, then the
	// application can use only post-transformed vertices.
	CREATE_PUREDEVICE = 0x00000010

	// CREATE_SCREENSAVER allows screensavers during a fullscreen application.
	// Without this flag, Direct3D will disable screensavers for as long as the
	// calling application is fullscreen. If the calling application is already
	// a screensaver, this flag has no effect.
	// This flag is available in Direct3D 9Ex only.
	CREATE_SCREENSAVER = 0x10000000

	// CREATE_SOFTWARE_VERTEXPROCESSING specifies software vertex processing.
	CREATE_SOFTWARE_VERTEXPROCESSING = 0x00000020

	// CS_ALL is a combination of all clip flags.
	CS_ALL = 0xFFF

	// CS_LEFT means all vertices are clipped by the left plane of the viewing
	// frustum.
	CS_LEFT = 0x001

	// CS_RIGHT means all vertices are clipped by the right plane of the
	// viewing frustum.
	CS_RIGHT = 0x002

	// CS_TOP means all vertices are clipped by the top plane of the viewing
	// frustum.
	CS_TOP = 0x004

	// CS_BOTTOM means all vertices are clipped by the bottom plane of the
	// viewing frustum.
	CS_BOTTOM = 0x008

	// CS_FRONT means all vertices are clipped by the front plane of the
	// viewing frustum.
	CS_FRONT = 0x010

	// CS_BACK means all vertices are clipped by the back plane of the viewing
	// frustum.
	CS_BACK = 0x020

	// CS_PLANE0 uses application-defined clipping planes.
	CS_PLANE0 = 0x040

	// CS_PLANE1 uses application-defined clipping planes.
	CS_PLANE1 = 0x080

	// CS_PLANE2 uses application-defined clipping planes.
	CS_PLANE2 = 0x100

	// CS_PLANE3 uses application-defined clipping planes.
	CS_PLANE3 = 0x200

	// CS_PLANE4 uses application-defined clipping planes.
	CS_PLANE4 = 0x400

	// CS_PLANE5 uses application-defined clipping planes.
	CS_PLANE5 = 0x800

	CURSORCAPS_COLOR = 1

	// CURSORCAPS_LOWRES indicates that the driver supports hardware color
	// cursor in low resolution modes (height < 400).
	CURSORCAPS_LOWRES = 2

	// DEVCAPS_CANBLTSYSTONONLOCAL means the device supports blits from
	// system-memory textures to nonlocal video-memory textures.
	DEVCAPS_CANBLTSYSTONONLOCAL = 0x0020000

	// DEVCAPS_CANRENDERAFTERFLIP means the device can queue rendering commands
	// after a page flip. Applications do not change their behavior if this
	// flag is set; this capability means that the device is relatively fast.
	DEVCAPS_CANRENDERAFTERFLIP = 0x0000800

	// DEVCAPS_DRAWPRIMITIVES2 means the device can support at least a DirectX
	// 5-compliant driver.
	DEVCAPS_DRAWPRIMITIVES2 = 0x0002000

	// DEVCAPS_DRAWPRIMITIVES2EX means the device can support at least a
	// DirectX 7-compliant driver.
	DEVCAPS_DRAWPRIMITIVES2EX = 0x0008000

	// DEVCAPS_DRAWPRIMTLVERTEX means the device exports an
	// IDirect3DDevice9::DrawPrimitive-aware hal.
	DEVCAPS_DRAWPRIMTLVERTEX = 0x0000400

	// DEVCAPS_EXECUTESYSTEMMEMORY means the device can use execute buffers
	// from system memory.
	DEVCAPS_EXECUTESYSTEMMEMORY = 0x0000010

	// DEVCAPS_EXECUTEVIDEOMEMORY means the device can use execute buffers from
	// video memory.
	DEVCAPS_EXECUTEVIDEOMEMORY = 0x0000020

	// DEVCAPS_HWRASTERIZATION means the device has hardware acceleration for
	// scene rasterization.
	DEVCAPS_HWRASTERIZATION = 0x0080000

	// DEVCAPS_HWTRANSFORMANDLIGHT means the device can support transformation
	// and lighting in hardware.
	DEVCAPS_HWTRANSFORMANDLIGHT = 0x0010000

	// DEVCAPS_NPATCHES means the device supports N patches.
	DEVCAPS_NPATCHES = 0x1000000

	// DEVCAPS_PUREDEVICE means the device can support rasterization,
	// transform, lighting, and shading in hardware.
	DEVCAPS_PUREDEVICE = 0x0100000

	// DEVCAPS_QUINTICRTPATCHES means the device supports quintic Bézier
	// curves and B-splines.
	DEVCAPS_QUINTICRTPATCHES = 0x0200000

	// DEVCAPS_RTPATCHES means the device supports rectangular and triangular
	// patches.
	DEVCAPS_RTPATCHES = 0x0400000

	// DEVCAPS_RTPATCHHANDLEZERO means the hardware architecture does not
	// require caching of any information, and uncached patches (handle zero)
	// will be drawn as efficiently as cached ones. Note that setting
	// DEVCAPS_RTPATCHHANDLEZERO does not mean that a patch with handle zero
	// can be drawn. A handle-zero patch can always be drawn whether this cap
	// is set or not.
	DEVCAPS_RTPATCHHANDLEZERO = 0x0800000

	// DEVCAPS_SEPARATETEXTUREMEMORIES means the device is texturing from
	// separate memory pools.
	DEVCAPS_SEPARATETEXTUREMEMORIES = 0x0004000

	// DEVCAPS_TEXTURENONLOCALVIDMEM means the device can retrieve textures
	// from non-local video memory.
	DEVCAPS_TEXTURENONLOCALVIDMEM = 0x0001000

	// DEVCAPS_TEXTURESYSTEMMEMORY means the device can retrieve textures from
	// system memory.
	DEVCAPS_TEXTURESYSTEMMEMORY = 0x0000100

	// DEVCAPS_TEXTUREVIDEOMEMORY means the device can retrieve textures from
	// device memory.
	DEVCAPS_TEXTUREVIDEOMEMORY = 0x0000200

	// DEVCAPS_TLVERTEXSYSTEMMEMORY means the device can use buffers from
	// system memory for transformed and lit vertices.
	DEVCAPS_TLVERTEXSYSTEMMEMORY = 0x0000040

	// DEVCAPS_TLVERTEXVIDEOMEMORY means the device can use buffers from video
	// memory for transformed and lit vertices.
	DEVCAPS_TLVERTEXVIDEOMEMORY = 0x0000080

	// DEVCAPS2_ADAPTIVETESSRTPATCH indicates that the device supports adaptive
	// tessellation of RT-patches
	DEVCAPS2_ADAPTIVETESSRTPATCH = 0x00000004

	// DEVCAPS2_ADAPTIVETESSNPATCH indicates that the device supports adaptive
	// tessellation of N-patches.
	DEVCAPS2_ADAPTIVETESSNPATCH = 0x00000008

	// DEVCAPS2_CAN_STRETCHRECT_FROM_TEXTURES indicates that the device
	// supports StretchRect using a texture as the source.
	DEVCAPS2_CAN_STRETCHRECT_FROM_TEXTURES = 0x00000010

	// DEVCAPS2_DMAPNPATCH indicates that the device supports displacement maps
	// for N-patches.
	DEVCAPS2_DMAPNPATCH = 0x00000002

	// DEVCAPS2_PRESAMPLEDDMAPNPATCH indicates that the device supports
	// presampled displacement maps for N-patches.
	DEVCAPS2_PRESAMPLEDDMAPNPATCH = 0x00000020

	// DEVCAPS2_STREAMOFFSET indicates that the device supports stream offsets.
	DEVCAPS2_STREAMOFFSET = 0x00000001

	// DEVCAPS2_VERTEXELEMENTSCANSHARESTREAMOFFSET means that multiple vertex
	// elements can share the same offset in a stream if
	// DEVCAPS2_VERTEXELEMENTSCANSHARESTREAMOFFSET is set by the device and the
	// vertex declaration does not have an element with DECLUSAGE_POSITIONT0.
	DEVCAPS2_VERTEXELEMENTSCANSHARESTREAMOFFSET = 0x00000040

	// DTCAPS_UBYTE4 is a 4D unsigned byte.
	DTCAPS_UBYTE4 = 0x00000001

	// DTCAPS_UBYTE4N is a normalized, 4D unsigned byte. Each of the four bytes
	// is normalized by dividing to 255.0.
	DTCAPS_UBYTE4N = 0x00000002

	// DTCAPS_SHORT2N is a normalized, 2D signed short, expanded to (first
	// byte/32767.0, second byte/32767.0, 0, 1).
	DTCAPS_SHORT2N = 0x00000004

	// DTCAPS_SHORT4N is a normalized, 4D signed short, expanded to (first
	// byte/32767.0, second byte/32767.0, third byte/32767.0, fourth
	// byte/32767.0).
	DTCAPS_SHORT4N = 0x00000008

	// DTCAPS_USHORT2N is a normalized, 2D unsigned short, expanded to (first
	// byte/65535.0, second byte/65535.0, 0, 1).
	DTCAPS_USHORT2N = 0x00000010

	// DTCAPS_USHORT4N is a normalized 4D unsigned short, expanded to (first
	// byte/65535.0, second byte/65535.0, third byte/65535.0, fourth
	// byte/65535.0).
	DTCAPS_USHORT4N = 0x00000020

	// DTCAPS_UDEC3 is a 3D unsigned 10 10 10 format expanded to (value, value,
	// value, 1).
	DTCAPS_UDEC3 = 0x00000040

	// DTCAPS_DEC3N is a 3D signed 10 10 10 format normalized and expanded to
	// (v[0]/511.0, v[1]/511.0, v[2]/511.0, 1).
	DTCAPS_DEC3N = 0x00000080

	// DTCAPS_FLOAT16_2 is a 2D 16-bit floating point numbers.
	DTCAPS_FLOAT16_2 = 0x00000100

	// DTCAPS_FLOAT16_4 is a 4D 16-bit floating point numbers.
	DTCAPS_FLOAT16_4 = 0x00000200

	// OK_NOAUTOGEN is a success code. However, the autogeneration of mipmaps
	// is not supported for this format. This means that resource creation will
	// succeed but the mipmap levels will not be automatically generated.
	OK_NOAUTOGEN = 141953135

	// ERR_CONFLICTINGRENDERSTATE indicates that the currently set render
	// states cannot be used together.
	ERR_CONFLICTINGRENDERSTATE = -2005530591

	// ERR_CONFLICTINGTEXTUREFILTER indicates that the current texture filters
	// cannot be used together.
	ERR_CONFLICTINGTEXTUREFILTER = -2005530594

	// ERR_CONFLICTINGTEXTUREPALETTE indicates that the current textures cannot
	// be used simultaneously.
	ERR_CONFLICTINGTEXTUREPALETTE = -2005530586

	// ERR_DEVICEHUNG indicates that the device that returned this code caused
	// the hardware adapter to be reset by the OS. Most applications should
	// destroy the device and quit. Applications that must continue should
	// destroy all video memory objects (surfaces, textures, state blocks etc)
	// and call Reset() to put the device in a default state. If the
	// application then continues rendering in the same way, the device will
	// return to this state.
	// Applies to Direct3D 9Ex only.
	ERR_DEVICEHUNG = -2005530508

	// ERR_DEVICELOST indicates that the device has been lost but cannot be
	// reset at this time. Therefore, rendering is not possible. A Direct3D
	// device object other than the one that returned this code caused the
	// hardware adapter to be reset by the OS. Delete all video memory objects
	// (surfaces, textures, state blocks) and call Reset() to return the device
	// to a default state. If the application continues rendering without a
	// reset, the rendering calls will succeed.
	ERR_DEVICELOST = -2005530520

	// ERR_DEVICENOTRESET indicates that the device has been lost but can be
	// reset at this time.
	ERR_DEVICENOTRESET = -2005530519

	// ERR_DEVICEREMOVED indicates that he hardware adapter has been removed.
	// Application must destroy the device, do enumeration of adapters and
	// create another Direct3D device. If application continues rendering
	// without calling Reset, the rendering calls will succeed.
	// Applies to Direct3D 9Ex only.
	ERR_DEVICEREMOVED = -2005530512

	// ERR_DRIVERINTERNALERROR Internal driver error. Applications should
	// destroy and recreate the device when receiving this error.
	ERR_DRIVERINTERNALERROR = -2005530585

	// ERR_DRIVERINVALIDCALL is not used.
	ERR_DRIVERINVALIDCALL = -2005530515

	// ERR_INVALIDCALL indicates that the method call is invalid. For example,
	// a method's parameter may not be an invalid pointer.
	ERR_INVALIDCALL = -2005530516

	// ERR_INVALIDDEVICE indicates that the requested device type is not valid.
	ERR_INVALIDDEVICE = -2005530517

	// ERR_MOREDATA indicates that there is more data available than the
	// specified buffer size can hold.
	ERR_MOREDATA = -2005530521

	// ERR_NOTAVAILABLE indicates that this device does not support the queried
	// technique.
	ERR_NOTAVAILABLE = -2005530518

	// ERR_NOTFOUND indicates that the requested item was not found.
	ERR_NOTFOUND = -2005530522

	// _OK indicates that no error occurred.
	OK = S_OK

	// ERR_OUTOFVIDEOMEMORY indicates that Direct3D does not have enough
	// display memory to perform the operation. The device is using more
	// resources in a single scene than can fit simultaneously into video
	// memory. Present, PresentEx, or CheckDeviceState can return this error.
	// Recovery is similar to ERR_DEVICEHUNG, though the application may want
	// to reduce its per-frame memory usage as well to avoid having the error
	// recur.
	ERR_OUTOFVIDEOMEMORY = -2005532292

	// ERR_TOOMANYOPERATIONS indicates that the application is requesting more
	// texture-filtering operations than the device supports.
	ERR_TOOMANYOPERATIONS = -2005530595

	// ERR_UNSUPPORTEDALPHAARG indicates that the device does not support a
	// specified texture-blending argument for the alpha channel.
	ERR_UNSUPPORTEDALPHAARG = -2005530596

	// ERR_UNSUPPORTEDALPHAOPERATION indicates that the device does not support
	// a specified texture-blending operation for the alpha channel.
	ERR_UNSUPPORTEDALPHAOPERATION = -2005530597

	// ERR_UNSUPPORTEDCOLORARG indicates that the device does not support a
	// specified texture-blending argument for color values.
	ERR_UNSUPPORTEDCOLORARG = -2005530598

	// ERR_UNSUPPORTEDCOLOROPERATION indicates that the device does not support
	// a specified texture-blending operation for color values.
	ERR_UNSUPPORTEDCOLOROPERATION = -2005530599

	// ERR_UNSUPPORTEDFACTORVALUE indicates that the device does not support
	// the specified texture factor value. Not used; provided only to support
	// older drivers.
	ERR_UNSUPPORTEDFACTORVALUE = -2005530593

	// ERR_UNSUPPORTEDTEXTUREFILTER indicates that the device does not support
	// the specified texture filter.
	ERR_UNSUPPORTEDTEXTUREFILTER = -2005530590

	// ERR_WASSTILLDRAWING indicates that the previous blit operation that is
	// transferring information to or from this surface is incomplete.
	ERR_WASSTILLDRAWING = -2005532132

	// ERR_WRONGTEXTUREFORMAT indicates that the pixel format of the texture
	// surface is not valid.
	ERR_WRONGTEXTUREFORMAT = -2005530600

	// E_FAIL indicates that an undetermined error occurred inside the Direct3D
	// subsystem.
	E_FAIL = -2147467259

	// E_INVALIDARG indicates that an invalid parameter was passed to the
	// returning function.
	E_INVALIDARG = -2147024809

	// E_NOINTERFACE indicates that no object interface is available.
	E_NOINTERFACE = -2147467262

	// E_NOTIMPL indicates that a method is not implemented.
	E_NOTIMPL = -2147467263

	// E_OUTOFMEMORY indicates that Direct3D could not allocate sufficient
	// memory to complete the call.
	E_OUTOFMEMORY = -2147024882

	// S_NOT_RESIDENT indicates that at least one allocation that comprises the
	// resources is on disk. Direct3D 9Ex only.
	S_NOT_RESIDENT = 141953141

	// S_RESIDENT_IN_SHARED_MEMORY indicates that no allocations that comprise
	// the resources are on disk. However, at least one allocation is not in
	// GPU-accessible memory. Direct3D 9Ex only.
	S_RESIDENT_IN_SHARED_MEMORY = 141953142

	// ERR_UNSUPPORTEDOVERLAY indicates that the device does not support
	// overlay for the specified size or display mode.
	// Direct3D 9Ex under Windows 7 only.
	ERR_UNSUPPORTEDOVERLAY = -2005530501

	// ERR_UNSUPPORTEDOVERLAYFORMAT indicates that the device does not support
	// overlay for the specified surface format.
	// Direct3D 9Ex under Windows 7 only.
	ERR_UNSUPPORTEDOVERLAYFORMAT = -2005530500

	// ERR_CANNOTPROTECTCONTENT indicates that the specified content cannot be
	// protected.
	// Direct3D 9Ex under Windows 7 only.
	ERR_CANNOTPROTECTCONTENT = -2005530499

	// ERR_UNSUPPORTEDCRYPTO indicates that the specified cryptographic
	// algorithm is not supported.
	// Direct3D 9Ex under Windows 7 only.
	ERR_UNSUPPORTEDCRYPTO = -2005530498

	// FVFCAPS_DONOTSTRIPELEMENTS means it is preferable that vertex elements
	// not be stripped. That is, if the vertex format contains elements that
	// are not used with the current render states, there is no need to
	// regenerate the vertices. If this capability flag is not present,
	// stripping extraneous elements from the vertex format provides better
	// performance.
	FVFCAPS_DONOTSTRIPELEMENTS = 0x080000

	// FVFCAPS_PSIZE means the point size is determined by either the render
	// state or the vertex data. If an FVF is used, point size can come from
	// point size data in the vertex declaration. Otherwise, point size is
	// determined by the render state RS_POINTSIZE. If the application provides
	// point size in both (the render state and the vertex declaration), the
	// vertex data overrides the render-state data.
	FVFCAPS_PSIZE = 0x100000

	// FVFCAPS_TEXCOORDCOUNTMASK masks the low WORD of FVFCaps. These bits,
	// cast to the WORD data type, describe the total number of texture
	// coordinate sets that the device can simultaneously use for multiple
	// texture blending. (You can use up to eight texture coordinate sets for
	// any vertex, but the device can blend using only the specified number of
	// texture coordinate sets.)
	FVFCAPS_TEXCOORDCOUNTMASK = 0x00FFFF

	// FVF_DIFFUSE means the vertex format includes a diffuse color component.
	// It is a COLOR in ARGB order.
	FVF_DIFFUSE = 0x0040

	// FVF_NORMAL means the vertex format includes a vertex normal vector. This
	// flag cannot be used with the FVF_XYZRHW flag. The normal consists of
	// three float32s.
	FVF_NORMAL = 0x0010

	// FVF_PSIZE means vertex format specified in point size. This size is
	// expressed in camera space units for vertices that are not transformed
	// and lit, and in device-space units for transformed and lit vertices.
	FVF_PSIZE = 0x0020

	// FVF_SPECULAR means the vertex format includes a specular color component.
	FVF_SPECULAR = 0x0080

	// FVF_XYZ means the vertex format includes the position of an
	// untransformed vertex. This flag cannot be used with the FVF_XYZRHW flag.
	FVF_XYZ = 0x0002

	// FVF_XYZRHW means the vertex format includes the position of a
	// transformed vertex. This flag cannot be used with the FVF_XYZ or
	// FVF_NORMAL flags.
	FVF_XYZRHW = 0x0004

	// FVF_XYZB1 means the vertex format contains position data, and 1
	// weighting (beta) value to use for multimatrix vertex blending
	// operations. Currently, Direct3D can blend with up to three weighting
	// values and four blending matrices.
	FVF_XYZB1 = 0x0006

	// FVF_XYZB2 means the vertex format contains position data, and 2
	// weighting (beta) values to use for multimatrix vertex blending
	// operations. Currently, Direct3D can blend with up to three weighting
	// values and four blending matrices.
	FVF_XYZB2 = 0x0008

	// FVF_XYZB3 means the vertex format contains position data, and 3
	// weighting (beta) values to use for multimatrix vertex blending
	// operations. Currently, Direct3D can blend with up to three weighting
	// values and four blending matrices.
	FVF_XYZB3 = 0x000a

	// FVF_XYZB4 means the vertex format contains position data, and 4
	// weighting (beta) values to use for multimatrix vertex blending
	// operations. Currently, Direct3D can blend with up to three weighting
	// values and four blending matrices.
	FVF_XYZB4 = 0x000c

	// FVF_XYZB5 means the vertex format contains position data, and 5
	// weighting (beta) values to use for multimatrix vertex blending
	// operations. Currently, Direct3D can blend with up to three weighting
	// values and four blending matrices.
	FVF_XYZB5 = 0x000e

	// FVF_XYZW means the vertex format contains transformed and clipped (x, y,
	// z, w) data. ProcessVertices does not invoke the clipper, instead
	// outputting data in clip coordinates. This constant is designed for, and
	// can only be used with, the programmable vertex pipeline.
	FVF_XYZW = 0x4002

	// FVF_TEX0 is the number of texture coordinate sets for this vertex. The
	// actual values for these flags are not sequential.
	FVF_TEX0 = 0x0000

	// FVF_TEX1 is the number of texture coordinate sets for this vertex. The
	// actual values for these flags are not sequential.
	FVF_TEX1 = 0x0100

	// FVF_TEX2 is the number of texture coordinate sets for this vertex. The
	// actual values for these flags are not sequential.
	FVF_TEX2 = 0x0200

	// FVF_TEX3 is the number of texture coordinate sets for this vertex. The
	// actual values for these flags are not sequential.
	FVF_TEX3 = 0x0300

	// FVF_TEX4 is the number of texture coordinate sets for this vertex. The
	// actual values for these flags are not sequential.
	FVF_TEX4 = 0x0400

	// FVF_TEX5 is the number of texture coordinate sets for this vertex. The
	// actual values for these flags are not sequential.
	FVF_TEX5 = 0x0500

	// FVF_TEX6 is the number of texture coordinate sets for this vertex. The
	// actual values for these flags are not sequential.
	FVF_TEX6 = 0x0600

	// FVF_TEX7 is the number of texture coordinate sets for this vertex. The
	// actual values for these flags are not sequential.
	FVF_TEX7 = 0x0700

	// FVF_TEX8 is the number of texture coordinate sets for this vertex. The
	// actual values for these flags are not sequential.
	FVF_TEX8 = 0x0800

	// FVF_TEXTUREFORMAT1 means 1 floating point value.
	FVF_TEXTUREFORMAT1 = 3

	// FVF_TEXTUREFORMAT2 means 2 floating point value.
	FVF_TEXTUREFORMAT2 = 0

	// FVF_TEXTUREFORMAT3 means 3 floating point value.
	FVF_TEXTUREFORMAT3 = 1

	// FVF_TEXTUREFORMAT4 means 4 floating point value.
	FVF_TEXTUREFORMAT4 = 2

	// FVF_POSITION_MASK means the format has a mask for position bits.
	FVF_POSITION_MASK = 0x400E

	// FVF_TEXCOUNT_MASK means the format has a mask value for texture flag
	// bits.
	FVF_TEXCOUNT_MASK = 0x0f00

	// FVF_LASTBETA_D3DCOLOR means the last beta field in the vertex position
	// data will be of type COLOR. The data in the beta fields are used with
	// matrix palette skinning to specify matrix indices.
	FVF_LASTBETA_D3DCOLOR = 0x8000

	// FVF_LASTBETA_UBYTE4 means the last beta field in the vertex position
	// data will be of type UBYTE4. The data in the beta fields are used with
	// matrix palette skinning to specify matrix indices.
	FVF_LASTBETA_UBYTE4 = 0x1000

	// FVF_TEXCOUNT_SHIFT is the number of bits by which to shift an integer
	// value that identifies the number of texture coordinates for a vertex.
	FVF_TEXCOUNT_SHIFT = 8

	// LINECAPS_ALPHACMP means it supports alpha-test comparisons.
	LINECAPS_ALPHACMP = 0x08

	// LINECAPS_ANTIALIAS means antialiased lines are supported.
	LINECAPS_ANTIALIAS = 0x20

	// LINECAPS_BLEND means it supports source-blending.
	LINECAPS_BLEND = 0x04

	// LINECAPS_FOG means it supports fog.
	LINECAPS_FOG = 0x10

	// LINECAPS_TEXTURE means it supports texture-mapping.
	LINECAPS_TEXTURE = 0x01

	// LINECAPS_ZTEST means it supports z-buffer comparisons.
	LINECAPS_ZTEST = 0x02

	// LOCK_DISCARD instructs the application to discard all memory within the
	// locked region. For vertex and index buffers, the entire buffer will be
	// discarded. This option is only valid when the resource is created with
	// dynamic usage.
	LOCK_DISCARD = 0x2000

	// LOCK_DONOTWAIT allows an application to gain back CPU cycles if the
	// driver cannot lock the surface immediately. If this flag is set and the
	// driver cannot lock the surface immediately, the lock call will return
	// ERR_WASSTILLDRAWING. This flag can only be used when locking a surface
	// created using CreateOffscreenPlainSurface, CreateRenderTarget, or
	// CreateDepthStencilSurface. This flag can also be used with a back buffer.
	LOCK_DONOTWAIT = 0x4000

	// LOCK_NO_DIRTY_UPDATE by default, a lock on a resource adds a dirty
	// region to that resource. This option prevents any changes to the dirty
	// state of the resource. Applications should use this option when they
	// have additional information about the set of regions changed during the
	// lock operation.
	LOCK_NO_DIRTY_UPDATE = 0x8000

	// LOCK_NOOVERWRITE indicates that memory that was referred to in a drawing
	// call since the last lock without this flag will not be modified during
	// the lock. This can enable optimizations when the application is
	// appending data to a resource. Specifying this flag enables the driver to
	// return immediately if the resource is in use, otherwise, the driver must
	// finish using the resource before returning from locking.
	LOCK_NOOVERWRITE = 0x1000

	// LOCK_NOSYSLOCK the default behavior of a video memory lock is to reserve
	// a system-wide critical section, guaranteeing that no display mode
	// changes will occur for the duration of the lock. This option causes the
	// system-wide critical section not to be held for the duration of the lock.
	// The lock operation is time consuming, but can enable the system to
	// perform other duties, such as moving the mouse cursor. This option is
	// useful for long-duration locks, such as the lock of the back buffer for
	// software rendering that would otherwise adversely affect system
	// responsiveness.
	LOCK_NOSYSLOCK = 0x0800

	// LOCK_READONLY means the application will not write to the buffer. This
	// enables resources stored in non-native formats to save the recompression
	// step when unlocking.
	LOCK_READONLY = 0x0010

	// PBLENDCAPS_BLENDFACTOR means the driver supports both BLEND_BLENDFACTOR
	// and BLEND_INVBLENDFACTOR.
	PBLENDCAPS_BLENDFACTOR = 0x00002000

	// PBLENDCAPS_BOTHINVSRCALPHA means the source blend factor is (1 - As, 1 -
	// As, 1 - As, 1 - As) and destination blend factor is (As, As, As, As);
	// the destination blend selection is overridden.
	PBLENDCAPS_BOTHINVSRCALPHA = 0x00001000

	// PBLENDCAPS_BOTHSRCALPHA means the driver supports the BLEND_BOTHSRCALPHA
	// blend mode. (This blend mode is obsolete.)
	PBLENDCAPS_BOTHSRCALPHA = 0x00000800

	// PBLENDCAPS_DESTALPHA means the blend factor is (Ad, Ad, Ad, Ad).
	PBLENDCAPS_DESTALPHA = 0x00000040

	// PBLENDCAPS_DESTCOLOR means the blend factor is (Rd, Gd, Bd, Ad).
	PBLENDCAPS_DESTCOLOR = 0x00000100

	// PBLENDCAPS_INVDESTALPHA means the blend factor is (1 - Ad, 1 - Ad, 1 -
	// Ad, 1 - Ad).
	PBLENDCAPS_INVDESTALPHA = 0x00000080

	// PBLENDCAPS_INVDESTCOLOR means the blend factor is (1 - Rd, 1 - Gd, 1 -
	// Bd, 1 - Ad).
	PBLENDCAPS_INVDESTCOLOR = 0x00000200

	// PBLENDCAPS_INVSRCALPHA means the blend factor is (1 - As, 1 - As, 1 -
	// As, 1 - As).
	PBLENDCAPS_INVSRCALPHA = 0x00000020

	// PBLENDCAPS_INVSRCCOLOR means the blend factor is (1 - Rs, 1 - Gs, 1 -
	// Bs, 1 - As).
	PBLENDCAPS_INVSRCCOLOR = 0x00000008

	// PBLENDCAPS_ONE means the blend factor is (1, 1, 1, 1).
	PBLENDCAPS_ONE = 0x00000002

	// PBLENDCAPS_SRCALPHA means the blend factor is (As, As, As, As).
	PBLENDCAPS_SRCALPHA = 0x00000010

	// min(As, 1 - Ad).
	PBLENDCAPS_SRCALPHASAT = 0x00000400

	// PBLENDCAPS_SRCCOLOR means the blend factor is (Rs, Gs, Bs, As).
	PBLENDCAPS_SRCCOLOR = 0x00000004

	// PBLENDCAPS_ZERO means the blend factor is (0, 0, 0, 0).
	PBLENDCAPS_ZERO = 0x00000001

	// PCMPCAPS_ALWAYS always passes the z-test.
	PCMPCAPS_ALWAYS = 0x80

	// PCMPCAPS_EQUAL passes the z-test if the new z equals the current z.
	PCMPCAPS_EQUAL = 0x04

	// PCMPCAPS_GREATER passes the z-test if the new z is greater than the
	// current z.
	PCMPCAPS_GREATER = 0x10

	// PCMPCAPS_GREATEREQUAL passes the z-test if the new z is greater than or
	// equal to the current z.
	PCMPCAPS_GREATEREQUAL = 0x40

	// PCMPCAPS_LESS passes the z-test if the new z is less than the current z.
	PCMPCAPS_LESS = 0x02

	// PCMPCAPS_LESSEQUAL passes the z-test if the new z is less than or equal
	// to the current z.
	PCMPCAPS_LESSEQUAL = 0x08

	// PCMPCAPS_NEVER always fails the z-test.
	PCMPCAPS_NEVER = 0x01

	// PCMPCAPS_NOTEQUAL passes the z-test if the new z does not equal the
	// current z.
	PCMPCAPS_NOTEQUAL = 0x20

	// PMISCCAPS_MASKZ means the device can enable and disable modification of
	// the depth buffer on pixel operations.
	PMISCCAPS_MASKZ = 0x00000002

	// PMISCCAPS_CULLNONE means the driver does not perform triangle culling.
	// This corresponds to the CULL_NONE member of the CULL enumerated type.
	PMISCCAPS_CULLNONE = 0x00000010

	// PMISCCAPS_CULLCW means the driver supports clockwise triangle culling
	// through the RS_CULLMODE state. (This applies only to triangle
	// primitives.) This flag corresponds to the CULL_CW member of the CULL
	// enumerated type.
	PMISCCAPS_CULLCW = 0x00000020

	// PMISCCAPS_CULLCCW means the driver supports counterclockwise culling
	// through the RS_CULLMODE state. (This applies only to triangle
	// primitives.) This flag corresponds to the CULL_CCW member of the CULL
	// enumerated type.
	PMISCCAPS_CULLCCW = 0x00000040

	// PMISCCAPS_COLORWRITEENABLE means the device supports per-channel writes
	// for the render-target color buffer through the RS_COLORWRITEENABLE state.
	PMISCCAPS_COLORWRITEENABLE = 0x00000080

	// PMISCCAPS_CLIPPLANESCALEDPOINTS means the device correctly clips scaled
	// points of size greater than 1.0 to user-defined clipping planes.
	PMISCCAPS_CLIPPLANESCALEDPOINTS = 0x00000100

	// PMISCCAPS_CLIPTLVERTS means the device clips post-transformed vertex
	// primitives.
	// Specify USAGE_DONOTCLIP when the pipeline should not do any clipping.
	// For this case, additional software clipping may need to be performed at
	// draw time, requiring the vertex buffer to be in system memory.
	PMISCCAPS_CLIPTLVERTS = 0x00000200

	// PMISCCAPS_TSSARGTEMP means the device supports TA for temporary register.
	PMISCCAPS_TSSARGTEMP = 0x00000400

	// PMISCCAPS_BLENDOP means the device supports alpha-blending operations
	// other than BLENDOP_ADD.
	PMISCCAPS_BLENDOP = 0x00000800

	// PMISCCAPS_NULLREFERENCE is a reference device that does not render.
	PMISCCAPS_NULLREFERENCE = 0x00001000

	// PMISCCAPS_INDEPENDENTWRITEMASKS means the device supports independent
	// write masks for multiple element textures or multiple render targets.
	PMISCCAPS_INDEPENDENTWRITEMASKS = 0x00004000

	// PMISCCAPS_PERSTAGECONSTANT means the device supports per-stage
	// constants. See TSS_CONSTANT in TEXTURESTAGESTATETYPE.
	PMISCCAPS_PERSTAGECONSTANT = 0x00008000

	// PMISCCAPS_FOGANDSPECULARALPHA means the device supports separate fog and
	// specular alpha. Many devices use the specular alpha channel to store the
	// fog factor.
	PMISCCAPS_FOGANDSPECULARALPHA = 0x00010000

	// PMISCCAPS_SEPARATEALPHABLEND means the device supports separate blend
	// settings for the alpha channel.
	PMISCCAPS_SEPARATEALPHABLEND = 0x00020000

	// PMISCCAPS_MRTINDEPENDENTBITDEPTHS means the device supports different
	// bit depths for multiple render targets.
	PMISCCAPS_MRTINDEPENDENTBITDEPTHS = 0x00040000

	// PMISCCAPS_MRTPOSTPIXELSHADERBLENDING means the device supports
	// post-pixel shader operations for multiple render targets.
	PMISCCAPS_MRTPOSTPIXELSHADERBLENDING = 0x00080000

	// PMISCCAPS_FOGVERTEXCLAMPED means the device clamps fog blend factor per
	// vertex.
	PMISCCAPS_FOGVERTEXCLAMPED = 0x00100000

	// PRASTERCAPS_ANISOTROPY means the device supports anisotropic filtering.
	PRASTERCAPS_ANISOTROPY = 0x00020000

	// PRASTERCAPS_COLORPERSPECTIVE means the device iterates colors
	// perspective correctly.
	PRASTERCAPS_COLORPERSPECTIVE = 0x00400000

	// PRASTERCAPS_DITHER means the device can dither to improve color
	// resolution.
	PRASTERCAPS_DITHER = 0x00000001

	// PRASTERCAPS_DEPTHBIAS means the device supports legacy depth bias. For
	// true depth bias, see PRASTERCAPS_SLOPESCALEDEPTHBIAS.
	PRASTERCAPS_DEPTHBIAS = 0x04000000

	// PRASTERCAPS_FOGRANGE means the device supports range-based fog. In
	// range-based fog, the distance of an object from the viewer is used to
	// compute fog effects, not the depth of the object (that is, the
	// z-coordinate) in the scene.
	PRASTERCAPS_FOGRANGE = 0x00010000

	// PRASTERCAPS_FOGTABLE means the device calculates the fog value by
	// referring to a lookup table containing fog values that are indexed to
	// the depth of a given pixel.
	PRASTERCAPS_FOGTABLE = 0x00000100

	// PRASTERCAPS_FOGVERTEX means the device calculates the fog value during
	// the lighting operation and interpolates the fog value during
	// rasterization.
	PRASTERCAPS_FOGVERTEX = 0x00000080

	// PRASTERCAPS_MIPMAPLODBIAS means the device supports level-of-detail bias
	// adjustments. These bias adjustments enable an application to make a
	// mipmap appear crisper or less sharp than it normally would. For more
	// information about level-of-detail bias in mipmaps, see
	// SAMP_MIPMAPLODBIAS.
	PRASTERCAPS_MIPMAPLODBIAS = 0x00002000

	// PRASTERCAPS_MULTISAMPLE_TOGGLE means the device supports toggling
	// multisampling on and off between Device.BeginScene and Device.EndScene
	// (using RS_MULTISAMPLEANTIALIAS).
	PRASTERCAPS_MULTISAMPLE_TOGGLE = 0x08000000

	// PRASTERCAPS_SCISSORTEST means the device supports scissor test.
	PRASTERCAPS_SCISSORTEST = 0x01000000

	// PRASTERCAPS_SLOPESCALEDEPTHBIAS means the device performs true
	// slope-scale based depth bias. This is in contrast to the legacy style
	// depth bias.
	PRASTERCAPS_SLOPESCALEDEPTHBIAS = 0x02000000

	// PRASTERCAPS_WBUFFER means the device supports depth buffering using w.
	PRASTERCAPS_WBUFFER = 0x00040000

	// PRASTERCAPS_WFOG means the device supports w-based fog. W-based fog is
	// used when a perspective projection matrix is specified, but affine
	// projections still use z-based fog. The system considers a projection
	// matrix that contains a nonzero value in the [3][4] element to be a
	// perspective projection matrix.
	PRASTERCAPS_WFOG = 0x00100000

	// PRASTERCAPS_ZBUFFERLESSHSR means the device can perform hidden-surface
	// removal (HSR) without requiring the application to sort polygons and
	// without requiring the allocation of a depth-buffer. This leaves more
	// video memory for textures. The method used to perform HSR is
	// hardware-dependent and is transparent to the application.
	// Z-bufferless HSR is performed if no depth-buffer surface is associated
	// with the rendering-target surface and the depth-buffer comparison test
	// is enabled (that is, when the state value associated with the RS_ZENABLE
	// enumeration constant is set to TRUE).
	PRASTERCAPS_ZBUFFERLESSHSR = 0x00008000

	// PRASTERCAPS_ZFOG means the device supports z-based fog.
	PRASTERCAPS_ZFOG = 0x00200000

	// PRASTERCAPS_ZTEST means the device can perform z-test operations. This
	// effectively renders a primitive and indicates whether any z pixels have
	// been rendered.
	PRASTERCAPS_ZTEST = 0x00000010

	// PRESENT_INTERVAL_DEFAULT is nearly equivalent to PRESENT_INTERVAL_ONE.
	PRESENT_INTERVAL_DEFAULT = 0x00000000

	// PRESENT_INTERVAL_ONE means the driver will wait for the vertical retrace
	// period (the runtime will "beam follow" to prevent tearing). Present
	// operations will not be affected more frequently than the screen refresh;
	// the runtime will complete at most one Present operation per adapter
	// refresh period. This is equivalent to using SWAPEFFECT_COPYVSYNC in
	// DirectX 8.1. This option is always available for both windowed and
	// full-screen swap chains.
	PRESENT_INTERVAL_ONE = 0x00000001

	// PRESENT_INTERVAL_TWO means the driver will wait for the vertical retrace
	// period. Present operations will not be affected more frequently than
	// every second screen refresh. Check the PresentationIntervals cap (see
	// CAPS) to see if PRESENT_INTERVAL_TWO is supported by the driver.
	PRESENT_INTERVAL_TWO = 0x00000002

	// PRESENT_INTERVAL_THREE means the driver will wait for the vertical
	// retrace period. Present operations will not be affected more frequently
	// than every third screen refresh. Check the PresentationIntervals cap
	// (see CAPS) to see if PRESENT_INTERVAL_THREE is supported by the driver.
	PRESENT_INTERVAL_THREE = 0x00000004

	// PRESENT_INTERVAL_FOUR means the driver will wait for the vertical
	// retrace period. Present operations will not be affected more frequently
	// than every fourth screen refresh. Check the PresentationIntervals member
	// (see CAPS) to see if PRESENT_INTERVAL_FOUR is supported by the driver.
	PRESENT_INTERVAL_FOUR = 0x00000008

	// PRESENT_INTERVAL_IMMEDIATE means the runtime updates the window client
	// area immediately and might do so more than once during the adapter
	// refresh period. This is equivalent to using SWAPEFFECT_COPY in DirectX
	// 8. Present operations might be affected immediately. This option is
	// always available for both windowed and full-screen swap chains.
	PRESENT_INTERVAL_IMMEDIATE = 0x80000000

	// PRESENT_BACK_BUFFERS_MAX is the maximum number of back buffers supported
	// in Direct3D 9.
	PRESENT_BACK_BUFFERS_MAX = 3

	// PRESENTFLAG_DEVICECLIP clips a windowed Present blit into the window
	// client area, within the monitor screen area of the video adapter that
	// created the Direct3D device. PRESENTFLAG_DEVICECLIP is not valid with
	// SWAPEFFECT_FLIPEX.
	PRESENTFLAG_DEVICECLIP = 0x00000004 /* Clip the window blited into the client area 2k + xp only */

	// PRESENTFLAG_DISCARD_DEPTHSTENCIL set this flag when the device or swap
	// chain is created to enable z-buffer discarding. If this flag is set, the
	// contents of the depth stencil buffer will be invalid after calling
	// either Present, or SetDepthStencilSurface with a different depth surface.
	// Discarding z-buffer data can increase performance and is driver
	// dependent. The debug runtime will enforce discarding by clearing the
	// z-buffer to some constant value after calling either Present, or
	// SetDepthStencilSurface with a different depth surface.
	// Discarding z-buffer data is illegal for all lockable formats,
	// FMT_D16_LOCKABLE and FMT_D32F_LOCKABLE. Any use of CreateDevice
	// specifying a lockable format and z-buffer discarding will fail.
	PRESENTFLAG_DISCARD_DEPTHSTENCIL = 0x00000002 /* Discard Z buffer */

	// PRESENTFLAG_LOCKABLE_BACKBUFFER set this flag if the application
	// requires the ability to lock the back buffer directly. Note that back
	// buffers are not lockable unless the application specifies
	// PRESENTFLAG_LOCKABLE_BACKBUFFER when calling CreateDevice or Reset.
	// Lockable back buffers incur a performance cost on some graphics hardware
	// configurations.
	// Performing a lock operation (or using UpdateSurface to write) on the
	// lockable back buffer decreases performance on many cards. In this case,
	// consider using textured triangles to move data to the back buffer.
	PRESENTFLAG_LOCKABLE_BACKBUFFER = 0x00000001 /* Create a lockable backbuffer */

	// PRESENTFLAG_VIDEO is a hint to the driver that the back buffers will
	// contain video data.
	PRESENTFLAG_VIDEO = 0x00000010 /* backbuffer 'may' contain video data */

	// PSHADECAPS_ALPHAGOURAUDBLEND means the device can support an alpha
	// component for Gouraud-blended transparency (the SHADE_GOURAUD state for
	// the SHADEMODE enumerated type). In this mode, the alpha color component
	// of a primitive is provided at vertices and interpolated across a face
	// along with the other color components.
	PSHADECAPS_ALPHAGOURAUDBLEND = 0x04000

	// PSHADECAPS_COLORGOURAUDRGB means the device can support colored Gouraud
	// shading. In this mode, the per-vertex color components (red, green, and
	// blue) are interpolated across a triangle face.
	PSHADECAPS_COLORGOURAUDRGB = 0x00008

	// PSHADECAPS_FOGGOURAUD means the device can support fog in the Gouraud
	// shading mode.
	PSHADECAPS_FOGGOURAUD = 0x80000

	// PSHADECAPS_SPECULARGOURAUDRGB means the device supports Gouraud shading
	// of specular highlights.
	PSHADECAPS_SPECULARGOURAUDRGB = 0x00200

	// PS20_MAX_DYNAMICFLOWCONTROLDEPTH is the maximum level of nesting of
	// dynamic flow control instructions (break, breakc, ifc).
	PS20_MAX_DYNAMICFLOWCONTROLDEPTH = 24

	// PS20_MIN_DYNAMICFLOWCONTROLDEPTH is the minimum level of nesting of
	// dynamic flow control instructions (break, breakc, ifc).
	PS20_MIN_DYNAMICFLOWCONTROLDEPTH = 0

	// PS20_MAX_NUMTEMPS is the maximum number of supported temporary registers.
	PS20_MAX_NUMTEMPS = 32

	// PS20_MIN_NUMTEMPS is the minimum number of supported temporary registers.
	PS20_MIN_NUMTEMPS = 12

	// PS20_MAX_STATICFLOWCONTROLDEPTH is the maximum depth of nesting of the
	// loop - vs/rep - vs and call - vs/callnz bool - vs instructions.
	PS20_MAX_STATICFLOWCONTROLDEPTH = 4

	// PS20_MIN_STATICFLOWCONTROLDEPTH is the minimum depth of nesting of the
	// loop - vs/rep - vs and call - vs/callnz bool - vs instructions.
	PS20_MIN_STATICFLOWCONTROLDEPTH = 0

	// PS20_MAX_NUMINSTRUCTIONSLOTS is the maximum number of supported
	// instructions.
	PS20_MAX_NUMINSTRUCTIONSLOTS = 512

	// PS20_MIN_NUMINSTRUCTIONSLOTS is the minimum number of supported
	// instructions.
	PS20_MIN_NUMINSTRUCTIONSLOTS = 96

	// PTADDRESSCAPS_BORDER means the device supports setting coordinates
	// outside the range [0.0, 1.0] to the border color, as specified by the
	// SAMP_BORDERCOLOR texture-stage state.
	PTADDRESSCAPS_BORDER = 0x08

	// PTADDRESSCAPS_CLAMP means the device can clamp textures to addresses.
	PTADDRESSCAPS_CLAMP = 0x04

	// PTADDRESSCAPS_INDEPENDENTUV means the device can separate the
	// texture-addressing modes of the u and v coordinates of the texture. This
	// ability corresponds to the SAMP_ADDRESSU and SAMP_ADDRESSV render-state
	// values.
	PTADDRESSCAPS_INDEPENDENTUV = 0x10

	// PTADDRESSCAPS_MIRROR means the device can mirror textures to addresses.
	PTADDRESSCAPS_MIRROR = 0x02

	// PTADDRESSCAPS_MIRRORONCE means the device can take the absolute value of
	// the texture coordinate (thus, mirroring around 0) and then clamp to the
	// maximum value.
	PTADDRESSCAPS_MIRRORONCE = 0x20

	// PTADDRESSCAPS_WRAP means the device can wrap textures to addresses.
	PTADDRESSCAPS_WRAP = 0x01

	// PTEXTURECAPS_ALPHA means alpha in texture pixels is supported.
	PTEXTURECAPS_ALPHA = 0x00000004

	// PTEXTURECAPS_ALPHAPALETTE means the device can draw alpha from texture
	// palettes.
	PTEXTURECAPS_ALPHAPALETTE = 0x00000080

	// PTEXTURECAPS_CUBEMAP means the device upports cube textures.
	PTEXTURECAPS_CUBEMAP = 0x00000800

	// PTEXTURECAPS_CUBEMAP_POW2 means the device requires that cube texture
	// maps have dimensions specified as powers of two.
	PTEXTURECAPS_CUBEMAP_POW2 = 0x00020000

	// PTEXTURECAPS_MIPCUBEMAP means the device supports mipmapped cube
	// textures.
	PTEXTURECAPS_MIPCUBEMAP = 0x00010000

	// PTEXTURECAPS_MIPMAP means the device supports mipmapped textures.
	PTEXTURECAPS_MIPMAP = 0x00004000

	// PTEXTURECAPS_MIPVOLUMEMAP means the device supports mipmapped volume
	// textures.
	PTEXTURECAPS_MIPVOLUMEMAP = 0x00008000

	// PTEXTURECAPS_NONPOW2CONDITIONAL means PTEXTURECAPS_POW2 is also set,
	// conditionally supports the use of 2D textures with dimensions that are
	// not powers of two. A device that exposes this capability can use such a
	// texture if all of the following requirements are met.
	// - The texture addressing mode for the texture stage is set to
	// TADDRESS_CLAMP.
	// - Texture wrapping for the texture stage is disabled (RS_WRAP n set to
	// 0).
	// - Mipmapping is not in use (use magnification filter only).
	// - Texture formats must not be FMT_DXT1 through FMT_DXT5.
	// If this flag is not set, and PTEXTURECAPS_POW2 is also not set, then
	// unconditional support is provided for 2D textures with dimensions that
	// are not powers of two.
	// A texture that is not a power of two cannot be set at a stage that will
	// be read based on a shader computation (such as the bem - ps and texm3x3
	// - ps instructions in pixel shaders versions 1_0 to 1_3). For example,
	// these textures can be used to store bumps that will be fed into texture
	// reads, but not the environment maps that are used in texbem - ps,
	// texbeml - ps, and texm3x3spec - ps. This means that a texture with
	// dimensions that are not powers of two cannot be addressed or sampled
	// using texture coordinates computed within the shader. This type of
	// operation is known as a dependent read and cannot be performed on these
	// types of textures.
	PTEXTURECAPS_NONPOW2CONDITIONAL = 0x00000100

	// PTEXTURECAPS_NOPROJECTEDBUMPENV means the device does not support a
	// projected bump-environment loopkup operation in programmable and fixed
	// function shaders.
	PTEXTURECAPS_NOPROJECTEDBUMPENV = 0x00200000

	// PTEXTURECAPS_PERSPECTIVE means perspective correction texturing is
	// supported.
	PTEXTURECAPS_PERSPECTIVE = 0x00000001

	// PTEXTURECAPS_POW2 means that if PTEXTURECAPS_NONPOW2CONDITIONAL is not
	// set, all textures must have widths and heights specified as powers of
	// two. This requirement does not apply to either cube textures or volume
	// textures.
	// If PTEXTURECAPS_NONPOW2CONDITIONAL is also set, conditionally supports
	// the use of 2D textures with dimensions that are not powers of two. See
	// PTEXTURECAPS_NONPOW2CONDITIONAL description.
	// If this flag is not set, and PTEXTURECAPS_NONPOW2CONDITIONAL is also not
	// set, then unconditional support is provided for 2D textures with
	// dimensions that are not powers of two.
	PTEXTURECAPS_POW2 = 0x00000002

	// PTEXTURECAPS_PROJECTED means the device supports the TTFF_PROJECTED
	// texture transformation flag. When applied, the device divides
	// transformed texture coordinates by the last texture coordinate. If this
	// capability is present, then the projective divide occurs per pixel. If
	// this capability is not present, but the projective divide needs to occur
	// anyway, then it is performed on a per-vertex basis by the Direct3D
	// runtime.
	PTEXTURECAPS_PROJECTED = 0x00000400

	// PTEXTURECAPS_SQUAREONLY means all textures must be square.
	PTEXTURECAPS_SQUAREONLY = 0x00000020

	// PTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE means texture indices are not
	// scaled by the texture size prior to interpolation.
	PTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE = 0x00000040

	// PTEXTURECAPS_VOLUMEMAP means the device supports volume textures.
	PTEXTURECAPS_VOLUMEMAP = 0x00002000

	// PTEXTURECAPS_VOLUMEMAP_POW2 means the device requires that volume
	// texture maps have dimensions specified as powers of two.
	PTEXTURECAPS_VOLUMEMAP_POW2 = 0x00040000

	// PTFILTERCAPS_MAGFPOINT means the device supports per-stage point-sample
	// filtering for magnifying textures. The point-sample magnification filter
	// is represented by the TEXF_POINT member of the TEXTUREFILTERTYPE
	// enumerated type.
	PTFILTERCAPS_MAGFPOINT = 0x01000000

	// PTFILTERCAPS_MAGFLINEAR means the device supports per-stage bilinear
	// interpolation filtering for magnifying mipmaps. The bilinear
	// interpolation mipmapping filter is represented by the TEXF_LINEAR member
	// of the TEXTUREFILTERTYPE enumerated type.
	PTFILTERCAPS_MAGFLINEAR = 0x02000000

	// PTFILTERCAPS_MAGFANISOTROPIC means the device supports per-stage
	// anisotropic filtering for magnifying textures. The anisotropic
	// magnification filter is represented by the TEXF_ANISOTROPIC member of
	// the TEXTUREFILTERTYPE enumerated type.
	PTFILTERCAPS_MAGFANISOTROPIC = 0x04000000

	// PTFILTERCAPS_MAGFPYRAMIDALQUAD means the device supports per-stage
	// pyramidal sample filtering for magnifying textures. The pyramidal
	// magnifying filter is represented by the TEXF_PYRAMIDALQUAD member of the
	// TEXTUREFILTERTYPE enumerated type.
	PTFILTERCAPS_MAGFPYRAMIDALQUAD = 0x08000000

	// PTFILTERCAPS_MAGFGAUSSIANQUAD means the device supports per-stage
	// Gaussian quad filtering for magnifying textures.
	PTFILTERCAPS_MAGFGAUSSIANQUAD = 0x10000000

	// PTFILTERCAPS_MINFPOINT means the device supports per-stage point-sample
	// filtering for minifying textures. The point-sample minification filter
	// is represented by the TEXF_POINT member of the TEXTUREFILTERTYPE
	// enumerated type.
	PTFILTERCAPS_MINFPOINT = 0x00000100

	// PTFILTERCAPS_MINFLINEAR means the device supports per-stage linear
	// filtering for minifying textures. The linear minification filter is
	// represented by the TEXF_LINEAR member of the TEXTUREFILTERTYPE
	// enumerated type.
	PTFILTERCAPS_MINFLINEAR = 0x00000200

	// PTFILTERCAPS_MINFANISOTROPIC means the device supports per-stage
	// anisotropic filtering for minifying textures. The anisotropic
	// minification filter is represented by the TEXF_ANISOTROPIC member of the
	// TEXTUREFILTERTYPE enumerated type.
	PTFILTERCAPS_MINFANISOTROPIC = 0x00000400

	// PTFILTERCAPS_MINFPYRAMIDALQUAD means the device supports per-stage
	// pyramidal sample filtering for minifying textures.
	PTFILTERCAPS_MINFPYRAMIDALQUAD = 0x00000800

	// PTFILTERCAPS_MINFGAUSSIANQUAD means the device supports per-stage
	// Gaussian quad filtering for minifying textures.
	PTFILTERCAPS_MINFGAUSSIANQUAD = 0x00001000

	// PTFILTERCAPS_MIPFPOINT means the device supports per-stage point-sample
	// filtering for mipmaps. The point-sample mipmapping filter is represented
	// by the TEXF_POINT member of the TEXTUREFILTERTYPE enumerated type.
	PTFILTERCAPS_MIPFPOINT = 0x00010000

	// PTFILTERCAPS_MIPFLINEAR means the device supports per-stage bilinear
	// interpolation filtering for mipmaps. The bilinear interpolation
	// mipmapping filter is represented by the TEXF_LINEAR member of the
	// TEXTUREFILTERTYPE enumerated type.
	PTFILTERCAPS_MIPFLINEAR = 0x00020000

	// SPD_IUNKNOWN is used in Resource.SetPrivateData. The data at is a
	// pointer to an IUnknown interface. The size parameter must be set to the
	// size of a pointer to IUnknown. Direct3D automatically calls IUnknown
	// through the data pointer when the private data is destroyed. Private
	// data will be destroyed by a subsequent call to Resource.SetPrivateData
	// with the same GUID, a subsequent call to Resource.FreePrivateData, or
	// when the Direct3D object is released.
	SPD_IUNKNOWN = 0x00000001

	// STENCILCAPS_KEEP does not update the entry in the stencil buffer. This
	// is the default value.
	STENCILCAPS_KEEP = 0x01

	// STENCILCAPS_ZERO sets the stencil-buffer entry to 0.
	STENCILCAPS_ZERO = 0x02

	// STENCILCAPS_REPLACE replaces the stencil-buffer entry with reference
	// value.
	STENCILCAPS_REPLACE = 0x04

	// STENCILCAPS_INCRSAT increments the stencil-buffer entry, clamping to the
	// maximum value.
	STENCILCAPS_INCRSAT = 0x08

	// STENCILCAPS_DECRSAT decrements the stencil-buffer entry, clamping to
	// zero.
	STENCILCAPS_DECRSAT = 0x10

	// STENCILCAPS_INVERT inverts the bits in the stencil-buffer entry.
	STENCILCAPS_INVERT = 0x20

	// STENCILCAPS_INCR increments the stencil-buffer entry, wrapping to zero
	// if the new value exceeds the maximum value.
	STENCILCAPS_INCR = 0x40

	// STENCILCAPS_DECR decrements the stencil-buffer entry, wrapping to the
	// maximum value if the new value is less than zero.
	STENCILCAPS_DECR = 0x80

	// STENCILCAPS_TWOSIDED means the device supports two-sided stencil.
	STENCILCAPS_TWOSIDED = 0x100

	// TA_CONSTANT selects a constant from a texture stage. The default value
	// is 0xFFFFFFFF.
	TA_CONSTANT = 0x00000006

	// TA_CURRENT means the texture argument is the result of the previous
	// blending stage. In the first texture stage (stage 0), this argument is
	// equivalent to TA_DIFFUSE. If the previous blending stage uses a bump-map
	// texture (the TOP_BUMPENVMAP operation), the system chooses the texture
	// from the stage before the bump-map texture. If s represents the current
	// texture stage and s - 1 contains a bump-map texture, this argument
	// becomes the result output by texture stage s - 2. Permissions are
	// read/write.
	TA_CURRENT = 0x00000001

	// TA_DIFFUSE means the texture argument is the diffuse color interpolated
	// from vertex components during Gouraud shading. If the vertex does not
	// contain a diffuse color, the default color is 0xFFFFFFFF. Permissions
	// are read-only.
	TA_DIFFUSE = 0x00000000

	// TA_SELECTMASK is a mask value for all arguments; not used when setting
	// texture arguments.
	TA_SELECTMASK = 0x0000000f

	// TA_SPECULAR means the texture argument is the specular color
	// interpolated from vertex components during Gouraud shading. If the
	// vertex does not contain a specular color, the default color is
	// 0xFFFFFFFF. Permissions are read-only.
	TA_SPECULAR = 0x00000004

	// TA_TEMP means the texture argument is a temporary register color for
	// read or write. TA_TEMP is supported if the PMISCCAPS_TSSARGTEMP device
	// capability is present. The default value for the register is (0.0, 0.0,
	// 0.0, 0.0). Permissions are read/write.
	TA_TEMP = 0x00000005

	// TA_TEXTURE means the texture argument is the texture color for this
	// texture stage. Permissions are read-only.
	TA_TEXTURE = 0x00000002

	// TA_TFACTOR means the texture argument is the texture factor set in a
	// previous call to the SetRenderState with the RS_TEXTUREFACTOR
	// render-state value. Permissions are read-only.
	TA_TFACTOR = 0x00000003

	// TA_ALPHAREPLICATE replicates the alpha information to all color channels
	// before the operation completes. This is a read modifier.
	TA_ALPHAREPLICATE = 0x00000020

	// TA_COMPLEMENT takes the complement of the argument x, (1.0 - x). This is
	// a read modifier.
	TA_COMPLEMENT = 0x00000010

	// TEXOPCAPS_ADD means the TOP_ADD texture-blending operation is supported.
	TEXOPCAPS_ADD = 0x0000040

	// TEXOPCAPS_ADDSIGNED means the TOP_ADDSIGNED texture-blending operation
	// is supported.
	TEXOPCAPS_ADDSIGNED = 0x0000080

	// TEXOPCAPS_ADDSIGNED2X means the TOP_ADDSIGNED2X texture-blending
	// operation is supported.
	TEXOPCAPS_ADDSIGNED2X = 0x0000100

	// TEXOPCAPS_ADDSMOOTH means the TOP_ADDSMOOTH texture-blending operation
	// is supported.
	TEXOPCAPS_ADDSMOOTH = 0x0000400

	// TEXOPCAPS_BLENDCURRENTALPHA means the TOP_BLENDCURRENTALPHA
	// texture-blending operation is supported.
	TEXOPCAPS_BLENDCURRENTALPHA = 0x0008000

	// TEXOPCAPS_BLENDDIFFUSEALPHA means the TOP_BLENDDIFFUSEALPHA
	// texture-blending operation is supported.
	TEXOPCAPS_BLENDDIFFUSEALPHA = 0x0000800

	// TEXOPCAPS_BLENDFACTORALPHA means the TOP_BLENDFACTORALPHA
	// texture-blending operation is supported.
	TEXOPCAPS_BLENDFACTORALPHA = 0x0002000

	// TEXOPCAPS_BLENDTEXTUREALPHA means the TOP_BLENDTEXTUREALPHA
	// texture-blending operation is supported.
	TEXOPCAPS_BLENDTEXTUREALPHA = 0x0001000

	// TEXOPCAPS_BLENDTEXTUREALPHAPM means the TOP_BLENDTEXTUREALPHAPM
	// texture-blending operation is supported.
	TEXOPCAPS_BLENDTEXTUREALPHAPM = 0x0004000

	// TEXOPCAPS_BUMPENVMAP means the TOP_BUMPENVMAP texture-blending operation
	// is supported.
	TEXOPCAPS_BUMPENVMAP = 0x0200000

	// TEXOPCAPS_BUMPENVMAPLUMINANCE means the TOP_BUMPENVMAPLUMINANCE
	// texture-blending operation is supported.
	TEXOPCAPS_BUMPENVMAPLUMINANCE = 0x0400000

	// TEXOPCAPS_DISABLE means the TOP_DISABLE texture-blending operation is
	// supported.
	TEXOPCAPS_DISABLE = 0x0000001

	// TEXOPCAPS_DOTPRODUCT3 means the TOP_DOTPRODUCT3 texture-blending
	// operation is supported.
	TEXOPCAPS_DOTPRODUCT3 = 0x0800000

	// TEXOPCAPS_LERP means the TOP_LERP texture-blending operation is
	// supported.
	TEXOPCAPS_LERP = 0x2000000

	// TEXOPCAPS_MODULATE means the TOP_MODULATE texture-blending operation is
	// supported.
	TEXOPCAPS_MODULATE = 0x0000008

	// TEXOPCAPS_MODULATE2X means the TOP_MODULATE2X texture-blending operation
	// is supported.
	TEXOPCAPS_MODULATE2X = 0x0000010

	// TEXOPCAPS_MODULATE4X means the TOP_MODULATE4X texture-blending operation
	// is supported.
	TEXOPCAPS_MODULATE4X = 0x0000020

	// TEXOPCAPS_MODULATEALPHA_ADDCOLOR means the TOP_MODULATEALPHA_ADDCOLOR
	// texture-blending operation is supported.
	TEXOPCAPS_MODULATEALPHA_ADDCOLOR = 0x0020000

	// TEXOPCAPS_MODULATECOLOR_ADDALPHA means the TOP_MODULATECOLOR_ADDALPHA
	// texture-blending operation is supported.
	TEXOPCAPS_MODULATECOLOR_ADDALPHA = 0x0040000

	// TEXOPCAPS_MODULATEINVALPHA_ADDCOLOR means the
	// TOP_MODULATEINVALPHA_ADDCOLOR texture-blending operation is supported.
	TEXOPCAPS_MODULATEINVALPHA_ADDCOLOR = 0x0080000

	// TEXOPCAPS_MODULATEINVCOLOR_ADDALPHA means the
	// TOP_MODULATEINVCOLOR_ADDALPHA texture-blending operation is supported.
	TEXOPCAPS_MODULATEINVCOLOR_ADDALPHA = 0x0100000

	// TEXOPCAPS_MULTIPLYADD means the TOP_MULTIPLYADD texture-blending
	// operation is supported.
	TEXOPCAPS_MULTIPLYADD = 0x1000000

	// TEXOPCAPS_PREMODULATE means the TOP_PREMODULATE texture-blending
	// operation is supported.
	TEXOPCAPS_PREMODULATE = 0x0010000

	// TEXOPCAPS_SELECTARG1 means the TOP_SELECTARG1 texture-blending operation
	// is supported.
	TEXOPCAPS_SELECTARG1 = 0x0000002

	// TEXOPCAPS_SELECTARG2 means the TOP_SELECTARG2 texture-blending operation
	// is supported.
	TEXOPCAPS_SELECTARG2 = 0x0000004

	// TEXOPCAPS_SUBTRACT means the TOP_SUBTRACT texture-blending operation is
	// supported.
	TEXOPCAPS_SUBTRACT = 0x0000200

	// TSS_TCI_PASSTHRU uses the specified texture coordinates contained within
	// the vertex format. This value resolves to zero.
	TSS_TCI_PASSTHRU = 0x00000

	// TSS_TCI_CAMERASPACENORMAL uses the vertex normal, transformed to camera
	// space, as the input texture coordinates for this stage's texture
	// transformation.
	TSS_TCI_CAMERASPACENORMAL = 0x10000

	// TSS_TCI_CAMERASPACEPOSITION uses the vertex position, transformed to
	// camera space, as the input texture coordinates for this stage's texture
	// transformation.
	TSS_TCI_CAMERASPACEPOSITION = 0x20000

	// TSS_TCI_CAMERASPACEREFLECTIONVECTOR uses the reflection vector,
	// transformed to camera space, as the input texture coordinate for this
	// stage's texture transformation. The reflection vector is computed from
	// the input vertex position and normal vector.
	TSS_TCI_CAMERASPACEREFLECTIONVECTOR = 0x30000

	// TSS_TCI_SPHEREMAP uses the specified texture coordinates for sphere
	// mapping.
	TSS_TCI_SPHEREMAP = 0x40000

	// USAGE_AUTOGENMIPMAP means the resource will automatically generate
	// mipmaps. See Automatic Generation of Mipmaps (Direct3D 9). Automatic
	// generation of mipmaps is not supported for volume textures and depth
	// stencil surfaces/textures. This usage is not valid for a resource in
	// system memory (POOL_SYSTEMMEM).
	USAGE_AUTOGENMIPMAP = 0x00000400

	// USAGE_DEPTHSTENCIL means the resource will be a depth stencil buffer.
	// USAGE_DEPTHSTENCIL can only be used with POOL_DEFAULT.
	USAGE_DEPTHSTENCIL = 0x00000002

	// USAGE_DMAP means the resource will be a displacement map.
	USAGE_DMAP = 0x00004000

	// USAGE_DONOTCLIP indicates that the vertex buffer content will never
	// require clipping. When rendering with buffers that have this flag set,
	// the RS_CLIPPING render state must be set to false.
	USAGE_DONOTCLIP = 0x00000020

	// USAGE_DYNAMIC indicates that the vertex buffer requires dynamic memory
	// use. This is useful for drivers because it enables them to decide where
	// to place the buffer. In general, static vertex buffers are placed in
	// video memory and dynamic vertex buffers are placed in AGP memory. Note
	// that there is no separate static use. If you do not specify
	// USAGE_DYNAMIC, the vertex buffer is made static. USAGE_DYNAMIC is
	// strictly enforced through the LOCK_DISCARD and LOCK_NOOVERWRITE locking
	// flags. As a result, LOCK_DISCARD and LOCK_NOOVERWRITE are valid only on
	// vertex buffers created with USAGE_DYNAMIC. They are not valid flags on
	// static vertex buffers.
	// USAGE_DYNAMIC and POOL_MANAGED are incompatible and should not be used
	// together.
	// Textures can specify USAGE_DYNAMIC. However, managed textures cannot use
	// USAGE_DYNAMIC.
	USAGE_DYNAMIC = 0x00000200

	// USAGE_NPATCHES indicates that the vertex buffer is to be used for
	// drawing N-patches.
	USAGE_NPATCHES = 0x00000100

	// USAGE_POINTS indicates that the vertex or index buffer will be used for
	// drawing point sprites. The buffer will be loaded in system memory if
	// software vertex processing is needed to emulate point sprites.
	USAGE_POINTS = 0x00000040

	// USAGE_RENDERTARGET means the resource will be a render target.
	// USAGE_RENDERTARGET can only be used with POOL_DEFAULT.
	USAGE_RENDERTARGET = 0x00000001

	// USAGE_RTPATCHES indicates that the vertex buffer is to be used for
	// drawing high-order primitives.
	USAGE_RTPATCHES = 0x00000080

	// USAGE_SOFTWAREPROCESSING if this flag is used, vertex processing is done
	// in software. If this flag is not used, vertex processing is done in
	// hardware.
	// The USAGE_SOFTWAREPROCESSING flag can be set when mixed-mode or software
	// vertex processing (CREATE_MIXED_VERTEXPROCESSING /
	// CREATE_SOFTWARE_VERTEXPROCESSING) is enabled for that device.
	// USAGE_SOFTWAREPROCESSING must be set for buffers to be used with
	// software vertex processing in mixed mode, but it should not be set for
	// the best possible performance when using hardware index processing in
	// mixed mode (CREATE_HARDWARE_VERTEXPROCESSING). However, setting
	// USAGE_SOFTWAREPROCESSING is the only option when a single buffer is used
	// with both hardware and software vertex processing.
	// USAGE_SOFTWAREPROCESSING is allowed for mixed and software devices.
	// USAGE_SOFTWAREPROCESSING is used with CheckDeviceFormat to find out if a
	// particular texture format can be used as a vertex texture during
	// software vertex processing. If it can, the texture must be created in
	// POOL_SCRATCH.
	USAGE_SOFTWAREPROCESSING = 0x00000010

	// USAGE_WRITEONLY informs the system that the application writes only to
	// the vertex buffer. Using this flag enables the driver to choose the best
	// memory location for efficient write operations and rendering. Attempts
	// to read from a vertex buffer that is created with this capability will
	// fail. Buffers created with POOL_DEFAULT that do not specify
	// USAGE_WRITEONLY may suffer a severe performance penalty. USAGE_WRITEONLY
	// only affects the performance of POOL_DEFAULT buffers.
	USAGE_WRITEONLY = 0x00000008

	// USAGE_QUERY_FILTER queries the resource format to see if it supports
	// texture filter types other than TEXF_POINT (which is always supported).
	USAGE_QUERY_FILTER = 0x00020000

	// USAGE_QUERY_LEGACYBUMPMAP queries the resource about a legacy bump map.
	USAGE_QUERY_LEGACYBUMPMAP = 0x00008000

	// USAGE_QUERY_POSTPIXELSHADER_BLENDING queries the resource to verify
	// support for post pixel shader blending support. If CheckDeviceFormat
	// fails with USAGE_QUERY_POSTPIXELSHADER_BLENDING, post pixel blending
	// operations are not supported. These include alpha test, pixel fog,
	// render-target blending, color write enable, and dithering.
	USAGE_QUERY_POSTPIXELSHADER_BLENDING = 0x00080000

	// USAGE_QUERY_SRGBREAD queries the resource to verify if a texture
	// supports gamma correction during a read operation.
	USAGE_QUERY_SRGBREAD = 0x00010000

	// USAGE_QUERY_SRGBWRITE queries the resource to verify if a texture
	// supports gamma correction during a write operation.
	USAGE_QUERY_SRGBWRITE = 0x00040000

	// USAGE_QUERY_VERTEXTEXTURE queries the resource to verify support for
	// vertex shader texture sampling.
	USAGE_QUERY_VERTEXTEXTURE = 0x00100000

	// USAGE_QUERY_WRAPANDMIP queries the resource to verify support for
	// texture wrapping and mip-mapping.
	USAGE_QUERY_WRAPANDMIP = 0x00200000

	// VERTEXTEXTURESAMPLER0 identifies the texture sampler used by vertex
	// shaders.
	VERTEXTEXTURESAMPLER0 = (DMAPSAMPLER + 1)

	// VERTEXTEXTURESAMPLER1 identifies the texture sampler used by vertex
	// shaders.
	VERTEXTEXTURESAMPLER1 = (DMAPSAMPLER + 2)

	// VERTEXTEXTURESAMPLER2 identifies the texture sampler used by vertex
	// shaders.
	VERTEXTEXTURESAMPLER2 = (DMAPSAMPLER + 3)

	// VERTEXTEXTURESAMPLER3 identifies the texture sampler used by vertex
	// shaders.
	VERTEXTEXTURESAMPLER3 = (DMAPSAMPLER + 4)

	// VS20CAPS_PREDICATION indicates that instruction predication is
	// supported. See setp_comp - vs.
	VS20CAPS_PREDICATION = (1 << 0)

	// VS20_MAX_DYNAMICFLOWCONTROLDEPTH is the maximum level of nesting of
	// dynamic flow control instructions (break - vs, break_comp - vs, breakp -
	// vs, if_comp - vs, if_comp - vs, if pred - vs).
	VS20_MAX_DYNAMICFLOWCONTROLDEPTH = 24

	// VS20_MIN_DYNAMICFLOWCONTROLDEPTH is the minimum level of nesting of
	// dynamic flow control instructions (break - vs, break_comp - vs, breakp -
	// vs, if_comp - vs, if_comp - vs, if pred - vs).
	VS20_MIN_DYNAMICFLOWCONTROLDEPTH = 0

	// VS20_MAX_NUMTEMPS is the maximum number of temporary registers supported.
	VS20_MAX_NUMTEMPS = 32

	// VS20_MIN_NUMTEMPS is the minimum number of temporary registers supported.
	VS20_MIN_NUMTEMPS = 12

	// VS20_MAX_STATICFLOWCONTROLDEPTH is the maximum depth of nesting of the
	// loop - vs/rep - vs and call - vs/callnz bool - vs instructions.
	VS20_MAX_STATICFLOWCONTROLDEPTH = 4

	// VS20_MIN_STATICFLOWCONTROLDEPTH is the minimum depth of nesting of the
	// loop - vs/rep - vs and call - vs/callnz bool - vs instructions.
	VS20_MIN_STATICFLOWCONTROLDEPTH = 1

	// VTXPCAPS_DIRECTIONALLIGHTS means the device can do directional lights.
	VTXPCAPS_DIRECTIONALLIGHTS = 0x00000008

	// VTXPCAPS_LOCALVIEWER means the device can do local viewer.
	VTXPCAPS_LOCALVIEWER = 0x00000020

	// VTXPCAPS_MATERIALSOURCE7 means the device supports the color material
	// states: RS_AMBIENTMATERIALSOURCE, RS_DIFFUSEMATERIALSOURCE,
	// RS_EMISSIVEMATERIALSOURCE, and RS_SPECULARMATERIALSOURCE.
	VTXPCAPS_MATERIALSOURCE7 = 0x00000002

	// VTXPCAPS_NO_TEXGEN_NONLOCALVIEWER means the device does not support
	// texture generation in non-local viewer mode.
	VTXPCAPS_NO_TEXGEN_NONLOCALVIEWER = 0x00000200

	// VTXPCAPS_POSITIONALLIGHTS means the device can do positional lights
	// (includes point and spot).
	VTXPCAPS_POSITIONALLIGHTS = 0x00000010

	// VTXPCAPS_TEXGEN means the device can do texgen.
	VTXPCAPS_TEXGEN = 0x00000001

	// VTXPCAPS_TEXGEN_SPHEREMAP means the device supports TSS_TCI_SPHEREMAP.
	VTXPCAPS_TEXGEN_SPHEREMAP = 0x00000100

	// VTXPCAPS_TWEENING means the device can do vertex tweening.
	VTXPCAPS_TWEENING = 0x00000040

	// S_OK indicates that no error occurred.
	S_OK = 0

	// S_PRESENT_OCCLUDED indicates that the presentation area is occluded.
	// Occlusion means that the presentation window is minimized or another
	// device entered the fullscreen mode on the same monitor as the
	// presentation window and the presentation window is completely on that
	// monitor. Occlusion will not occur if the client area is covered by
	// another Window.
	// Occluded applications can continue rendering and all calls will succeed,
	// but the occluded presentation window will not be updated. Preferably the
	// application should stop rendering to the presentation window using the
	// device and keep calling CheckDeviceState until S_OK or
	// S_PRESENT_MODE_CHANGED returns.
	// Direct3D 9Ex only.
	S_PRESENT_OCCLUDED = 141953144

	// S_PRESENT_MODE_CHANGED indicates that the desktop display mode has been
	// changed. The application can continue rendering, but there might be
	// color conversion/stretching. Pick a back buffer format similar to the
	// current display mode, and call Reset to recreate the swap chains. The
	// device will leave this state after a Reset is called. Direct3D 9Ex only.
	S_PRESENT_MODE_CHANGED = 141953143

	// _SDK_VERSION is must be used as the argument to Create.
	SDK_VERSION = 32

	// _MAX_SIMULTANEOUS_RENDERTARGETS is the maximum number of rendertargets.
	MAX_SIMULTANEOUS_RENDERTARGETS = 4

	// DMAPSAMPLER is 256, which is the maximum number of texture samplers.
	DMAPSAMPLER = 256

	// DP_MAXTEXCOORD is the maximum number of texture coordinates.
	DP_MAXTEXCOORD = 8

	// MAXD3DDECLLENGTH is the maximum number of elements in a vertex
	// declaration (does not include "end" marker vertex element).
	MAXD3DDECLLENGTH = 64 /* +end marker */

	// MAXD3DDECLUSAGEINDEX is the maximum index (0-15) that can be used in a
	// vertex declaration.
	MAXD3DDECLUSAGEINDEX = 15

	// CLIPPLANE0 can be used to enable user-defined clipping plane 0. It is
	// defined as a convenience when setting values for the RS_CLIPPLANEENABLE
	// render state.
	CLIPPLANE0 = (1 << 0)

	// CLIPPLANE1 can be used to enable user-defined clipping plane 1. It is
	// defined as a convenience when setting values for the RS_CLIPPLANEENABLE
	// render state.
	CLIPPLANE1 = (1 << 1)

	// CLIPPLANE2 can be used to enable user-defined clipping plane 2. It is
	// defined as a convenience when setting values for the RS_CLIPPLANEENABLE
	// render state.
	CLIPPLANE2 = (1 << 2)

	// CLIPPLANE3 can be used to enable user-defined clipping plane 3. It is
	// defined as a convenience when setting values for the RS_CLIPPLANEENABLE
	// render state.
	CLIPPLANE3 = (1 << 3)

	// CLIPPLANE4 can be used to enable user-defined clipping plane 4. It is
	// defined as a convenience when setting values for the RS_CLIPPLANEENABLE
	// render state.
	CLIPPLANE4 = (1 << 4)

	// CLIPPLANE5 can be used to enable user-defined clipping plane 5. It is
	// defined as a convenience when setting values for the RS_CLIPPLANEENABLE
	// render state.
	CLIPPLANE5 = (1 << 5)

	// ISSUE_BEGIN is a value used by Issue to issue a query begin.
	ISSUE_BEGIN = (1 << 1)

	// ISSUE_END is a value used by Issue to issue a query end.
	ISSUE_END = (1 << 0)

	// GETDATA_FLUSH is the value passed to GetData to flush query data.
	GETDATA_FLUSH = (1 << 0)
)
View Source
const (
	// BACKBUFFER_TYPE_MONO specifies a nonstereo swap chain.
	BACKBUFFER_TYPE_MONO = 0
	// BACKBUFFER_TYPE_LEFT specifies the left side of a stereo pair in a swap
	// chain.
	BACKBUFFER_TYPE_LEFT = 1
	// BACKBUFFER_TYPE_RIGHT specifies the right side of a stereo pair in a
	// swap chain.
	BACKBUFFER_TYPE_RIGHT = 2
)
View Source
const (
	// BASIS_BEZIER means input vertices are treated as a series of Bézier
	// patches. The number of vertices specified must be divisible by 4.
	// Portions of the mesh beyond this criterion will not be rendered. Full
	// continuity is assumed between sub-patches in the interior of the surface
	// rendered by each call. Only the vertices at the corners of each
	// sub-patch are guaranteed to lie on the resulting surface.
	BASIS_BEZIER = 0
	// BASIS_BSPLINE means input vertices are treated as control points of a
	// B-spline surface. The number of apertures rendered is two fewer than the
	// number of apertures in that direction. In general, the generated surface
	// does not contain the control vertices specified.
	BASIS_BSPLINE = 1
	// BASIS_CATMULL_ROM means an interpolating basis defines the surface so
	// that the surface goes through all the input vertices specified. In
	// DirectX 8, this was BASIS_INTERPOLATE.
	BASIS_CATMULL_ROM = 2
)
View Source
const (
	// BLEND_ZERO Blend factor is (0, 0, 0, 0).
	BLEND_ZERO = 1
	// BLEND_ONE Blend factor is (1, 1, 1, 1).
	BLEND_ONE = 2
	// BLEND_SRCCOLOR Blend factor is (Rs, Gs, Bs, As).
	BLEND_SRCCOLOR = 3
	// BLEND_INVSRCCOLOR Blend factor is (1 - Rs, 1 - Gs, 1 - Bs, 1 - As).
	BLEND_INVSRCCOLOR = 4
	// BLEND_SRCALPHA Blend factor is (As, As, As, As).
	BLEND_SRCALPHA = 5
	// BLEND_INVSRCALPHA Blend factor is ( 1 - As, 1 - As, 1 - As, 1 - As).
	BLEND_INVSRCALPHA = 6
	// BLEND_DESTALPHA Blend factor is (Ad, Ad, Ad, Ad).
	BLEND_DESTALPHA = 7
	// BLEND_INVDESTALPHA Blend factor is (1 - Ad, 1 - Ad, 1 - Ad, 1 - Ad).
	BLEND_INVDESTALPHA = 8
	// BLEND_DESTCOLOR Blend factor is (Rd, Gd, Bd, Ad).
	BLEND_DESTCOLOR = 9
	// BLEND_INVDESTCOLOR Blend factor is (1 - Rd, 1 - Gd, 1 - Bd, 1 - Ad).
	BLEND_INVDESTCOLOR = 10
	// BLEND_SRCALPHASAT Blend factor is (f, f, f, 1); where f = min(As, 1 -
	// Ad).
	BLEND_SRCALPHASAT = 11
	// BLEND_BOTHSRCALPHA is obsolete. Starting with DirectX 6, you can achieve
	// the same effect by setting the source and destination blend factors to
	// BLEND_SRCALPHA and BLEND_INVSRCALPHA in separate calls.
	BLEND_BOTHSRCALPHA = 12
	// BLEND_BOTHINVSRCALPHA is obsolete. Source blend factor is (1 - As, 1 -
	// As, 1 - As, 1 - As), and destination blend factor is (As, As, As, As);
	// the destination blend selection is overridden. This blend mode is
	// supported only for the RS_SRCBLEND render state.
	BLEND_BOTHINVSRCALPHA = 13
	// BLEND_BLENDFACTOR is a constant color blending factor used by the
	// frame-buffer blender. This blend mode is supported only if
	// PBLENDCAPS_BLENDFACTOR is set in the SrcBlendCaps or DestBlendCaps
	// members of CAPS.
	BLEND_BLENDFACTOR = 14
	// BLEND_INVBLENDFACTOR is an inverted constant color-blending factor used
	// by the frame-buffer blender. This blend mode is supported only if the
	// PBLENDCAPS_BLENDFACTOR bit is set in the SrcBlendCaps or DestBlendCaps
	// members of CAPS.
	BLEND_INVBLENDFACTOR = 15
)
View Source
const (
	// BLENDOP_ADD means the result is the destination added to the source.
	// Result = Source + Destination
	BLENDOP_ADD = 1
	// BLENDOP_SUBTRACT means the result is the destination subtracted from to
	// the source. Result = Source - Destination
	BLENDOP_SUBTRACT = 2
	// BLENDOP_REVSUBTRACT means the result is the source subtracted from the
	// destination. Result = Destination - Source
	BLENDOP_REVSUBTRACT = 3
	// BLENDOP_MIN means the result is the minimum of the source and
	// destination. Result = MIN(Source, Destination)
	BLENDOP_MIN = 4
	// BLENDOP_MAX means the result is the maximum of the source and
	// destination. Result = MAX(Source, Destination)
	BLENDOP_MAX = 5
)
View Source
const (
	// CMP_NEVER always fails the test.
	CMP_NEVER = 1
	// CMP_LESS accepts the new pixel if its value is less than the value of
	// the current pixel.
	CMP_LESS = 2
	// CMP_EQUAL accepts the new pixel if its value equals the value of the
	// current pixel.
	CMP_EQUAL = 3
	// CMP_LESSEQUAL accepts the new pixel if its value is less than or equal
	// to the value of the current pixel.
	CMP_LESSEQUAL = 4
	// CMP_GREATER accepts the new pixel if its value is greater than the value
	// of the current pixel.
	CMP_GREATER = 5
	// CMP_NOTEQUAL accepts the new pixel if its value does not equal the value
	// of the current pixel.
	CMP_NOTEQUAL = 6
	// CMP_GREATEREQUAL accepts the new pixel if its value is greater than or
	// equal to the value of the current pixel.
	CMP_GREATEREQUAL = 7
	// CMP_ALWAYS always passes the test.
	CMP_ALWAYS = 8
)
View Source
const (
	// CUBEMAP_FACE_POSITIVE_X is the positive x-face of the cubemap.
	CUBEMAP_FACE_POSITIVE_X = 0
	// CUBEMAP_FACE_NEGATIVE_X is the negative x-face of the cubemap.
	CUBEMAP_FACE_NEGATIVE_X = 1
	// CUBEMAP_FACE_POSITIVE_Y is the positive y-face of the cubemap.
	CUBEMAP_FACE_POSITIVE_Y = 2
	// CUBEMAP_FACE_NEGATIVE_Y is the negative y-face of the cubemap.
	CUBEMAP_FACE_NEGATIVE_Y = 3
	// CUBEMAP_FACE_POSITIVE_Z is the positive z-face of the cubemap.
	CUBEMAP_FACE_POSITIVE_Z = 4
	// CUBEMAP_FACE_NEGATIVE_Z is the negative z-face of the cubemap.
	CUBEMAP_FACE_NEGATIVE_Z = 5
)
View Source
const (
	// CULL_NONE does not cull back faces.
	CULL_NONE = 1
	// CULL_CW culls back faces with clockwise vertices.
	CULL_CW = 2
	// CULL_CCW culls back faces with counterclockwise vertices.
	CULL_CCW = 3
)
View Source
const (
	// DMT_ENABLE enables the debug monitor.
	DMT_ENABLE = 0
	// DMT_DISABLE disables the debug monitor.
	DMT_DISABLE = 1
)
View Source
const (
	// DECLMETHOD_DEFAULT is the default value. The tessellator copies the
	// vertex data (spline data for patches) as is, with no additional
	// calculations. When the tessellator is used, this element is
	// interpolated. Otherwise vertex data is copied into the input register.
	// The input and output type can be any value, but are always the same type.
	DECLMETHOD_DEFAULT = 0
	// DECLMETHOD_PARTIALU computes the tangent at a point on the rectangle or
	// triangle patch in the U direction. The input type can be one of the
	// following: DECLTYPE_D3DCOLOR, DECLTYPE_FLOAT3, DECLTYPE_FLOAT4,
	// DECLTYPE_SHORT4, DECLTYPE_UBYTE4.
	// The output type is always DECLTYPE_FLOAT3.
	DECLMETHOD_PARTIALU = 1
	// DECLMETHOD_PARTIALV Computes the tangent at a point on the rectangle or
	// triangle patch in the V direction. The input type can be one of the
	// following: DECLTYPE_D3DCOLOR, DECLTYPE_FLOAT3, DECLTYPE_FLOAT4,
	// DECLTYPE_SHORT4, DECLTYPE_UBYTE4.
	// The output type is always DECLTYPE_FLOAT3.
	DECLMETHOD_PARTIALV = 2
	// DECLMETHOD_CROSSUV computes the normal at a point on the rectangle or
	// triangle patch by taking the cross product of two tangents. The input
	// type can be one of the following: DECLTYPE_D3DCOLOR, DECLTYPE_FLOAT3,
	// DECLTYPE_FLOAT4, DECLTYPE_SHORT4, DECLTYPE_UBYTE4.
	// The output type is always DECLTYPE_FLOAT3.
	DECLMETHOD_CROSSUV = 3
	// DECLMETHOD_UV copies out the U, V values at a point on the rectangle or
	// triangle patch. This results in a 2D float. The input type must be set
	// to DECLTYPE_UNUSED. The output data type is always DECLTYPE_FLOAT2. The
	// input stream and offset are also unused (but must be set to 0).
	DECLMETHOD_UV = 4
	// DECLMETHOD_LOOKUP looks up a displacement map. The input type can be one
	// of the following: DECLTYPE_FLOAT2, DECLTYPE_FLOAT3, DECLTYPE_FLOAT4.
	// Only the X and Y components are used for the texture map lookup. The
	// output type is always DECLTYPE_FLOAT1. The device must support
	// displacement mapping. This constant is supported only by the
	// programmable pipeline on N-patch data, if N-patches are enabled.
	DECLMETHOD_LOOKUP = 5
	// DECLMETHOD_LOOKUPPRESAMPLED looks up a presampled displacement map. The
	// input type must be set to DECLTYPE_UNUSED; the stream index and the
	// stream offset must be set to 0. The output type for this operation is
	// always DECLTYPE_FLOAT1. The device must support displacement mapping.
	// This constant is supported only by the programmable pipeline on N-patch
	// data, if N-patches are enabled. This method can be used only with
	// DECLUSAGE_SAMPLE.
	DECLMETHOD_LOOKUPPRESAMPLED = 6
)
View Source
const (
	// DECLTYPE_FLOAT1 is a one-component float expanded to (float, 0, 0, 1).
	DECLTYPE_FLOAT1 = 0
	// DECLTYPE_FLOAT2 is a two-component float expanded to (float, float, 0,
	// 1).
	DECLTYPE_FLOAT2 = 1
	// DECLTYPE_FLOAT3 is a three-component float expanded to (float, float,
	// float, 1).
	DECLTYPE_FLOAT3 = 2
	// DECLTYPE_FLOAT4 is a four-component float expanded to (float, float,
	// float, float).
	DECLTYPE_FLOAT4 = 3
	// DECLTYPE_D3DCOLOR is a four-component, packed, unsigned bytes mapped to
	// 0 to 1 range. Input is a COLOR and is expanded to RGBA order.
	DECLTYPE_D3DCOLOR = 4
	// DECLTYPE_UBYTE4 is a four-component, unsigned byte.
	DECLTYPE_UBYTE4 = 5
	// DECLTYPE_SHORT2 is a two-component, signed short expanded to (value,
	// value, 0, 1).
	DECLTYPE_SHORT2 = 6
	// DECLTYPE_SHORT4 is a four-component, signed short expanded to (value,
	// value, value, value).
	DECLTYPE_SHORT4 = 7
	// DECLTYPE_UBYTE4N is a four-component byte with each byte normalized by
	// dividing with 255.0f.
	DECLTYPE_UBYTE4N = 8
	// DECLTYPE_SHORT2N is a normalized, two-component, signed short, expanded
	// to (first short/32767.0, second short/32767.0, 0, 1).
	DECLTYPE_SHORT2N = 9
	// DECLTYPE_SHORT4N is a normalized, four-component, signed short, expanded
	// to (first short/32767.0, second short/32767.0, third short/32767.0,
	// fourth short/32767.0).
	DECLTYPE_SHORT4N = 10
	// DECLTYPE_USHORT2N is a normalized, two-component, unsigned short,
	// expanded to (first short/65535.0, short short/65535.0, 0, 1).
	DECLTYPE_USHORT2N = 11
	// DECLTYPE_USHORT4N is a normalized, four-component, unsigned short,
	// expanded to (first short/65535.0, second short/65535.0, third
	// short/65535.0, fourth short/65535.0).
	DECLTYPE_USHORT4N = 12
	// DECLTYPE_UDEC3 is a three-component, unsigned, 10 10 10 format expanded
	// to (value, value, value, 1).
	DECLTYPE_UDEC3 = 13
	// DECLTYPE_DEC3N is a three-component, signed, 10 10 10 format normalized
	// and expanded to (v[0]/511.0, v[1]/511.0, v[2]/511.0, 1).
	DECLTYPE_DEC3N = 14
	// DECLTYPE_FLOAT16_2 is a two-component, 16-bit, floating point expanded
	// to (value, value, 0, 1).
	DECLTYPE_FLOAT16_2 = 15
	// DECLTYPE_FLOAT16_4 is a four-component, 16-bit, floating point expanded
	// to (value, value, value, value).
	DECLTYPE_FLOAT16_4 = 16
	// DECLTYPE_UNUSED means the type field in the declaration is unused. This
	// is designed for use with DECLMETHOD_UV and DECLMETHOD_LOOKUPPRESAMPLED.
	DECLTYPE_UNUSED = 17
)
View Source
const (
	// DECLUSAGE_POSITION means position data ranging from (-1,-1) to (1,1).
	// Use DECLUSAGE_POSITION with a usage index of 0 to specify untransformed
	// position for fixed function vertex processing and the n-patch
	// tessellator. Use DECLUSAGE_POSITION with a usage index of 1 to specify
	// untransformed position in the fixed function vertex shader for vertex
	// tweening.
	DECLUSAGE_POSITION = 0
	// DECLUSAGE_BLENDWEIGHT means blending weight data. Use
	// DECLUSAGE_BLENDWEIGHT with a usage index of 0 to specify the blend
	// weights used in indexed and nonindexed vertex blending.
	DECLUSAGE_BLENDWEIGHT = 1
	// DECLUSAGE_BLENDINDICES means blending indices data. Use
	// DECLUSAGE_BLENDINDICES with a usage index of 0 to specify matrix indices
	// for indexed paletted skinning.
	DECLUSAGE_BLENDINDICES = 2
	// DECLUSAGE_NORMAL means vertex normal data. Use DECLUSAGE_NORMAL with a
	// usage index of 0 to specify vertex normals for fixed function vertex
	// processing and the n-patch tessellator. Use DECLUSAGE_NORMAL with a
	// usage index of 1 to specify vertex normals for fixed function vertex
	// processing for vertex tweening.
	DECLUSAGE_NORMAL = 3
	// DECLUSAGE_PSIZE means point size data. Use DECLUSAGE_PSIZE with a usage
	// index of 0 to specify the point-size attribute used by the setup engine
	// of the rasterizer to expand a point into a quad for the point-sprite
	// functionality.
	DECLUSAGE_PSIZE = 4
	// DECLUSAGE_TEXCOORD means texture coordinate data. Use
	// DECLUSAGE_TEXCOORD, n to specify texture coordinates in fixed function
	// vertex processing and in pixel shaders prior to ps_3_0. These can be
	// used to pass user defined data.
	DECLUSAGE_TEXCOORD = 5
	// DECLUSAGE_TANGENT means vertex tangent data.
	DECLUSAGE_TANGENT = 6
	// DECLUSAGE_BINORMAL means vertex binormal data.
	DECLUSAGE_BINORMAL = 7
	// DECLUSAGE_TESSFACTOR means a single positive floating point value. Use
	// DECLUSAGE_TESSFACTOR with a usage index of 0 to specify a tessellation
	// factor used in the tessellation unit to control the rate of tessellation.
	DECLUSAGE_TESSFACTOR = 8
	// DECLUSAGE_POSITIONT means the vertex data contains transformed position
	// data ranging from (0,0) to (viewport width, viewport height). Use
	// DECLUSAGE_POSITIONT with a usage index of 0 to specify transformed
	// position. When a declaration containing this is set, the pipeline does
	// not perform vertex processing.
	DECLUSAGE_POSITIONT = 9
	// DECLUSAGE_COLOR means the vertex data contains diffuse or specular
	// color. Use DECLUSAGE_COLOR with a usage index of 0 to specify the
	// diffuse color in the fixed function vertex shader and pixel shaders
	// prior to ps_3_0. Use D3DDECLUSAGE_COLOR with a usage index of 1 to
	// specify the specular color in the fixed function vertex shader and pixel
	// shaders prior to ps_3_0.
	DECLUSAGE_COLOR = 10
	// DECLUSAGE_FOG means the vertex data contains fog data. Use DECLUSAGE_FOG
	// with a usage index of 0 to specify a fog blend value used after pixel
	// shading finishes. This applies to pixel shaders prior to version ps_3_0.
	DECLUSAGE_FOG = 11
	// DECLUSAGE_DEPTH means the vertex data contains depth data.
	DECLUSAGE_DEPTH = 12
	// DECLUSAGE_SAMPLE means the vertex data contains sampler data. Use
	// DECLUSAGE_SAMPLE with a usage index of 0 to specify the displacement
	// value to look up. It can be used only with
	// DECLUSAGE_LOOKUPPRESAMPLED or DECLUSAGE_LOOKUP.
	DECLUSAGE_SAMPLE = 13
)
View Source
const (
	// DEGREE_LINEAR means the curve is described by variables of first order.
	DEGREE_LINEAR = 1
	// DEGREE_QUADRATIC means the curve is described by variables of second
	// order.
	DEGREE_QUADRATIC = 2
	// DEGREE_CUBIC means the curve is described by variables of third order.
	DEGREE_CUBIC = 3
	// DEGREE_QUINTIC means the curve is described by variables of fourth order.
	DEGREE_QUINTIC = 5
)
View Source
const (
	// DEVTYPE_HAL indicates hardware rasterization. Shading is done with
	// software, hardware, or mixed transform and lighting.
	DEVTYPE_HAL = 1
	// DEVTYPE_REF means Direct3D features are implemented in software;
	// however, the reference rasterizer does make use of special CPU
	// instructions whenever it can.
	// The reference device is installed by the Windows SDK 8.0 or later and is
	// intended as an aid in debugging for development only.
	DEVTYPE_REF = 2
	// DEVTYPE_SW is a pluggable software device that has been registered with
	// Direct3D.RegisterSoftwareDevice.
	DEVTYPE_SW = 3
	// DEVTYPE_NULLREF initializes Direct3D on a computer that has neither
	// hardware nor reference rasterization available, and enable resources for
	// 3D content creation.
	DEVTYPE_NULLREF = 4
)
View Source
const (
	// FILL_POINT fills points.
	FILL_POINT = 1
	// FILL_WIREFRAME fills wireframes.
	FILL_WIREFRAME = 2
	// FILL_SOLID fills solids.
	FILL_SOLID = 3
)
View Source
const (
	// FOG_NONE means no fog effect.
	FOG_NONE = 0
	// FOG_EXP means the fog effect intensifies exponentially, according to the
	// following formula:
	// f = 1/(e^(d*density))
	FOG_EXP = 1
	// FOG_EXP2 means the fog effect intensifies exponentially with the square
	// of the distance, according to the following formula:
	// f = 1/(e^[(d*density)^2])
	FOG_EXP2 = 2
	// FOG_LINEAR means the fog effect intensifies linearly between the start
	// and end points, according to the following formula:
	// f = (end - d)/(end - start)
	// This is the only fog mode currently supported.
	FOG_LINEAR = 3
)
View Source
const (
	// FMT_UNKNOWN means the surface format is unknown.
	FMT_UNKNOWN = 0
	// FMT_R8G8B8 means 24-bit RGB pixel format with 8 bits per channel.
	FMT_R8G8B8 = 20
	// FMT_A8R8G8B8 means 32-bit ARGB pixel format with alpha, using 8 bits per
	// channel.
	FMT_A8R8G8B8 = 21
	// FMT_X8R8G8B8 means 32-bit RGB pixel format, where 8 bits are reserved
	// for each color.
	FMT_X8R8G8B8 = 22
	// FMT_R5G6B5 means 16-bit RGB pixel format with 5 bits for red, 6 bits for
	// green, and 5 bits for blue.
	FMT_R5G6B5 = 23
	// FMT_X1R5G5B5 means 16-bit pixel format where 5 bits are reserved for
	// each color.
	FMT_X1R5G5B5 = 24
	// FMT_A1R5G5B5 means 16-bit pixel format where 5 bits are reserved for
	// each color and 1 bit is reserved for alpha.
	FMT_A1R5G5B5 = 25
	// FMT_A4R4G4B4 means 16-bit ARGB pixel format with 4 bits for each channel.
	FMT_A4R4G4B4 = 26
	// FMT_R3G3B2 means 8-bit RGB texture format using 3 bits for red, 3 bits
	// for green, and 2 bits for blue.
	FMT_R3G3B2 = 27
	// FMT_A8 means 8-bit alpha only.
	FMT_A8 = 28
	// FMT_A8R3G3B2 means 16-bit ARGB texture format using 8 bits for alpha, 3
	// bits each for red and green, and 2 bits for blue.
	FMT_A8R3G3B2 = 29
	// FMT_X4R4G4B4 means 16-bit RGB pixel format using 4 bits for each color.
	FMT_X4R4G4B4 = 30
	// FMT_A2B10G10R10 means 32-bit pixel format using 10 bits for each color
	// and 2 bits for alpha.
	FMT_A2B10G10R10 = 31
	// FMT_A8B8G8R8 means 32-bit ARGB pixel format with alpha, using 8 bits per
	// channel.
	FMT_A8B8G8R8 = 32
	// FMT_X8B8G8R8 means 32-bit RGB pixel format, where 8 bits are reserved
	// for each color.
	FMT_X8B8G8R8 = 33
	// FMT_G16R16 means 32-bit pixel format using 16 bits each for green and
	// red.
	FMT_G16R16 = 34
	// FMT_A2R10G10B10 means 32-bit pixel format using 10 bits each for red,
	// green, and blue, and 2 bits for alpha.
	FMT_A2R10G10B10 = 35
	// FMT_A16B16G16R16 means 64-bit pixel format using 16 bits for each
	// component.
	FMT_A16B16G16R16 = 36
	// FMT_A8P8 means 8-bit color indexed with 8 bits of alpha.
	FMT_A8P8 = 40
	// FMT_P8 means 8-bit color indexed.
	FMT_P8 = 41
	// FMT_L8 means 8-bit luminance only.
	FMT_L8 = 50
	// FMT_A8L8 means 16-bit using 8 bits each for alpha and luminance.
	FMT_A8L8 = 51
	// FMT_A4L4 means 8-bit using 4 bits each for alpha and luminance.
	FMT_A4L4 = 52
	// FMT_V8U8 means 16-bit bump-map format using 8 bits each for u and v data.
	FMT_V8U8 = 60
	// FMT_L6V5U5 means 16-bit bump-map format with luminance using 6 bits for
	// luminance, and 5 bits each for v and u.
	FMT_L6V5U5 = 61
	// FMT_X8L8V8U8 means 32-bit bump-map format with luminance using 8 bits
	// for each channel.
	FMT_X8L8V8U8 = 62
	// FMT_Q8W8V8U8 means 32-bit bump-map format using 8 bits for each channel.
	FMT_Q8W8V8U8 = 63
	// FMT_V16U16 means 32-bit bump-map format using 16 bits for each channel.
	FMT_V16U16 = 64
	// FMT_A2W10V10U10 means 32-bit bump-map format using 2 bits for alpha and
	// 10 bits each for w, v, and u.
	FMT_A2W10V10U10 = 67
	// FMT_UYVY means UYVY format (PC98 compliance).
	FMT_UYVY = 1498831189
	// FMT_R8G8_B8G8 is a 16-bit packed RGB format analogous to UYVY (U0Y0,
	// V0Y1, U2Y2, and so on). It requires a pixel pair in order to properly
	// represent the color value. The first pixel in the pair contains 8 bits
	// of green (in the low 8 bits) and 8 bits of red (in the high 8 bits). The
	// second pixel contains 8 bits of green (in the low 8 bits) and 8 bits of
	// blue (in the high 8 bits). Together, the two pixels share the red and
	// blue components, while each has a unique green component (R0G0, B0G1,
	// R2G2, and so on). The texture sampler does not normalize the colors when
	// looking up into a pixel shader; they remain in the range of 0.0f to
	// 255.0f. This is true for all programmable pixel shader models. For the
	// fixed function pixel shader, the hardware should normalize to the 0.f to
	// 1.f range and essentially treat it as the YUY2 texture. Hardware that
	// exposes this format must have PixelShader1xMaxValue member of CAPS set
	// to a value capable of handling that range.
	FMT_R8G8_B8G8 = 1195525970
	// FMT_YUY2 means YUY2 format (PC98 compliance).
	FMT_YUY2 = 844715353
	// FMT_G8R8_G8B8 is a 16-bit packed RGB format analogous to YUY2 (Y0U0,
	// Y1V0, Y2U2, and so on). It requires a pixel pair in order to properly
	// represent the color value. The first pixel in the pair contains 8 bits
	// of green (in the high 8 bits) and 8 bits of red (in the low 8 bits). The
	// second pixel contains 8 bits of green (in the high 8 bits) and 8 bits of
	// blue (in the low 8 bits). Together, the two pixels share the red and
	// blue components, while each has a unique green component (G0R0, G1B0,
	// G2R2, and so on). The texture sampler does not normalize the colors when
	// looking up into a pixel shader; they remain in the range of 0.0f to
	// 255.0f. This is true for all programmable pixel shader models. For the
	// fixed function pixel shader, the hardware should normalize to the 0.f to
	// 1.f range and essentially treat it as the YUY2 texture. Hardware that
	// exposes this format must have the PixelShader1xMaxValue member of CAPS
	// set to a value capable of handling that range.
	FMT_G8R8_G8B8 = 1111970375
	// FMT_DXT1 means DXT1 compression texture format.
	FMT_DXT1 = 827611204
	// FMT_DXT2 means DXT2 compression texture format.
	FMT_DXT2 = 844388420
	// FMT_DXT3 means DXT3 compression texture format.
	FMT_DXT3 = 861165636
	// FMT_DXT4 means DXT4 compression texture format.
	FMT_DXT4 = 877942852
	// FMT_DXT5 means DXT5 compression texture format.
	FMT_DXT5 = 894720068
	// FMT_D16_LOCKABLE means 16-bit z-buffer bit depth.
	FMT_D16_LOCKABLE = 70
	// FMT_D32 means 32-bit z-buffer bit depth.
	FMT_D32 = 71
	// FMT_D15S1 means 16-bit z-buffer bit depth where 15 bits are reserved for
	// the depth channel and 1 bit is reserved for the stencil channel.
	FMT_D15S1 = 73
	// FMT_D24S8 means 32-bit z-buffer bit depth using 24 bits for the depth
	// channel and 8 bits for the stencil channel.
	FMT_D24S8 = 75
	// FMT_D24X8 means 32-bit z-buffer bit depth using 24 bits for the depth
	// channel.
	FMT_D24X8 = 77
	// FMT_D24X4S4 means 32-bit z-buffer bit depth using 24 bits for the depth
	// channel and 4 bits for the stencil channel.
	FMT_D24X4S4 = 79
	// FMT_D16 means 16-bit z-buffer bit depth.
	FMT_D16 = 80
	// FMT_L16 means 16-bit luminance only.
	FMT_L16 = 81
	// FMT_D32F_LOCKABLE is a lockable format where the depth value is
	// represented as a standard IEEE floating-point number.
	FMT_D32F_LOCKABLE = 82
	// FMT_D24FS8 is a non-lockable format that contains 24 bits of depth (in a
	// 24-bit floating point format - 20e4) and 8 bits of stencil.
	FMT_D24FS8 = 83
	// FMT_VERTEXDATA describes a vertex buffer surface.
	FMT_VERTEXDATA = 100
	// FMT_INDEX16 means 16-bit index buffer bit depth.
	FMT_INDEX16 = 101
	// FMT_INDEX32 means 32-bit index buffer bit depth.
	FMT_INDEX32 = 102
	// FMT_Q16W16V16U16 means 64-bit bump-map format using 16 bits for each
	// component.
	FMT_Q16W16V16U16 = 110
	// FMT_MULTI2_ARGB8 means a multiElement texture (not compressed).
	FMT_MULTI2_ARGB8 = 827606349
	// FMT_R16F means 16-bit float format using 16 bits for the red channel.
	FMT_R16F = 111
	// FMT_G16R16F means 32-bit float format using 16 bits for the red channel
	// and 16 bits for the green channel.
	FMT_G16R16F = 112
	// FMT_A16B16G16R16F means 64-bit float format using 16 bits for the each
	// channel (alpha, blue, green, red).
	FMT_A16B16G16R16F = 113
	// FMT_R32F means 32-bit float format using 32 bits for the red channel.
	FMT_R32F = 114
	// FMT_G32R32F means 64-bit float format using 32 bits for the red channel
	// and 32 bits for the green channel.
	FMT_G32R32F = 115
	// FMT_A32B32G32R32F means 128-bit float format using 32 bits for the each
	// channel (alpha, blue, green, red).
	FMT_A32B32G32R32F = 116
	// FMT_CxV8U8 means 16-bit normal compression format. The texture sampler
	// computes the C channel from: C = sqrt(1 - U² - V²).
	FMT_CxV8U8 = 117
)
View Source
const (
	// LIGHT_POINT means the light is a point source. The light has a position
	// in space and radiates light in all directions.
	LIGHT_POINT = 1
	// LIGHT_SPOT means the light is a spotlight source. This light is like a
	// point light, except that the illumination is limited to a cone. This
	// light type has a direction and several other parameters that determine
	// the shape of the cone it produces.
	LIGHT_SPOT = 2
	// LIGHT_DIRECTIONAL means the light is a directional light source. This is
	// equivalent to using a point light source at an infinite distance.
	LIGHT_DIRECTIONAL = 3
)
View Source
const (
	// MCS_MATERIAL uses the color from the current material.
	MCS_MATERIAL = 0
	// MCS_COLOR1 uses the diffuse vertex color.
	MCS_COLOR1 = 1
	// MCS_COLOR2 uses the specular vertex color.
	MCS_COLOR2 = 2
)
View Source
const (
	// MULTISAMPLE_NONE means no level of full-scene multisampling is available.
	MULTISAMPLE_NONE = 0
	// MULTISAMPLE_NONMASKABLE enables the multisample quality value.
	MULTISAMPLE_NONMASKABLE = 1
	// MULTISAMPLE_2_SAMPLES means 2 levels of full-scene multisampling
	// available.
	MULTISAMPLE_2_SAMPLES = 2
	// MULTISAMPLE_3_SAMPLES means 3 levels of full-scene multisampling
	// available.
	MULTISAMPLE_3_SAMPLES = 3
	// MULTISAMPLE_4_SAMPLES means 4 levels of full-scene multisampling
	// available.
	MULTISAMPLE_4_SAMPLES = 4
	// MULTISAMPLE_5_SAMPLES means 5 levels of full-scene multisampling
	// available.
	MULTISAMPLE_5_SAMPLES = 5
	// MULTISAMPLE_6_SAMPLES means 6 levels of full-scene multisampling
	// available.
	MULTISAMPLE_6_SAMPLES = 6
	// MULTISAMPLE_7_SAMPLES means 7 levels of full-scene multisampling
	// available.
	MULTISAMPLE_7_SAMPLES = 7
	// MULTISAMPLE_8_SAMPLES means 8 levels of full-scene multisampling
	// available.
	MULTISAMPLE_8_SAMPLES = 8
	// MULTISAMPLE_9_SAMPLES means 9 levels of full-scene multisampling
	// available.
	MULTISAMPLE_9_SAMPLES = 9
	// MULTISAMPLE_10_SAMPLES means 10 levels of full-scene multisampling
	// available.
	MULTISAMPLE_10_SAMPLES = 10
	// MULTISAMPLE_11_SAMPLES means 11 levels of full-scene multisampling
	// available.
	MULTISAMPLE_11_SAMPLES = 11
	// MULTISAMPLE_12_SAMPLES means 12 levels of full-scene multisampling
	// available.
	MULTISAMPLE_12_SAMPLES = 12
	// MULTISAMPLE_13_SAMPLES means 13 levels of full-scene multisampling
	// available.
	MULTISAMPLE_13_SAMPLES = 13
	// MULTISAMPLE_14_SAMPLES means 14 levels of full-scene multisampling
	// available.
	MULTISAMPLE_14_SAMPLES = 14
	// MULTISAMPLE_15_SAMPLES means 15 levels of full-scene multisampling
	// available.
	MULTISAMPLE_15_SAMPLES = 15
	// MULTISAMPLE_16_SAMPLES means 16 levels of full-scene multisampling
	// available.
	MULTISAMPLE_16_SAMPLES = 16
)
View Source
const (
	// PATCHEDGE_DISCRETE means discrete edge style. In discrete mode, you can
	// specify float tessellation but it will be truncated to integers.
	PATCHEDGE_DISCRETE = 0
	// PATCHEDGE_CONTINUOUS means continuous edge style. In continuous mode,
	// tessellation is specified as float values that can be smoothly varied to
	// reduce "popping" artifacts.
	PATCHEDGE_CONTINUOUS = 1
)
View Source
const (
	// POOL_DEFAULT means resources are placed in the memory pool most
	// appropriate for the set of usages requested for the given resource. This
	// is usually video memory, including both local video memory and AGP
	// memory. The POOL_DEFAULT pool is separate from POOL_MANAGED and
	// POOL_SYSTEMMEM, and it specifies that the resource is placed in the
	// preferred memory for device access. Note that POOL_DEFAULT never
	// indicates that either POOL_MANAGED or POOL_SYSTEMMEM should be chosen as
	// the memory pool type for this resource. Textures placed in the
	// POOL_DEFAULT pool cannot be locked unless they are dynamic textures or
	// they are private, FOURCC, driver formats. To access unlockable textures,
	// you must use functions such as Device.UpdateSurface,
	// Device.UpdateTexture, Device.GetFrontBufferData, and
	// Device.GetRenderTargetData. POOL_MANAGED is probably a better choice
	// than POOL_DEFAULT for most applications. Note that some textures created
	// in driver-proprietary pixel formats, unknown to the Direct3D runtime,
	// can be locked. Also note that - unlike textures - swap chain back
	// buffers, render targets, vertex buffers, and index buffers can be
	// locked. When a device is lost, resources created using POOL_DEFAULT must
	// be released before calling Device.Reset.
	// When creating resources with POOL_DEFAULT, if video card memory is
	// already committed, managed resources will be evicted to free enough
	// memory to satisfy the request.
	POOL_DEFAULT = 0
	// POOL_MANAGED means resources are copied automatically to
	// device-accessible memory as needed. Managed resources are backed by
	// system memory and do not need to be recreated when a device is lost.
	// Managed resources can be locked. Only the system-memory copy is directly
	// modified. Direct3D copies your changes to driver-accessible memory as
	// needed.
	// Differences between Direct3D 9 and Direct3D 9Ex: POOL_MANAGED is valid
	// with Device; however, it is not valid with DeviceEx.
	POOL_MANAGED = 1
	// POOL_SYSTEMMEM means resources are placed in memory that is not
	// typically accessible by the Direct3D device. This memory allocation
	// consumes system RAM but does not reduce pageable RAM. These resources do
	// not need to be recreated when a device is lost. Resources in this pool
	// can be locked and can be used as the source for a Device.UpdateSurface
	// or Device.UpdateTexture operation to a memory resource created with
	// POOL_DEFAULT.
	POOL_SYSTEMMEM = 2
	// POOL_SCRATCH means resources are placed in system RAM and do not need to
	// be recreated when a device is lost. These resources are not bound by
	// device size or format restrictions. Because of this, these resources
	// cannot be accessed by the Direct3D device nor set as textures or render
	// targets. However, these resources can always be created, locked, and
	// copied.
	POOL_SCRATCH = 3
)
View Source
const (
	// PT_POINTLIST renders the vertices as a collection of isolated points.
	// This value is unsupported for indexed primitives.
	PT_POINTLIST = 1
	// PT_LINELIST renders the vertices as a list of isolated straight line
	// segments.
	PT_LINELIST = 2
	// PT_LINESTRIP renders the vertices as a single polyline.
	PT_LINESTRIP = 3
	// PT_TRIANGLELIST renders the specified vertices as a sequence of isolated
	// triangles. Each group of three vertices defines a separate triangle.
	// Back-face culling is affected by the current winding-order render state.
	PT_TRIANGLELIST = 4
	// PT_TRIANGLESTRIP renders the vertices as a triangle strip. The
	// backface-culling flag is automatically flipped on even-numbered
	// triangles.
	PT_TRIANGLESTRIP = 5
	// PT_TRIANGLEFAN renders the vertices as a triangle fan.
	PT_TRIANGLEFAN = 6
)
View Source
const (
	// QUERYTYPE_VCACHE queries for driver hints about data layout for vertex
	// caching.
	QUERYTYPE_VCACHE = 4
	// QUERYTYPE_RESOURCEMANAGER queryies the resource manager. For this query,
	// the device behavior flags must include CREATE_DISABLE_DRIVER_MANAGEMENT.
	QUERYTYPE_RESOURCEMANAGER = 5
	// QUERYTYPE_VERTEXSTATS queries vertex statistics.
	QUERYTYPE_VERTEXSTATS = 6
	// QUERYTYPE_EVENT queries for any and all asynchronous events that have
	// been issued from API calls.
	QUERYTYPE_EVENT = 8
	// QUERYTYPE_OCCLUSION returns the number of pixels that pass z-testing.
	// These pixels are for primitives drawn between the issue of ISSUE_BEGIN
	// and ISSUE_END. This enables an application to check the occlusion result
	// against 0. Zero is fully occluded, which means the pixels are not
	// visible from the current camera position.
	QUERYTYPE_OCCLUSION = 9
	// QUERYTYPE_TIMESTAMP returns a 64-bit timestamp.
	QUERYTYPE_TIMESTAMP = 10
	// QUERYTYPE_TIMESTAMPDISJOINT notifies an application if the counter
	// frequency has changed from the QUERYTYPE_TIMESTAMP.
	QUERYTYPE_TIMESTAMPDISJOINT = 11
	// QUERYTYPE_TIMESTAMPFREQ results in true if the values from
	// QUERYTYPE_TIMESTAMP queries cannot be guaranteed to be continuous
	// throughout the duration of the QUERYTYPE_TIMESTAMPDISJOINT query.
	// Otherwise, the query result is false.
	QUERYTYPE_TIMESTAMPFREQ = 12
	// QUERYTYPE_PIPELINETIMINGS returns percent of time processing pipeline
	// data.
	QUERYTYPE_PIPELINETIMINGS = 13
	// QUERYTYPE_INTERFACETIMINGS returns percent of time processing data in
	// the driver.
	QUERYTYPE_INTERFACETIMINGS = 14
	// QUERYTYPE_VERTEXTIMINGS returns percent of time processing vertex shader
	// data.
	QUERYTYPE_VERTEXTIMINGS = 15
	// QUERYTYPE_PIXELTIMINGS returns percent of time processing pixel shader
	// data.
	QUERYTYPE_PIXELTIMINGS = 16
	// QUERYTYPE_BANDWIDTHTIMINGS is for throughput measurement comparisons for
	// help in understanding the performance of an application.
	QUERYTYPE_BANDWIDTHTIMINGS = 17
	// QUERYTYPE_CACHEUTILIZATION measures the cache hit-rate performance for
	// textures and indexed vertices.
	QUERYTYPE_CACHEUTILIZATION = 18
)
View Source
const (
	// RS_ZENABLE is the depth-buffering state as one member of the ZBUFFERTYPE
	// enumerated type. Set this state to ZB_TRUE to enable z-buffering,
	// ZB_USEW to enable w-buffering, or ZB_FALSE to disable depth buffering.
	// The default value for this render state is ZB_TRUE if a depth stencil
	// was created along with the swap chain by setting the
	// EnableAutoDepthStencil member of the PRESENT_PARAMETERS structure to
	// true, and ZB_FALSE otherwise.
	RS_ZENABLE = 7
	// RS_FILLMODE expects one or more members of the D3DFILLMODE enumerated
	// type. The default value is D3DFILL_SOLID.
	RS_FILLMODE = 8
	// RS_SHADEMODE expects one or more members of the D3DSHADEMODE enumerated
	// type. The default value is D3DSHADE_GOURAUD.
	RS_SHADEMODE = 9
	// RS_ZWRITEENABLE can be set to true to enable the application to write to
	// the depth buffer. The default value is true. This member enables an
	// application to prevent the system from updating the depth buffer with
	// new depth values. If false, depth comparisons are still made according
	// to the render state RS_ZFUNC, assuming that depth buffering is taking
	// place, but depth values are not written to the buffer.
	RS_ZWRITEENABLE = 14
	// RS_ALPHATESTENABLE can be set to true to enable per pixel alpha testing.
	// If the test passes, the pixel is processed by the frame buffer.
	// Otherwise, all frame-buffer processing is skipped for the pixel.
	// The test is done by comparing the incoming alpha value with the
	// reference alpha value, using the comparison function provided by the
	// RS_ALPHAFUNC render state. The reference alpha value is determined by
	// the value set for RS_ALPHAREF.
	// The default value of this parameter is false.
	RS_ALPHATESTENABLE = 15
	// RS_LASTPIXEL is true by default, which enables drawing of the last pixel
	// in a line. To prevent drawing of the last pixel, set this value to false.
	RS_LASTPIXEL = 16
	// RS_SRCBLEND expectes one member of the BLEND enumerated type. The
	// default value is BLEND_ONE.
	RS_SRCBLEND = 19
	// RS_DESTBLEND expectes one member of the BLEND enumerated type. The
	// default value is BLEND_ZERO.
	RS_DESTBLEND = 20
	// RS_CULLMODE specifies how back-facing triangles are culled, if at all.
	// This can be set to one member of the CULL enumerated type. The default
	// value is CULL_CCW.
	RS_CULLMODE = 22
	// RS_ZFUNC expectes one member of the CMPFUNC enumerated type. The default
	// value is CMP_LESSEQUAL. This member enables an application to accept or
	// reject a pixel, based on its distance from the camera.
	// The depth value of the pixel is compared with the depth-buffer value. If
	// the depth value of the pixel passes the comparison function, the pixel
	// is written.
	// The depth value is written to the depth buffer only if the render state
	// is true.
	// Software rasterizers and many hardware accelerators work faster if the
	// depth test fails, because there is no need to filter and modulate the
	// texture if the pixel is not going to be rendered.
	RS_ZFUNC = 23
	// RS_ALPHAREF expectes a value that specifies a reference alpha value
	// against which pixels are tested when alpha testing is enabled. This is
	// an 8-bit value placed in the low 8 bits of the render-state value.
	// Values can range from 0x00000000 through 0x000000FF. The default value
	// is 0.
	RS_ALPHAREF = 24
	// RS_ALPHAFUNC expectes one member of the CMPFUNC enumerated type. The
	// default value is CMP_ALWAYS. This member enables an application to
	// accept or reject a pixel, based on its alpha value.
	RS_ALPHAFUNC = 25
	// RS_DITHERENABLE can be set to true to enable dithering. The default
	// value is false.
	RS_DITHERENABLE = 26
	// RS_ALPHABLENDENABLE can be set to true to enable alpha-blended
	// transparency. The default value is false.
	// The type of alpha blending is determined by the RS_SRCBLEND and
	// RS_DESTBLEND render states.
	RS_ALPHABLENDENABLE = 27
	// RS_FOGENABLE can be set to true to enable fog blending. The default
	// value is false.
	RS_FOGENABLE = 28
	// RS_SPECULARENABLE can be set to true to enable specular highlights. The
	// default value is false.
	// Specular highlights are calculated as though every vertex in the object
	// being lit is at the object's origin. This gives the expected results as
	// long as the object is modeled around the origin and the distance from
	// the light to the object is relatively large. In other cases, the results
	// as undefined.
	// When this member is set to true, the specular color is added to the base
	// color after the texture cascade but before alpha blending.
	RS_SPECULARENABLE = 29
	// RS_FOGCOLOR expectes a value whose type is COLOR. The default value is 0.
	RS_FOGCOLOR = 34
	// RS_FOGTABLEMODE is the fog formula to be used for pixel fog. Set to one
	// of the members of the FOGMODE enumerated type. The default value is
	// FOG_NONE.
	RS_FOGTABLEMODE = 35
	// RS_FOGSTART is the depth at which pixel or vertex fog effects begin for
	// linear fog mode. The default value is 0.0f. Depth is specified in world
	// space for vertex fog and either device space [0.0, 1.0] or world space
	// for pixel fog. For pixel fog, these values are in device space when the
	// system uses z for fog calculations and world-world space when the system
	// is using eye-relative fog (w-fog).
	// Use Device.SetRenderStateFloat to set this value.
	RS_FOGSTART = 36
	// RS_FOGEND is the depth at which pixel or vertex fog effects end for
	// linear fog mode. The default value is 1.0f. Depth is specified in world
	// space for vertex fog and either device space [0.0, 1.0] or world space
	// for pixel fog. For pixel fog, these values are in device space when the
	// system uses z for fog calculations and in world space when the system is
	// using eye-relative fog (w-fog).
	// Use Device.SetRenderStateFloat to set this value.
	RS_FOGEND = 37
	// RS_FOGDENSITY is the fog density for pixel or vertex fog used in the
	// exponential fog modes FOG_EXP and FOG_EXP2). Valid density values range
	// from 0.0 through 1.0. The default value is 1.0.
	// Use Device.SetRenderStateFloat to set this value.
	RS_FOGDENSITY = 38
	// RS_RANGEFOGENABLE can be set to true to enable range-based vertex fog.
	// The default value is false, in which case the system uses depth-based
	// fog. In range-based fog, the distance of an object from the viewer is
	// used to compute fog effects, not the depth of the object (that is, the
	// z-coordinate) in the scene. In range-based fog, all fog methods work as
	// usual, except that they use range instead of depth in the computations.
	// Range is the correct factor to use for fog computations, but depth is
	// commonly used instead because range is time-consuming to compute and
	// depth is generally already available. Using depth to calculate fog has
	// the undesirable effect of having the fogginess of peripheral objects
	// change as the viewer's eye moves - in this case, the depth changes and
	// the range remains constant.
	// Because no hardware currently supports per-pixel range-based fog, range
	// correction is offered only for vertex fog.
	// Use Device.SetRenderStateBool to set this value.
	RS_RANGEFOGENABLE = 48
	// RS_STENCILENABLE can be set to true to enable stenciling, or false to
	// disable stenciling. The default value is false.
	// Use Device.SetRenderStateBool to set this value.
	RS_STENCILENABLE = 52
	// RS_STENCILFAIL is the stencil operation to perform if the stencil test
	// fails. Values are from the STENCILOP enumerated type. The default value
	// is STENCILOP_KEEP.
	RS_STENCILFAIL = 53
	// RS_STENCILZFAIL is the stencil operation to perform if the stencil test
	// passes and the depth test (z-test) fails. Values are from the STENCILOP
	// enumerated type. The default value is STENCILOP_KEEP.
	RS_STENCILZFAIL = 54
	// RS_STENCILPASS is the stencil operation to perform if both the stencil
	// and the depth (z) tests pass. Values are from the STENCILOP enumerated
	// type. The default value is STENCILOP_KEEP.
	RS_STENCILPASS = 55
	// RS_STENCILFUNC is the comparison function for the stencil test. Values
	// are from the CMPFUNC enumerated type. The default value is CMP_ALWAYS.
	// The comparison function is used to compare the reference value to a
	// stencil buffer entry. This comparison applies only to the bits in the
	// reference value and stencil buffer entry that are set in the stencil
	// mask (set by the RS_STENCILMASK render state). If true, the stencil test
	// passes.
	RS_STENCILFUNC = 56
	// RS_STENCILREF is an int reference value for the stencil test. The
	// default value is 0.
	RS_STENCILREF = 57
	// RS_STENCILMASK is the mask applied to the reference value and each
	// stencil buffer entry to determine the significant bits for the stencil
	// test. The default mask is 0xFFFFFFFF.
	RS_STENCILMASK = 58
	// RS_STENCILWRITEMASK is the write mask applied to values written into the
	// stencil buffer. The default mask is 0xFFFFFFFF.
	RS_STENCILWRITEMASK = 59
	// RS_TEXTUREFACTOR is the color used for multiple-texture blending with
	// the TA_TFACTOR texture-blending argument or the TOP_BLENDFACTORALPHA
	// texture-blending operation. The associated value is a COLOR variable.
	// The default value is opaque white (0xFFFFFFFF).
	RS_TEXTUREFACTOR = 60
	// RS_WRAP0 is the texture-wrapping behavior for multiple sets of texture
	// coordinates. Valid values for this render state can be any combination
	// of the WRAPCOORD_0 (or WRAP_U), WRAPCOORD_1 (or WRAP_V), WRAPCOORD_2 (or
	// WRAP_W), and WRAPCOORD_3 flags. These cause the system to wrap in the
	// direction of the first, second, third, and fourth dimensions, sometimes
	// referred to as the s, t, r, and q directions, for a given texture. The
	// default value for this render state is 0 (wrapping disabled in all
	// directions).
	RS_WRAP0 = 128
	// RS_WRAP1 see RS_WRAP0.
	RS_WRAP1 = 129
	// RS_WRAP2 see RS_WRAP0.
	RS_WRAP2 = 130
	// RS_WRAP3 see RS_WRAP0.
	RS_WRAP3 = 131
	// RS_WRAP4 see RS_WRAP0.
	RS_WRAP4 = 132
	// RS_WRAP5 see RS_WRAP0.
	RS_WRAP5 = 133
	// RS_WRAP6 see RS_WRAP0.
	RS_WRAP6 = 134
	// RS_WRAP7 see RS_WRAP0.
	RS_WRAP7 = 135
	// RS_CLIPPING can be set to true to enable primitive clipping by Direct3D,
	// or false to disable it. The default value is true.
	// Use Device.SetRenderStateBool to set this value.
	RS_CLIPPING = 136
	// RS_LIGHTING can be set to true to enable Direct3D lighting, or false to
	// disable it. The default value is true. Only vertices that include a
	// vertex normal are properly lit; vertices that do not contain a normal
	// employ a dot product of 0 in all lighting calculations.
	// Use Device.SetRenderStateBool to set this value.
	RS_LIGHTING = 137
	// RS_AMBIENT is the ambient light color. This value is of type COLOR. The
	// default value is 0.
	RS_AMBIENT = 139
	// RS_FOGVERTEXMODE is the fog formula to be used for vertex fog. Set to
	// one member of the FOGMODE enumerated type. The default value is FOG_NONE.
	RS_FOGVERTEXMODE = 140
	// RS_COLORVERTEX can be set to true to enable per-vertex color or false to
	// disable it. The default value is true. Enabling per-vertex color allows
	// the system to include the color defined for individual vertices in its
	// lighting calculations.
	// For more information, see the following render states:
	// RS_DIFFUSEMATERIALSOURCE, RS_SPECULARMATERIALSOURCE,
	// RS_AMBIENTMATERIALSOURCE, RS_EMISSIVEMATERIALSOURCE.
	// Use Device.SetRenderStateBool to set this value.
	RS_COLORVERTEX = 141
	// RS_LOCALVIEWER can be set to true to enable camera-relative specular
	// highlights, or false to use orthogonal specular highlights. The default
	// value is true. Applications that use orthogonal projection should
	// specify false.
	// Use Device.SetRenderStateBool to set this value.
	RS_LOCALVIEWER = 142
	// RS_NORMALIZENORMALS can be set to true to enable automatic normalization
	// of vertex normals, or false to disable it. The default value is false.
	// Enabling this feature causes the system to normalize the vertex normals
	// for vertices after transforming them to camera space, which can be
	// computationally time-consuming.
	// Use Device.SetRenderStateBool to set this value.
	RS_NORMALIZENORMALS = 143
	// RS_DIFFUSEMATERIALSOURCE is the diffuse color source for lighting
	// calculations. Valid values are members of the MATERIALCOLORSOURCE
	// enumerated type. The default value is MCS_COLOR1. The value for this
	// render state is used only if the RS_COLORVERTEX render state is set to
	// true.
	RS_DIFFUSEMATERIALSOURCE = 145
	// RS_SPECULARMATERIALSOURCE is the specular color source for lighting
	// calculations. Valid values are members of the MATERIALCOLORSOURCE
	// enumerated type. The default value is MCS_COLOR2.
	RS_SPECULARMATERIALSOURCE = 146
	// RS_AMBIENTMATERIALSOURCE is the ambient color source for lighting
	// calculations. Valid values are members of the MATERIALCOLORSOURCE
	// enumerated type. The default value is MCS_MATERIAL.
	RS_AMBIENTMATERIALSOURCE = 147
	// RS_EMISSIVEMATERIALSOURCE is the emissive color source for lighting
	// calculations. Valid values are members of the MATERIALCOLORSOURCE
	// enumerated type. The default value is MCS_MATERIAL.
	RS_EMISSIVEMATERIALSOURCE = 148
	// RS_VERTEXBLEND is the number of matrices to use to perform geometry
	// blending, if any. Valid values are members of the VERTEXBLENDFLAGS
	// enumerated type. The default value is VBF_DISABLE.
	RS_VERTEXBLEND = 151
	// RS_CLIPPLANEENABLE enables or disables user-defined clipping planes.
	// Valid values are any uint32 in which the status of each bit (set or not
	// set) toggles the activation state of a corresponding user-defined
	// clipping plane. The least significant bit (bit 0) controls the first
	// clipping plane at index 0, and subsequent bits control the activation of
	// clipping planes at higher indexes. If a bit is set, the system applies
	// the appropriate clipping plane during scene rendering. The default value
	// is 0.
	// The CLIPPLANEn macros are defined to provide a convenient way to enable
	// clipping planes.
	RS_CLIPPLANEENABLE = 152
	// RS_POINTSIZE is a float value that specifies the size to use for point
	// size computation in cases where point size is not specified for each
	// vertex. This value is not used when the vertex contains point size. This
	// value is in screen space units if RS_POINTSCALEENABLE is false;
	// otherwise this value is in world space units. The default value is the
	// value a driver returns. If a driver returns 0 or 1, the default value is
	// 64, which allows software point size emulation.
	// Use Device.SetRenderStateFloat to set this value.
	RS_POINTSIZE = 154
	// RS_POINTSIZE_MIN is a float value that specifies the minimum size of
	// point primitives. Point primitives are clamped to this size during
	// rendering. Setting this to values smaller than 1.0 results in points
	// dropping out when the point does not cover a pixel center and
	// antialiasing is disabled or being rendered with reduced intensity when
	// antialiasing is enabled. The default value is 1.0f. The range for this
	// value is greater than or equal to 0.0f.
	// Use Device.SetRenderStateFloat to set this value.
	RS_POINTSIZE_MIN = 155
	// RS_POINTSPRITEENABLE is a bool value. When true, texture coordinates of
	// point primitives are set so that full textures are mapped on each point.
	// When false, the vertex texture coordinates are used for the entire
	// point. The default value is false. You can achieve DirectX 7 style
	// single-pixel points by setting RS_POINTSCALEENABLE to false and
	// RS_POINTSIZE to 1.0, which are the default values.
	// Use Device.SetRenderStateBool to set this value.
	RS_POINTSPRITEENABLE = 156
	// RS_POINTSCALEENABLE is a bool value that controls computation of size
	// for point primitives. When true, the point size is interpreted as a
	// camera space value and is scaled by the distance function and the
	// frustum to viewport y-axis scaling to compute the final screen-space
	// point size. When false, the point size is interpreted as screen space
	// and used directly. The default value is false.
	// Use Device.SetRenderStateBool to set this value.
	RS_POINTSCALEENABLE = 157
	// RS_POINTSCALE_A is a float value that controls for distance-based size
	// attenuation for point primitives. Active only when RS_POINTSCALEENABLE
	// is true. The default value is 1.0f. The range for this value is greater
	// than or equal to 0.0f.
	// Use Device.SetRenderStateFloat to set this value.
	RS_POINTSCALE_A = 158
	// RS_POINTSCALE_B is a float value that controls for distance-based size
	// attenuation for point primitives. Active only when RS_POINTSCALEENABLE
	// is true. The default value is 0.0f. The range for this value is greater
	// than or equal to 0.0f.
	// Use Device.SetRenderStateFloat to set this value.
	RS_POINTSCALE_B = 159
	// RS_POINTSCALE_C is a float value that controls for distance-based size
	// attenuation for point primitives. Active only when RS_POINTSCALEENABLE
	// is true. The default value is 0.0f. The range for this value is greater
	// than or equal to 0.0f.
	// Use Device.SetRenderStateFloat to set this value.
	RS_POINTSCALE_C = 160
	// RS_MULTISAMPLEANTIALIAS is a bool value that determines how individual
	// samples are computed when using a multisample render-target buffer. When
	// set to true, the multiple samples are computed so that full-scene
	// antialiasing is performed by sampling at different sample positions for
	// each multiple sample. When set to false, the multiple samples are all
	// written with the same sample value, sampled at the pixel center, which
	// allows non-antialiased rendering to a multisample buffer. This render
	// state has no effect when rendering to a single sample buffer. The
	// default value is true.
	// Use Device.SetRenderStateBool to set this value.
	RS_MULTISAMPLEANTIALIAS = 161
	// RS_MULTISAMPLEMASK is a uint32 mask. Each bit in this mask, starting at
	// the least significant bit (LSB), controls modification of one of the
	// samples in a multisample render target. Thus, for an 8-sample render
	// target, the low byte contains the eight write enables for each of the
	// eight samples. This render state has no effect when rendering to a
	// single sample buffer. The default value is 0xFFFFFFFF.
	// This render state enables use of a multisample buffer as an accumulation
	// buffer, doing multipass rendering of geometry where each pass updates a
	// subset of samples.
	// If there are n multisamples and k enabled samples, the resulting
	// intensity of the rendered image should be k/n. Each component RGB of
	// every pixel is factored by k/n.
	RS_MULTISAMPLEMASK = 162
	// RS_PATCHEDGESTYLE sets whether patch edges will use float style
	// tessellation. Possible values are defined by the PATCHEDGESTYLE
	// enumerated type. The default value is PATCHEDGE_DISCRETE.
	RS_PATCHEDGESTYLE = 163
	// RS_DEBUGMONITORTOKEN is set only for debugging the monitor. Possible
	// values are defined by the DEBUGMONITORTOKENS enumerated type. Note that
	// if RS_DEBUGMONITORTOKEN is set, the call is treated as passing a token
	// to the debug monitor. For example, if - after passing DMT_ENABLE or
	// DMT_DISABLE to RS_DEBUGMONITORTOKEN - other token values are passed in,
	// the state (enabled or disabled) of the debug monitor will still persist.
	// This state is only useful for debug builds. The debug monitor defaults
	// to DMT_ENABLE.
	RS_DEBUGMONITORTOKEN = 165
	// RS_POINTSIZE_MAX is a float value that specifies the maximum size to
	// which point sprites will be clamped. The value must be less than or
	// equal to the MaxPointSize member of CAPS and greater than or equal to
	// RS_POINTSIZE_MIN. The default value is 64.0.
	// Use Device.SetRenderStateFloat to set this value.
	RS_POINTSIZE_MAX = 166
	// RS_INDEXEDVERTEXBLENDENABLE is a bool value that enables or disables
	// indexed vertex blending. The default value is false. When set to true,
	// indexed vertex blending is enabled. When set to false, indexed vertex
	// blending is disabled. If this render state is enabled, the user must
	// pass matrix indices as a packed DWORDwith every vertex. When the render
	// state is disabled and vertex blending is enabled through the
	// RS_VERTEXBLEND state, it is equivalent to having matrix indices 0, 1, 2,
	// 3 in every vertex.
	// Use Device.SetRenderStateBool to set this value.
	RS_INDEXEDVERTEXBLENDENABLE = 167
	// RS_COLORWRITEENABLE is a uint32 value that enables a per-channel write
	// for the render-target color buffer. A set bit results in the color
	// channel being updated during 3D rendering. A clear bit results in the
	// color channel being unaffected. This functionality is available if the
	// PMISCCAPS_COLORWRITEENABLE capabilities bit is set in the
	// PrimitiveMiscCaps member of the CAPS structure for the device. This
	// render state does not affect the clear operation. The default value is
	// 0x0000000F.
	// Valid values for this render state can be any combination of the
	// COLORWRITEENABLE_ALPHA, COLORWRITEENABLE_BLUE, COLORWRITEENABLE_GREEN,
	// or COLORWRITEENABLE_RED flags.
	RS_COLORWRITEENABLE = 168
	// RS_TWEENFACTOR is a float value that controls the tween factor. The
	// default value is 0.0f.
	// Use Device.SetRenderStateFloat to set this value.
	RS_TWEENFACTOR = 170
	// RS_BLENDOP is used to select the arithmetic operation applied when the
	// alpha blending render state, RS_ALPHABLENDENABLE, is set to true. Valid
	// values are defined by the BLENDOP enumerated type. The default value is
	// BLENDOP_ADD.
	// If the PMISCCAPS_BLENDOP device capability is not supported, then
	// BLENDOP_ADD is performed.
	RS_BLENDOP = 171
	// RS_POSITIONDEGREE is the N-patch position interpolation degree. The
	// values can be DEGREE_CUBIC (default) or DEGREE_LINEAR. For more
	// information, see DEGREETYPE.
	RS_POSITIONDEGREE = 172
	// RS_NORMALDEGREE is the N-patch normal interpolation degree. The values
	// can be DEGREE_LINEAR (default) or DEGREE_QUADRATIC. For more
	// information, see DEGREETYPE.
	RS_NORMALDEGREE = 173
	// RS_SCISSORTESTENABLE can be set to true to enable scissor testing and
	// false to disable it. The default value is false.
	RS_SCISSORTESTENABLE = 174
	// RS_SLOPESCALEDEPTHBIAS is used to determine how much bias can be applied
	// to co-planar primitives to reduce z-fighting. The default value is 0.
	// bias = (max * RS_SLOPESCALEDEPTHBIAS) + RS_DEPTHBIAS.
	// where max is the maximum depth slope of the triangle being rendered.
	RS_SLOPESCALEDEPTHBIAS = 175
	// RS_ANTIALIASEDLINEENABLE can be set to true to enable line antialiasing,
	// false to disable line antialiasing. The default value is false.
	// When rendering to a multisample render target, RS_ANTIALIASEDLINEENABLE
	// is ignored and all lines are rendered aliased.
	RS_ANTIALIASEDLINEENABLE = 176
	// RS_MINTESSELLATIONLEVEL is the minimum tessellation level. The default
	// value is 1.0f.
	RS_MINTESSELLATIONLEVEL = 178
	// RS_MAXTESSELLATIONLEVEL is the maximum tessellation level. The default
	// value is 1.0f.
	RS_MAXTESSELLATIONLEVEL = 179
	// RS_ADAPTIVETESS_X is the amount to adaptively tessellate, in the x
	// direction. Default value is 0.0f.
	RS_ADAPTIVETESS_X = 180
	// RS_ADAPTIVETESS_Y is the amount to adaptively tessellate, in the y
	// direction. Default value is 0.0f.
	RS_ADAPTIVETESS_Y = 181
	// RS_ADAPTIVETESS_Z is the amount to adaptively tessellate, in the z
	// direction. Default value is 1.0f.
	RS_ADAPTIVETESS_Z = 182
	// RS_ADAPTIVETESS_W is the amount to adaptively tessellate, in the w
	// direction. Default value is 0.0f.
	RS_ADAPTIVETESS_W = 183
	// RS_ENABLEADAPTIVETESSELLATION can be set to true to enable adaptive
	// tessellation, false to disable it. The default value is false.
	RS_ENABLEADAPTIVETESSELLATION = 184
	// RS_TWOSIDEDSTENCILMODE can be set to true to enable two-sided
	// stenciling, false disables it. The default value is false. The
	// application should set RS_CULLMODE to CULL_NONE to enable two-sided
	// stencil mode. If the triangle winding order is clockwise, the
	// RS_STENCIL* operations will be used. If the winding order is
	// counterclockwise, the RS_CCW_STENCIL* operations will be used.
	// To see if two-sided stencil is supported, check the StencilCaps member
	// of CAPS for STENCILCAPS_TWOSIDED. See also STENCILCAPS.
	RS_TWOSIDEDSTENCILMODE = 185
	// RS_CCW_STENCILFAIL is the stencil operation to perform if CCW stencil
	// test fails. Values are from the STENCILOP enumerated type. The default
	// value is STENCILOP_KEEP.
	RS_CCW_STENCILFAIL = 186
	// RS_CCW_STENCILZFAIL is the stencil operation to perform if CCW stencil
	// test passes and z-test fails. Values are from the STENCILOP enumerated
	// type. The default value is STENCILOP_KEEP.
	RS_CCW_STENCILZFAIL = 187
	// RS_CCW_STENCILPASS is the stencil operation to perform if both CCW
	// stencil and z-tests pass. Values are from the STENCILOP enumerated type.
	// The default value is STENCILOP_KEEP.
	RS_CCW_STENCILPASS = 188
	// RS_CCW_STENCILFUNC is the comparison function. CCW stencil test passes
	// if ((ref & mask) stencil function (stencil & mask)) is true. Values are
	// from the CMPFUNC enumerated type. The default value is CMP_ALWAYS.
	RS_CCW_STENCILFUNC = 189
	// RS_COLORWRITEENABLE1 specifies additional ColorWriteEnable values for
	// the devices. See RS_COLORWRITEENABLE. This functionality is available if
	// the PMISCCAPS_INDEPENDENTWRITEMASKS capabilities bit is set in the
	// PrimitiveMiscCaps member of the CAPS structure for the device. The
	// default value is 0x0000000F.
	RS_COLORWRITEENABLE1 = 190
	// RS_COLORWRITEENABLE2 specifies additional ColorWriteEnable values for
	// the devices. See RS_COLORWRITEENABLE. This functionality is available if
	// the PMISCCAPS_INDEPENDENTWRITEMASKS capabilities bit is set in the
	// PrimitiveMiscCaps member of the CAPS structure for the device. The
	// default value is 0x0000000F.
	RS_COLORWRITEENABLE2 = 191
	// RS_COLORWRITEENABLE3 Additional ColorWriteEnable values for the devices.
	// See RS_COLORWRITEENABLE. This functionality is available if the
	// PMISCCAPS_INDEPENDENTWRITEMASKS capabilities bit is set in the
	// PrimitiveMiscCaps member of the CAPS structure for the device. The
	// default value is 0x0000000F.
	RS_COLORWRITEENABLE3 = 192
	// RS_BLENDFACTOR is a COLOR used for a constant blend-factor during alpha
	// blending. This functionality is available if the PBLENDCAPS_BLENDFACTOR
	// capabilities bit is set in the SrcBlendCaps member of CAPS or the
	// DestBlendCaps member of CAPS. See RENDERSTATETYPE. The default value is
	// 0xFFFFFFFF.
	RS_BLENDFACTOR = 193
	// RS_SRGBWRITEENABLE enables render-target writes to be gamma corrected to
	// sRGB. The format must expose USAGE_SRGBWRITE. The default value is 0.
	RS_SRGBWRITEENABLE = 194
	// RS_DEPTHBIAS is a floating-point value that is used for comparison of
	// depth values. The default value is 0.
	// Use Device.SetRenderStateFloat to set this value.
	RS_DEPTHBIAS = 195
	// RS_WRAP8 see RS_WRAP0.
	RS_WRAP8 = 198
	// RS_WRAP9 see RS_WRAP0.
	RS_WRAP9 = 199
	// RS_WRAP10 see RS_WRAP0.
	RS_WRAP10 = 200
	// RS_WRAP11 see RS_WRAP0.
	RS_WRAP11 = 201
	// RS_WRAP12 see RS_WRAP0.
	RS_WRAP12 = 202
	// RS_WRAP13 see RS_WRAP0.
	RS_WRAP13 = 203
	// RS_WRAP14 see RS_WRAP0.
	RS_WRAP14 = 204
	// RS_WRAP15 see RS_WRAP0.
	RS_WRAP15 = 205
	// RS_SEPARATEALPHABLENDENABLE can be set to true to enable the separate
	// blend mode for the alpha channel. The default value is false.
	// When set to false, the render-target blending factors and operations
	// applied to alpha are forced to be the same as those defined for color.
	// This mode is effectively hardwired to false on implementations that
	// don't set the cap PMISCCAPS_SEPARATEALPHABLEND. See PMISCCAPS.
	// The type of separate alpha blending is determined by the
	// RS_SRCBLENDALPHA and RS_DESTBLENDALPHA render states.
	RS_SEPARATEALPHABLENDENABLE = 206
	// RS_SRCBLENDALPHA is one member of the BLEND enumerated type. This value
	// is ignored unless RS_SEPARATEALPHABLENDENABLE is true. The default value
	// is BLEND_ONE.
	RS_SRCBLENDALPHA = 207
	// RS_DESTBLENDALPHA is one member of the BLEND enumerated type. This value
	// is ignored unless RS_SEPARATEALPHABLENDENABLE is true. The default value
	// is BLEND_ZERO.
	RS_DESTBLENDALPHA = 208
	// RS_BLENDOPALPHA is a value used to select the arithmetic operation
	// applied to separate alpha blending when the render state,
	// RS_SEPARATEALPHABLENDENABLE, is set to true.
	// Valid values are defined by the BLENDOP enumerated type. The default
	// value is BLENDOP_ADD.
	// If the PMISCCAPS_BLENDOP device capability is not supported, then
	// BLENDOP_ADD is performed. See PMISCCAPS.
	RS_BLENDOPALPHA = 209
)
View Source
const (
	// RTYPE_SURFACE is a surface resource.
	RTYPE_SURFACE = 1
	// RTYPE_VOLUME is a volume resource.
	RTYPE_VOLUME = 2
	// RTYPE_TEXTURE is a texture resource.
	RTYPE_TEXTURE = 3
	// RTYPE_VOLUMETEXTURE is a volume texture resource.
	RTYPE_VOLUMETEXTURE = 4
	// RTYPE_CUBETEXTURE is a cube texture resource.
	RTYPE_CUBETEXTURE = 5
	// RTYPE_VERTEXBUFFER is a vertex buffer resource.
	RTYPE_VERTEXBUFFER = 6
	// RTYPE_INDEXBUFFER is an index buffer resource.
	RTYPE_INDEXBUFFER = 7
)
View Source
const (
	// STT_UNKNOWN is an uninitialized value. The value of this element is
	// SP_TEXTURETYPE_SHIFT.
	STT_UNKNOWN = 0
	// STT_2D declars a 2D texture. The value of this element is
	// SP_TEXTURETYPE_SHIFT * 4.
	STT_2D = 268435456
	// STT_CUBE declars a cube texture. The value of this element is
	// SP_TEXTURETYPE_SHIFT * 8.
	STT_CUBE = 402653184
	// STT_VOLUME declars a volume texture. The value of this element is
	// SP_TEXTURETYPE_SHIFT * 16.
	STT_VOLUME = 536870912
)
View Source
const (
	// SAMP_ADDRESSU specifies the texture-address mode for the u coordinate.
	// The default is TADDRESS_WRAP. For more information, see TEXTUREADDRESS.
	SAMP_ADDRESSU = 1
	// SAMP_ADDRESSV specifies the texture-address mode for the v coordinate.
	// The default is TADDRESS_WRAP. For more information, see TEXTUREADDRESS.
	SAMP_ADDRESSV = 2
	// SAMP_ADDRESSW specifies the texture-address mode for the w coordinate.
	// The default is TADDRESS_WRAP. For more information, see TEXTUREADDRESS.
	SAMP_ADDRESSW = 3
	// SAMP_BORDERCOLOR specifies the border color or type COLOR. The default
	// color is 0x00000000.
	SAMP_BORDERCOLOR = 4
	// SAMP_MAGFILTER specifies the magnification filter of type
	// TEXTUREFILTERTYPE. The default value is TEXF_POINT.
	SAMP_MAGFILTER = 5
	// SAMP_MINFILTER specifies the minification filter of type
	// TEXTUREFILTERTYPE. The default value is TEXF_POINT.
	SAMP_MINFILTER = 6
	// SAMP_MIPFILTER specifies the mipmap filter to use during minification.
	// See TEXTUREFILTERTYPE. The default value is TEXF_NONE.
	SAMP_MIPFILTER = 7
	// SAMP_MIPMAPLODBIAS specifies the mipmap level-of-detail bias. The
	// default value is zero.
	SAMP_MIPMAPLODBIAS = 8
	// SAMP_MAXMIPLEVEL specifies the level-of-detail index of the largest map
	// to use. Values range from 0 to (n - 1) where 0 is the largest. The
	// default value is zero.
	SAMP_MAXMIPLEVEL = 9
	// SAMP_MAXANISOTROPY specifies the maximum anisotropy. Values range from 1
	// to the value that is specified in the MaxAnisotropy member of the CAPS
	// structure. The default value is 1.
	SAMP_MAXANISOTROPY = 10
	// SAMP_SRGBTEXTURE specifies the gamma correction value. The default value
	// is 0, which means gamma is 1.0 and no correction is required. Otherwise,
	// this value means that the sampler should assume gamma of 2.2 on the
	// content and convert it to linear (gamma 1.0) before presenting it to the
	// pixel shader.
	SAMP_SRGBTEXTURE = 11
	// SAMP_ELEMENTINDEX indicates which element index to use, when a
	// multielement texture is assigned to the sampler. The default value is 0.
	SAMP_ELEMENTINDEX = 12
	// SAMP_DMAPOFFSET specifies the vertex offset in the presampled
	// displacement map. This is a constant used by the tessellator, its
	// default value is 0.
	SAMP_DMAPOFFSET = 13
)
View Source
const (
	// SHADE_FLAT means flat shading mode. The color and specular component of
	// the first vertex in the triangle are used to determine the color and
	// specular component of the face. These colors remain constant across the
	// triangle; that is, they are not interpolated. The specular alpha is
	// interpolated.
	SHADE_FLAT = 1
	// SHADE_GOURAUD means gouraud shading mode. The color and specular
	// components of the face are determined by a linear interpolation between
	// all three of the triangle's vertices.
	SHADE_GOURAUD = 2
	// SHADE_PHONG is not supported.
	SHADE_PHONG = 3
)
View Source
const (
	// SBT_ALL captures the current device state.
	SBT_ALL = 1
	// SBT_PIXELSTATE capture the current pixel state.
	SBT_PIXELSTATE = 2
	// SBT_VERTEXSTATE capture the current vertex state.
	SBT_VERTEXSTATE = 3
)
View Source
const (
	// STENCILOP_KEEP does not update the entry in the stencil buffer. This is
	// the default value.
	STENCILOP_KEEP = 1
	// STENCILOP_ZERO sets the stencil-buffer entry to 0.
	STENCILOP_ZERO = 2
	// STENCILOP_REPLACE replaces the stencil-buffer entry with a reference
	// value.
	STENCILOP_REPLACE = 3
	// STENCILOP_INCRSAT increments the stencil-buffer entry, clamping to the
	// maximum value.
	STENCILOP_INCRSAT = 4
	// STENCILOP_DECRSAT decrements the stencil-buffer entry, clamping to zero.
	STENCILOP_DECRSAT = 5
	// STENCILOP_INVERT inverts the bits in the stencil-buffer entry.
	STENCILOP_INVERT = 6
	// STENCILOP_INCR increments the stencil-buffer entry, wrapping to zero if
	// the new value exceeds the maximum value.
	STENCILOP_INCR = 7
	// STENCILOP_DECR decrements the stencil-buffer entry, wrapping to the
	// maximum value if the new value is less than zero.
	STENCILOP_DECR = 8
)
View Source
const (
	// SWAPEFFECT_DISCARD When a swap chain is created with a swap effect of
	// SWAPEFFECT_FLIP or SWAPEFFECT_COPY, the runtime will guarantee that an
	// Device.Present operation will not affect the content of any of the back
	// buffers. Unfortunately, meeting this guarantee can involve substantial
	// video memory or processing overheads, especially when implementing flip
	// semantics for a windowed swap chain or copy semantics for a full-screen
	// swap chain. An application may use the SWAPEFFECT_DISCARD swap effect to
	// avoid these overheads and to enable the display driver to select the
	// most efficient presentation technique for the swap chain. This is also
	// the only swap effect that may be used when specifying a value other than
	// MULTISAMPLE_NONE for the MultiSampleType member of PRESENT_PARAMETERS.
	// Like a swap chain that uses SWAPEFFECT_FLIP, a swap chain that uses
	// SWAPEFFECT_DISCARD might include more than one back buffer, any of which
	// may be accessed using Device.GetBackBuffer or SwapChain.GetBackBuffer.
	// The swap chain is best envisaged as a queue in which 0 always indexes
	// the back buffer that will be displayed by the next Present operation and
	// from which buffers are discarded when they have been displayed.
	// An application that uses this swap effect cannot make any assumptions
	// about the contents of a discarded back buffer and should therefore
	// update an entire back buffer before invoking a Present operation that
	// would display it. Although this is not enforced, the debug version of
	// the runtime will overwrite the contents of discarded back buffers with
	// random data to enable developers to verify that their applications are
	// updating the entire back buffer surfaces correctly.
	SWAPEFFECT_DISCARD = 1
	// SWAPEFFECT_FLIP The swap chain might include multiple back buffers and
	// is best envisaged as a circular queue that includes the front buffer.
	// Within this queue, the back buffers are always numbered sequentially
	// from 0 to (n - 1), where n is the number of back buffers, so that 0
	// denotes the least recently presented buffer. When Present is invoked,
	// the queue is "rotated" so that the front buffer becomes back buffer (n -
	// 1), while the back buffer 0 becomes the new front buffer.
	SWAPEFFECT_FLIP = 2
	// SWAPEFFECT_COPY This swap effect may be specified only for a swap chain
	// comprising a single back buffer. Whether the swap chain is windowed or
	// full-screen, the runtime will guarantee the semantics implied by a
	// copy-based Present operation, namely that the operation leaves the
	// content of the back buffer unchanged, instead of replacing it with the
	// content of the front buffer as a flip-based Present operation would.
	// For a full-screen swap chain, the runtime uses a combination of flip
	// operations and copy operations, supported if necessary by hidden back
	// buffers, to accomplish the Present operation. Accordingly, the
	// presentation is synchronized with the display adapter's vertical retrace
	// and its rate is constrained by the chosen presentation interval. A swap
	// chain specified with the PRESENT_INTERVAL_IMMEDIATE flag is the only
	// exception. (Refer to the description of the PresentationIntervals member
	// of the PRESENT_PARAMETERS structure.) In this case, a Present operation
	// copies the back buffer content directly to the front buffer without
	// waiting for the vertical retrace.
	SWAPEFFECT_COPY = 3
)
View Source
const (
	// TADDRESS_WRAP tiles the texture at every integer junction. For example,
	// for u values between 0 and 3, the texture is repeated three times; no
	// mirroring is performed.
	TADDRESS_WRAP = 1
	// TADDRESS_MIRROR is similar to TADDRESS_WRAP, except that the texture is
	// flipped at every integer junction. For u values between 0 and 1, for
	// example, the texture is addressed normally; between 1 and 2, the texture
	// is flipped (mirrored); between 2 and 3, the texture is normal again; and
	// so on.
	TADDRESS_MIRROR = 2
	// TADDRESS_CLAMP means texture coordinates outside the range [0.0, 1.0]
	// are set to the texture color at 0.0 or 1.0, respectively.
	TADDRESS_CLAMP = 3
	// TADDRESS_BORDER means texture coordinates outside the range [0.0, 1.0]
	// are set to the border color.
	TADDRESS_BORDER = 4
	// TADDRESS_MIRRORONCE is similar to TADDRESS_MIRROR and TADDRESS_CLAMP.
	// Takes the absolute value of the texture coordinate (thus, mirroring
	// around 0), and then clamps to the maximum value. The most common usage
	// is for volume textures, where support for the full TADDRESS_MIRRORONCE
	// texture-addressing mode is not necessary, but the data is symmetric
	// around the one axis.
	TADDRESS_MIRRORONCE = 5
)
View Source
const (
	// TEXF_NONE when used with SAMP_MIPFILTER, disables mipmapping.
	TEXF_NONE = 0
	// TEXF_POINT when used with SAMP_ MAGFILTER or SAMP_MINFILTER, specifies
	// that point filtering is to be used as the texture magnification or
	// minification filter respectively. When used with SAMP_MIPFILTER, enables
	// mipmapping and specifies that the rasterizer chooses the color from the
	// texel of the nearest mip level.
	TEXF_POINT = 1
	// TEXF_LINEAR when used with SAMP_ MAGFILTER or SAMP_MINFILTER, specifies
	// that linear filtering is to be used as the texture magnification or
	// minification filter respectively. When used with SAMP_MIPFILTER, enables
	// mipmapping and trilinear filtering; it specifies that the rasterizer
	// interpolates between the two nearest mip levels.
	TEXF_LINEAR = 2
	// TEXF_ANISOTROPIC when used with SAMP_ MAGFILTER or SAMP_MINFILTER,
	// specifies that anisotropic texture filtering used as a texture
	// magnification or minification filter respectively. Compensates for
	// distortion caused by the difference in angle between the texture polygon
	// and the plane of the screen. Use with SAMP_MIPFILTER is undefined.
	TEXF_ANISOTROPIC = 3
	// TEXF_PYRAMIDALQUAD is a 4-sample tent filter used as a texture
	// magnification or minification filter. Use with SAMP_MIPFILTER is
	// undefined.
	TEXF_PYRAMIDALQUAD = 6
	// TEXF_GAUSSIANQUAD is a 4-sample Gaussian filter used as a texture
	// magnification or minification filter. Use with SAMP_MIPFILTER is
	// undefined.
	TEXF_GAUSSIANQUAD = 7
)
View Source
const (
	// TOP_DISABLE disables output from this texture stage and all stages with
	// a higher index. To disable texture mapping, set this as the color
	// operation for the first texture stage (stage 0). Alpha operations cannot
	// be disabled when color operations are enabled. Setting the alpha
	// operation to TOP_DISABLE when color blending is enabled causes undefined
	// behavior.
	TOP_DISABLE = 1
	// TOP_SELECTARG1 uses this texture stage's first color or alpha argument,
	// unmodified, as the output. This operation affects the color argument
	// when used with the TSS_COLOROP texture-stage state, and the alpha
	// argument when used with TSS_ALPHAOP.
	// S(RGBA) = Arg1
	TOP_SELECTARG1 = 2
	// TOP_SELECTARG2 Use this texture stage's second color or alpha argument,
	// unmodified, as the output. This operation affects the color argument
	// when used with the D3DTSS_COLOROP texture stage state, and the alpha
	// argument when used with D3DTSS_ALPHAOP.
	// S(RGBA) = Arg2
	TOP_SELECTARG2 = 3
	// TOP_MODULATE multiplies the components of the arguments.
	// S(RGBA) = Arg1*Arg2
	TOP_MODULATE = 4
	// TOP_MODULATE2X multiplies the components of the arguments, and shift the
	// products to the left 1 bit (effectively multiplying them by 2) for
	// brightening.
	// S(RGBA) = (Arg1*Arg2)<<1
	TOP_MODULATE2X = 5
	// TOP_MODULATE4X multiplies the components of the arguments, and shift the
	// products to the left 2 bits (effectively multiplying them by 4) for
	// brightening.
	// S(RGBA) = (Arg1*Arg2)<<2
	TOP_MODULATE4X = 6
	// TOP_ADD adds the components of the arguments.
	// S(RGBA) = Arg1+Arg2
	TOP_ADD = 7
	// TOP_ADDSIGNED adds the components of the arguments with a - 0.5 bias,
	// making the effective range of values from - 0.5 through 0.5.
	// S(RGBA) = Arg1+Arg2-0.5
	TOP_ADDSIGNED = 8
	// TOP_ADDSIGNED2X adds the components of the arguments with a - 0.5 bias,
	// and shift the products to the left 1 bit.
	// S(RGBA) = (Arg1+Arg2-0.5)<<1
	TOP_ADDSIGNED2X = 9
	// TOP_SUBTRACT subtracts the components of the second argument from those
	// of the first argument.
	// S(RGBA) = Arg1-Arg2
	TOP_SUBTRACT = 10
	// TOP_ADDSMOOTH adds the first and second arguments; then subtract their
	// product from the sum.
	// S(RGBA) = Arg1+Arg2 - Arg1*Arg2 = Arg1+Arg2*(1-Arg1)
	TOP_ADDSMOOTH = 11
	// TOP_BLENDDIFFUSEALPHA linearly blends this texture stage, using the
	// interpolated alpha from each vertex.
	// S(RGBA) = Arg1*Alpha + Arg2*(1-Alpha)
	TOP_BLENDDIFFUSEALPHA = 12
	// TOP_BLENDTEXTUREALPHA linearly blends this texture stage, using the
	// alpha from this stage's texture.
	// S(RGBA) = Arg1*Alpha + Arg2*(1-Alpha)
	TOP_BLENDTEXTUREALPHA = 13
	// TOP_BLENDFACTORALPHA linearly blends this texture stage, using a scalar
	// alpha set with the D3DRS_TEXTUREFACTOR render state.
	// S(RGBA) = Arg1*Alpha + Arg2*(1-Alpha)
	TOP_BLENDFACTORALPHA = 14
	// TOP_BLENDTEXTUREALPHAPM linearly blends a texture stage that uses a
	// premultiplied alpha.
	// S(RGBA) = Arg1 + Arg2*(1-Alpha)
	TOP_BLENDTEXTUREALPHAPM = 15
	// TOP_BLENDCURRENTALPHA linearly blends this texture stage, using the
	// alpha taken from the previous texture stage.
	// S(RGBA) = Arg1*Alpha + Arg2*(1-Alpha)
	TOP_BLENDCURRENTALPHA = 16
	// TOP_PREMODULATE is set in stage n. The output of stage n is arg1.
	// Additionally, if there is a texture in stage n + 1, any TA_CURRENT in
	// stage n + 1 is premultiplied by texture in stage n + 1.
	TOP_PREMODULATE = 17
	// TOP_MODULATEALPHA_ADDCOLOR modulates the color of the second argument,
	// using the alpha of the first argument; then add the result to argument
	// one. This operation is supported only for color operations
	// (D3DTSS_COLOROP).
	// S(RGBA) = Arg1(RGB)+Arg1(A)*Arg2(RGB)
	TOP_MODULATEALPHA_ADDCOLOR = 18
	// TOP_MODULATECOLOR_ADDALPHA modulates the arguments; then add the alpha
	// of the first argument. This operation is supported only for color
	// operations (D3DTSS_COLOROP).
	// S(RGBA) = Arg1(RGB)*Arg2(RGB)+Arg1(A)
	TOP_MODULATECOLOR_ADDALPHA = 19
	// TOP_MODULATEINVALPHA_ADDCOLOR is similar to TOP_MODULATEALPHA_ADDCOLOR,
	// but use the inverse of the alpha of the first argument. This operation
	// is supported only for color operations (TSS_COLOROP).
	// S(RGBA) = (1-Arg1(A))*Arg2(RGB)+Arg1(RGB)
	TOP_MODULATEINVALPHA_ADDCOLOR = 20
	// TOP_MODULATEINVCOLOR_ADDALPHA is similar to TOP_MODULATECOLOR_ADDALPHA,
	// but use the inverse of the color of the first argument. This operation
	// is supported only for color operations (TSS_COLOROP).
	// S(RGBA) = (1-Arg1(RGB))*Arg2(RGB)+Arg1(A)
	TOP_MODULATEINVCOLOR_ADDALPHA = 21
	// TOP_BUMPENVMAP performs per-pixel bump mapping, using the environment
	// map in the next texture stage, without luminance. This operation is
	// supported only for color operations (TSS_COLOROP).
	TOP_BUMPENVMAP = 22
	// TOP_BUMPENVMAPLUMINANCE performs per-pixel bump mapping, using the
	// environment map in the next texture stage, with luminance. This
	// operation is supported only for color operations (TSS_COLOROP).
	TOP_BUMPENVMAPLUMINANCE = 23
	// TOP_DOTPRODUCT3 modulates the components of each argument as signed
	// components, add their products; then replicate the sum to all color
	// channels, including alpha. This operation is supported for color and
	// alpha operations.
	// S(RGBA) = Arg1(R)*Arg2(R) + Arg1(G)*Arg2(G) + Arg1(B)*Arg2(B)
	// In DirectX 6 and DirectX 7, multitexture operations the above inputs are
	// all shifted down by half (y = x - 0.5) before use to simulate signed
	// data, and the scalar result is automatically clamped to positive values
	// and replicated to all three output channels. Also, note that as a color
	// operation this does not updated the alpha it just updates the RGB
	// components.
	// However, in DirectX 8.1 shaders you can specify that the output be
	// routed to the .rgb or the .a components or both (the default). You can
	// also specify a separate scalar operation on the alpha channel.
	TOP_DOTPRODUCT3 = 24
	// TOP_MULTIPLYADD performs a multiply-accumulate operation. It takes the
	// last two arguments, multiplies them together, and adds them to the
	// remaining input/source argument, and places that into the result.
	// S(RGBA) = Arg1 + Arg2*Arg3
	TOP_MULTIPLYADD = 25
	// TOP_LERP linearly interpolates between the second and third source
	// arguments by a proportion specified in the first source argument.
	// S(RGBA) = Arg1*Arg2 + (1-Arg1)*Arg3
	TOP_LERP = 26
)
View Source
const (
	// TSS_COLOROP texture-stage state is a texture color blending operation
	// identified by one member of the TEXTUREOP enumerated type. The default
	// value for the first texture stage (stage 0) is TOP_MODULATE; for all
	// other stages the default is TOP_DISABLE.
	TSS_COLOROP = 1
	// TSS_COLORARG1 texture-stage state is the first color argument for the
	// stage, identified by one of the TA. The default argument is TA_TEXTURE.
	// Specify TA_TEMP to select a temporary register color for read or write.
	// TA_TEMP is supported if the PMISCCAPS_TSSARGTEMP device capability is
	// present. The default value for the register is (0.0, 0.0, 0.0, 0.0).
	TSS_COLORARG1 = 2
	// TSS_COLORARG2 texture-stage state is the second color argument for the
	// stage, identified by TA. The default argument is TA_CURRENT. Specify
	// TA_TEMP to select a temporary register color for read or write. TA_TEMP
	// is supported if the PMISCCAPS_TSSARGTEMP device capability is present.
	// The default value for the register is (0.0, 0.0, 0.0, 0.0)
	TSS_COLORARG2 = 3
	// TSS_ALPHAOP texture-stage state is a texture alpha blending operation
	// identified by one member of the TEXTUREOP enumerated type. The default
	// value for the first texture stage (stage 0) is TOP_SELECTARG1, and for
	// all other stages the default is TOP_DISABLE.
	TSS_ALPHAOP = 4
	// TSS_ALPHAARG1 texture-stage state is the first alpha argument for the
	// stage, identified by by TA. The default argument is TA_TEXTURE. If no
	// texture is set for this stage, the default argument is TA_DIFFUSE.
	// Specify TA_TEMP to select a temporary register color for read or write.
	// TA_TEMP is supported if the PMISCCAPS_TSSARGTEMP device capability is
	// present. The default value for the register is (0.0, 0.0, 0.0, 0.0).
	TSS_ALPHAARG1 = 5
	// TSS_ALPHAARG2 texture-stage state is the second alpha argument for the
	// stage, identified by by TA. The default argument is TA_CURRENT. Specify
	// TA_TEMP to select a temporary register color for read or write. TA_TEMP
	// is supported if the PMISCCAPS_TSSARGTEMP device capability is present.
	// The default value for the register is (0.0, 0.0, 0.0, 0.0).
	TSS_ALPHAARG2 = 6
	// TSS_BUMPENVMAT00 texture-stage state is a floating-point value for the
	// [0][0] coefficient in a bump-mapping matrix. The default value is 0.0.
	TSS_BUMPENVMAT00 = 7
	// TSS_BUMPENVMAT01 texture-stage state is a floating-point value for the
	// [0][1] coefficient in a bump-mapping matrix. The default value is 0.0.
	TSS_BUMPENVMAT01 = 8
	// TSS_BUMPENVMAT10 texture-stage state is a floating-point value for the
	// [1][0] coefficient in a bump-mapping matrix. The default value is 0.0.
	TSS_BUMPENVMAT10 = 9
	// TSS_BUMPENVMAT11 texture-stage state is a floating-point value for the
	// [1][1] coefficient in a bump-mapping matrix. The default value is 0.0.
	TSS_BUMPENVMAT11 = 10
	// TSS_TEXCOORDINDEX is an index of the texture coordinate set to use with
	// this texture stage. You can specify up to eight sets of texture
	// coordinates per vertex. If a vertex does not include a set of texture
	// coordinates at the specified index, the system defaults to the u and v
	// coordinates (0,0).
	// When rendering using vertex shaders, each stage's texture coordinate
	// index must be set to its default value. The default index for each stage
	// is equal to the stage index. Set this state to the zero-based index of
	// the coordinate set for each vertex that this texture stage uses.
	// Additionally, applications can include, as logical OR with the index
	// being set, one of the constants to request that Direct3D automatically
	// generate the input texture coordinates for a texture transformation.
	// With the exception of TSS_TCI_PASSTHRU, which resolves to zero, if any
	// of the following values is included with the index being set, the system
	// uses the index strictly to determine texture wrapping mode. These flags
	// are most useful when performing environment mapping.
	TSS_TEXCOORDINDEX = 11
	// TSS_BUMPENVLSCALE is a floating-point scale value for bump-map
	// luminance. The default value is 0.0.
	TSS_BUMPENVLSCALE = 22
	// TSS_BUMPENVLOFFSET is a floating-point offset value for bump-map
	// luminance. The default value is 0.0.
	TSS_BUMPENVLOFFSET = 23
	// TSS_TEXTURETRANSFORMFLAGS is a member of the TEXTURETRANSFORMFLAGS
	// enumerated type that controls the transformation of texture coordinates
	// for this texture stage. The default value is TTFF_DISABLE.
	TSS_TEXTURETRANSFORMFLAGS = 24
	// TSS_COLORARG0 specifies settings for the third color operand for triadic
	// operations (multiply, add, and linearly interpolate), identified by TA.
	// This setting is supported if the TEXOPCAPS_MULTIPLYADD or TEXOPCAPS_LERP
	// device capabilities are present. The default argument is TA_CURRENT.
	// Specify TA_TEMP to select a temporary register color for read or write.
	// TA_TEMP is supported if the PMISCCAPS_TSSARGTEMP device capability is
	// present. The default value for the register is (0.0, 0.0, 0.0, 0.0).
	TSS_COLORARG0 = 26
	// TSS_ALPHAARG0 specifies settings for the alpha channel selector operand
	// for triadic operations (multiply, add, and linearly interpolate),
	// identified by TA. This setting is supported if the TEXOPCAPS_MULTIPLYADD
	// or TEXOPCAPS_LERP device capabilities are present. The default argument
	// is TA_CURRENT. Specify TA_TEMP to select a temporary register color for
	// read or write. TA_TEMP is supported if the PMISCCAPS_TSSARGTEMP device
	// capability is present. The default argument is (0.0, 0.0, 0.0, 0.0).
	TSS_ALPHAARG0 = 27
	// TSS_RESULTARG is a setting to select destination register for the result
	// of this stage, identified by TA. This value can be set to TA_CURRENT
	// (the default value) or to TA_TEMP, which is a single temporary register
	// that can be read into subsequent stages as an input argument. The final
	// color passed to the fog blender and frame buffer is taken from
	// TA_CURRENT, so the last active texture stage state must be set to write
	// to current. This setting is supported if the PMISCCAPS_TSSARGTEMP device
	// capability is present.
	TSS_RESULTARG = 28
	// TSS_CONSTANT is a per-stage constant color. To see if a device supports
	// a per-stage constant color, see the PMISCCAPS_PERSTAGECONSTANT constant
	// in PMISCCAPS. TSS_CONSTANT is used by TA_CONSTANT.
	TSS_CONSTANT = 32
)
View Source
const (
	// TTFF_DISABLE means texture coordinates are passed directly to the
	// rasterizer.
	TTFF_DISABLE = 0
	// TTFF_COUNT1 means the rasterizer should expect 1D texture coordinates.
	// This value is used by fixed function vertex processing; it should be set
	// to 0 when using a programmable vertex shader.
	TTFF_COUNT1 = 1
	// TTFF_COUNT2 means the rasterizer should expect 2D texture coordinates.
	// This value is used by fixed function vertex processing; it should be set
	// to 0 when using a programmable vertex shader.
	TTFF_COUNT2 = 2
	// TTFF_COUNT3 means the rasterizer should expect 3D texture coordinates.
	// This value is used by fixed function vertex processing; it should be set
	// to 0 when using a programmable vertex shader.
	TTFF_COUNT3 = 3
	// TTFF_COUNT4 means the rasterizer should expect 4D texture coordinates.
	// This value is used by fixed function vertex processing; it should be set
	// to 0 when using a programmable vertex shader.
	TTFF_COUNT4 = 4
	// TTFF_PROJECTED is a flag honored by the fixed function pixel pipeline,
	// as well as the programmable pixel pipeline in versions ps_1_1 to ps_1_3.
	// When texture projection is enabled for a texture stage, all four
	// floating point values must be written to the corresponding texture
	// register. Each texture coordinate is divided by the last element before
	// being passed to the rasterizer. For example, if this flag is specified
	// with the TTFF_COUNT3 flag, the first and second texture coordinates are
	// divided by the third coordinate before being passed to the rasterizer.
	TTFF_PROJECTED = 256
)
View Source
const (
	// TS_VIEW identifies the transformation matrix being set as the view
	// transformation matrix. The default value is nil (the identity matrix).
	TS_VIEW = 2
	// TS_PROJECTION identifies the transformation matrix being set as the
	// projection transformation matrix. The default value is nil (the identity
	// matrix).
	TS_PROJECTION = 3
	// TS_TEXTURE0 identifies the transformation matrix being set for texture
	// stage 0.
	TS_TEXTURE0 = 16
	// TS_TEXTURE1 identifies the transformation matrix being set for texture
	// stage 1.
	TS_TEXTURE1 = 17
	// TS_TEXTURE2 identifies the transformation matrix being set for texture
	// stage 2.
	TS_TEXTURE2 = 18
	// TS_TEXTURE3 identifies the transformation matrix being set for texture
	// stage 3.
	TS_TEXTURE3 = 19
	// TS_TEXTURE4 identifies the transformation matrix being set for texture
	// stage 4.
	TS_TEXTURE4 = 20
	// TS_TEXTURE5 identifies the transformation matrix being set for texture
	// stage 5.
	TS_TEXTURE5 = 21
	// TS_TEXTURE6 identifies the transformation matrix being set for texture
	// stage 6.
	TS_TEXTURE6 = 22
	// TS_TEXTURE7 identifies the transformation matrix being set for texture
	// stage 7.
	TS_TEXTURE7 = 23
)
View Source
const (
	// VBF_DISABLE disables vertex blending; apply only the world matrix set by
	// the TS_WORLDMATRIX macro, where the index value for the transformation
	// state is 0.
	VBF_DISABLE = 0
	// VBF_1WEIGHTS enables vertex blending between the two matrices set by the
	// TS_WORLDMATRIX macro, where the index value for the transformation
	// states are 0 and 1.
	VBF_1WEIGHTS = 1
	// VBF_2WEIGHTS enables vertex blending between the three matrices set by
	// the TS_WORLDMATRIX macro, where the index value for the transformation
	// states are 0, 1, and 2.
	VBF_2WEIGHTS = 2
	// VBF_3WEIGHTS enables vertex blending between the four matrices set by
	// the TS_WORLDMATRIX macro, where the index value for the transformation
	// states are 0, 1, 2, and 3.
	VBF_3WEIGHTS = 3
	// VBF_TWEENING means vertex blending is done by using the value assigned
	// to RS_TWEENFACTOR.
	VBF_TWEENING = 255
	// VBF_0WEIGHTS uses a single matrix with a weight of 1.0.
	VBF_0WEIGHTS = 256
)
View Source
const (
	// ZB_FALSE disables depth buffering.
	ZB_FALSE = 0
	// ZB_TRUE enables z-buffering.
	ZB_TRUE = 1
	// ZB_USEW enables w-buffering.
	ZB_USEW = 2
)
View Source
const MAX_DEVICE_IDENTIFIER_STRING = 512

Variables

This section is empty.

Functions

func FVFTexCoordSize1

func FVFTexCoordSize1(CoordIndex uint) uint32

FVFTexCoordSize1 constructs bit patterns that are used to identify texture coordinate formats within a FVF description. The results of these macros can be combined within a FVF description by using the OR operator.

func FVFTexCoordSize2

func FVFTexCoordSize2(CoordIndex uint) uint32

FVFTexCoordSize2 constructs bit patterns that are used to identify texture coordinate formats within a FVF description. The results of these macros can be combined within a FVF description by using the OR operator.

func FVFTexCoordSize3

func FVFTexCoordSize3(CoordIndex uint) uint32

FVFTexCoordSize3 constructs bit patterns that are used to identify texture coordinate formats within a FVF description. The results of these macros can be combined within a FVF description by using the OR operator.

func FVFTexCoordSize4

func FVFTexCoordSize4(CoordIndex uint) uint32

FVFTexCoordSize4 constructs bit patterns that are used to identify texture coordinate formats within a FVF description. The results of these macros can be combined within a FVF description by using the OR operator.

func PSVersion

func PSVersion(major, minor uint) uint32

PSVersion creates a pixel shader version token.

func VSVersion

func VSVersion(major, minor uint) uint32

VSVersion creates a vertex shader version token.

Types

type ADAPTER_IDENTIFIER

type ADAPTER_IDENTIFIER struct {
	Driver           [MAX_DEVICE_IDENTIFIER_STRING]byte
	Description      [MAX_DEVICE_IDENTIFIER_STRING]byte
	DeviceName       [32]byte
	DriverVersion    int64
	VendorId         uint32
	DeviceId         uint32
	SubSysId         uint32
	Revision         uint32
	DeviceIdentifier GUID
	WHQLLevel        uint32
}

ADAPTER_IDENTIFIER contains information identifying the adapter.

func (*ADAPTER_IDENTIFIER) GetDescription added in v1.2.0

func (id *ADAPTER_IDENTIFIER) GetDescription() string

GetDescription returns the Description member as a Go string with trailing 0s removed.

func (*ADAPTER_IDENTIFIER) GetDeviceName added in v1.2.0

func (id *ADAPTER_IDENTIFIER) GetDeviceName() string

GetDeviceName returns the DeviceName member as a Go string with trailing 0s removed.

func (*ADAPTER_IDENTIFIER) GetDriver added in v1.2.0

func (id *ADAPTER_IDENTIFIER) GetDriver() string

GetDriver returns the Driver member as a Go string with trailing 0s removed.

func (*ADAPTER_IDENTIFIER) GetVersion added in v1.2.0

func (id *ADAPTER_IDENTIFIER) GetVersion() (product, ver, subVer, build int)

GetVersion splits the DriverVersion into its four semantic parts: product, version, sub-version and build.

type BACKBUFFER_TYPE

type BACKBUFFER_TYPE uint32

BACKBUFFER_TYPE defines constants that describe the type of a back buffer.

type BASISTYPE

type BASISTYPE uint32

BASISTYPE defines the basis type of a high-order patch surface.

type BLEND

type BLEND uint32

BLEND defines the supported blend mode.

type BLENDOP

type BLENDOP uint32

BLENDOP defines the supported blend operations.

type BOX

type BOX struct {
	Left   uint32
	Top    uint32
	Right  uint32
	Bottom uint32
	Front  uint32
	Back   uint32
}

BOX defines a volume.

type BaseTexture

type BaseTexture struct {
	// contains filtered or unexported fields
}

BaseTexture and its methods are used to manipulate texture resources including cube and volume textures.

func (*BaseTexture) AddRef added in v1.0.1

func (obj *BaseTexture) AddRef() uint32

AddRef increments the reference count for an interface on an object. This method should be called for every new copy of a pointer to an interface on an object.

func (*BaseTexture) FreePrivateData added in v1.0.1

func (obj *BaseTexture) FreePrivateData(refguid GUID) Error

FreePrivateData frees the specified private data associated with this resource.

func (*BaseTexture) GenerateMipSubLevels

func (obj *BaseTexture) GenerateMipSubLevels()

GenerateMipSubLevels generates mip sub levels.

func (*BaseTexture) GetAutoGenFilterType

func (obj *BaseTexture) GetAutoGenFilterType() TEXTUREFILTERTYPE

GetAutoGenFilterType returns the filter type that is used for automatically generated mipmap sublevels.

func (*BaseTexture) GetDevice added in v1.0.1

func (obj *BaseTexture) GetDevice() (device *Device, err Error)

GetDevice retrieves the device associated with a resource. Call Release on the returned device when finished using it.

func (*BaseTexture) GetLOD

func (obj *BaseTexture) GetLOD() uint32

GetLOD returns a value clamped to the maximum level-of-detail set for a managed texture (this method is not supported for an unmanaged texture).

func (*BaseTexture) GetLevelCount

func (obj *BaseTexture) GetLevelCount() uint32

GetLevelCount returns the number of texture levels in a multilevel texture.

func (*BaseTexture) GetPriority added in v1.0.1

func (obj *BaseTexture) GetPriority() uint32

GetPriority retrieves the priority for this resource.

func (*BaseTexture) GetPrivateData added in v1.0.1

func (obj *BaseTexture) GetPrivateData(refguid GUID) (data []byte, err Error)

GetPrivateData copies the private data associated with the resource to a provided buffer.

func (*BaseTexture) GetType added in v1.0.1

func (obj *BaseTexture) GetType() RESOURCETYPE

GetType returns the type of the resource.

func (*BaseTexture) PreLoad added in v1.0.1

func (obj *BaseTexture) PreLoad()

PreLoad preloads a managed resource.

func (*BaseTexture) Release

func (obj *BaseTexture) Release() uint32

Release has to be called when finished using the object to free its associated resources.

func (*BaseTexture) SetAutoGenFilterType

func (obj *BaseTexture) SetAutoGenFilterType(typ TEXTUREFILTERTYPE) Error

SetAutoGenFilterType sets the filter type that is used for automatically generated mipmap sublevels.

func (*BaseTexture) SetLOD

func (obj *BaseTexture) SetLOD(lodNew uint32) uint32

SetLOD sets the most detailed level-of-detail for a managed texture.

func (*BaseTexture) SetPriority added in v1.0.1

func (obj *BaseTexture) SetPriority(priorityNew uint32) uint32

SetPriority assigns the priority of a resource for scheduling purposes.

func (*BaseTexture) SetPrivateData added in v1.0.1

func (obj *BaseTexture) SetPrivateData(
	refguid GUID,
	data uintptr,
	sizeOfData uint32,
	flags uint32,
) Error

SetPrivateData associates data with the resource that is intended for use by the application, not by Direct3D. Data is passed by value, and multiple sets of data can be associated with a single resource.

func (*BaseTexture) SetPrivateDataBytes added in v1.0.1

func (obj *BaseTexture) SetPrivateDataBytes(
	refguid GUID,
	data []byte,
	flags uint32,
) Error

SetPrivateDataBytes associates data with the resource that is intended for use by the application, not by Direct3D. Data is passed by value, and multiple sets of data can be associated with a single resource.

type BaseTextureImpl added in v1.0.1

type BaseTextureImpl interface {
	// contains filtered or unexported methods
}

type CAPS

type CAPS struct {
	DeviceType                        DEVTYPE
	AdapterOrdinal                    uint32
	Caps                              uint32
	Caps2                             uint32
	Caps3                             uint32
	PresentationIntervals             uint32
	CursorCaps                        uint32
	DevCaps                           uint32
	PrimitiveMiscCaps                 uint32
	RasterCaps                        uint32
	ZCmpCaps                          uint32
	SrcBlendCaps                      uint32
	DestBlendCaps                     uint32
	AlphaCmpCaps                      uint32
	ShadeCaps                         uint32
	TextureCaps                       uint32
	TextureFilterCaps                 uint32
	CubeTextureFilterCaps             uint32
	VolumeTextureFilterCaps           uint32
	TextureAddressCaps                uint32
	VolumeTextureAddressCaps          uint32
	LineCaps                          uint32
	MaxTextureWidth                   uint32
	MaxTextureHeight                  uint32
	MaxVolumeExtent                   uint32
	MaxTextureRepeat                  uint32
	MaxTextureAspectRatio             uint32
	MaxAnisotropy                     uint32
	MaxVertexW                        float32
	GuardBandLeft                     float32
	GuardBandTop                      float32
	GuardBandRight                    float32
	GuardBandBottom                   float32
	ExtentsAdjust                     float32
	StencilCaps                       uint32
	FVFCaps                           uint32
	TextureOpCaps                     uint32
	MaxTextureBlendStages             uint32
	MaxSimultaneousTextures           uint32
	VertexProcessingCaps              uint32
	MaxActiveLights                   uint32
	MaxUserClipPlanes                 uint32
	MaxVertexBlendMatrices            uint32
	MaxVertexBlendMatrixIndex         uint32
	MaxPointSize                      float32
	MaxPrimitiveCount                 uint32
	MaxVertexIndex                    uint32
	MaxStreams                        uint32
	MaxStreamStride                   uint32
	VertexShaderVersion               uint32
	MaxVertexShaderConst              uint32
	PixelShaderVersion                uint32
	PixelShader1xMaxValue             float32
	DevCaps2                          uint32
	MasterAdapterOrdinal              uint32
	AdapterOrdinalInGroup             uint32
	NumberOfAdaptersInGroup           uint32
	DeclTypes                         uint32
	NumSimultaneousRTs                uint32
	StretchRectFilterCaps             uint32
	VS20Caps                          VSHADERCAPS2_0
	PS20Caps                          PSHADERCAPS2_0
	VertexTextureFilterCaps           uint32
	MaxVShaderInstructionsExecuted    uint32
	MaxPShaderInstructionsExecuted    uint32
	MaxVertexShader30InstructionSlots uint32
	MaxPixelShader30InstructionSlots  uint32
}

CAPS represents the capabilities of the hardware exposed through the Direct3D object.

type CLIPSTATUS

type CLIPSTATUS struct {
	ClipUnion        uint32
	ClipIntersection uint32
}

CLIPSTATUS describes the current clip status.

type CMPFUNC

type CMPFUNC uint32

CMPFUNC defines the supported compare functions.

type COLOR

type COLOR uint32

COLOR represents a color with red, green, blue and alpha channels, 8 bits each, in a 32 bit unsinged integer.

func ColorARGB

func ColorARGB(a, r, g, b uint8) COLOR

ColorARGB converts the given color channel values to a color. Each channel ranges from 0 (no intensity) to 255 (full intensity).

func ColorAYUV

func ColorAYUV(a, y, u, v uint8) COLOR

ColorAYUV converts the given color channel values to a color. Each channel ranges from 0 (no intensity) to 255 (full intensity).

func ColorRGB

func ColorRGB(r, g, b uint8) COLOR

ColorRGB converts the given color channel values to a color. Each channel ranges from 0 (no intensity) to 255 (full intensity).

func ColorRGBA

func ColorRGBA(r, g, b, a uint8) COLOR

ColorRGBA converts the given color channel values to a color. Each channel ranges from 0 (no intensity) to 255 (full intensity).

func ColorValue

func ColorValue(r, g, b, a float32) COLOR

ColorValue converts the given color channel values to a color. Each channel ranges from 0.0 (no intensity) to 1.0 (full intensity).

func ColorXRGB

func ColorXRGB(r, g, b uint8) COLOR

ColorXRGB converts the given color channel values to a color. Each channel ranges from 0 (no intensity) to 255 (full intensity).

func ColorXYUV

func ColorXYUV(y, u, v uint8) COLOR

ColorXYUV converts the given color channel values to a color. Each channel ranges from 0 (no intensity) to 255 (full intensity).

func ColorYUV

func ColorYUV(y, u, v uint8) COLOR

ColorYUV converts the given color channel values to a color. Each channel ranges from 0 (no intensity) to 255 (full intensity).

type COLORVALUE

type COLORVALUE struct {
	R float32
	G float32
	B float32
	A float32
}

COLORVALUE describes color values.

type CUBEMAP_FACES

type CUBEMAP_FACES uint32

CUBEMAP_FACES defines the faces of a cubemap.

type CULL

type CULL uint32

CULL defines the supported culling modes.

type CubeTexture

type CubeTexture struct {
	// contains filtered or unexported fields
}

CubeTexture and its methods are used to manipulate a cube texture resource.

func (*CubeTexture) AddDirtyRect

func (obj *CubeTexture) AddDirtyRect(faceType CUBEMAP_FACES, dirtyRect *RECT) Error

AddDirtyRect adds a dirty region to a cube texture resource.

func (*CubeTexture) AddRef added in v1.0.1

func (obj *CubeTexture) AddRef() uint32

AddRef increments the reference count for an interface on an object. This method should be called for every new copy of a pointer to an interface on an object.

func (*CubeTexture) FreePrivateData added in v1.0.1

func (obj *CubeTexture) FreePrivateData(refguid GUID) Error

FreePrivateData frees the specified private data associated with this resource.

func (*CubeTexture) GenerateMipSubLevels added in v1.0.1

func (obj *CubeTexture) GenerateMipSubLevels()

GenerateMipSubLevels generates mip sub levels.

func (*CubeTexture) GetAutoGenFilterType added in v1.0.1

func (obj *CubeTexture) GetAutoGenFilterType() TEXTUREFILTERTYPE

GetAutoGenFilterType returns the filter type that is used for automatically generated mipmap sublevels.

func (*CubeTexture) GetCubeMapSurface

func (obj *CubeTexture) GetCubeMapSurface(
	faceType CUBEMAP_FACES,
	level uint,
) (surface *Surface, err Error)

GetCubeMapSurface retrieves a cube texture map surface.

func (*CubeTexture) GetDevice added in v1.0.1

func (obj *CubeTexture) GetDevice() (device *Device, err Error)

GetDevice retrieves the device associated with a resource. Call Release on the returned device when finished using it.

func (*CubeTexture) GetLOD added in v1.0.1

func (obj *CubeTexture) GetLOD() uint32

GetLOD returns a value clamped to the maximum level-of-detail set for a managed texture (this method is not supported for an unmanaged texture).

func (*CubeTexture) GetLevelCount added in v1.0.1

func (obj *CubeTexture) GetLevelCount() uint32

GetLevelCount returns the number of texture levels in a multilevel texture.

func (*CubeTexture) GetLevelDesc

func (obj *CubeTexture) GetLevelDesc(level uint) (desc SURFACE_DESC, err Error)

GetLevelDesc retrieves a description of one face of the specified cube texture level.

func (*CubeTexture) GetPriority added in v1.0.1

func (obj *CubeTexture) GetPriority() uint32

GetPriority retrieves the priority for this resource.

func (*CubeTexture) GetPrivateData added in v1.0.1

func (obj *CubeTexture) GetPrivateData(refguid GUID) (data []byte, err Error)

GetPrivateData copies the private data associated with the resource to a provided buffer.

func (*CubeTexture) GetType added in v1.0.1

func (obj *CubeTexture) GetType() RESOURCETYPE

GetType returns the type of the resource.

func (*CubeTexture) LockRect

func (obj *CubeTexture) LockRect(
	faceType CUBEMAP_FACES,
	level uint,
	rect *RECT,
	flags uint32,
) (lockedRect LOCKED_RECT, err Error)

LockRect locks a rectangle on a cube texture resource.

func (*CubeTexture) PreLoad added in v1.0.1

func (obj *CubeTexture) PreLoad()

PreLoad preloads a managed resource.

func (*CubeTexture) Release

func (obj *CubeTexture) Release() uint32

Release has to be called when finished using the object to free its associated resources.

func (*CubeTexture) SetAutoGenFilterType added in v1.0.1

func (obj *CubeTexture) SetAutoGenFilterType(typ TEXTUREFILTERTYPE) Error

SetAutoGenFilterType sets the filter type that is used for automatically generated mipmap sublevels.

func (*CubeTexture) SetLOD added in v1.0.1

func (obj *CubeTexture) SetLOD(lodNew uint32) uint32

SetLOD sets the most detailed level-of-detail for a managed texture.

func (*CubeTexture) SetPriority added in v1.0.1

func (obj *CubeTexture) SetPriority(priorityNew uint32) uint32

SetPriority assigns the priority of a resource for scheduling purposes.

func (*CubeTexture) SetPrivateData added in v1.0.1

func (obj *CubeTexture) SetPrivateData(
	refguid GUID,
	data uintptr,
	sizeOfData uint32,
	flags uint32,
) Error

SetPrivateData associates data with the resource that is intended for use by the application, not by Direct3D. Data is passed by value, and multiple sets of data can be associated with a single resource.

func (*CubeTexture) SetPrivateDataBytes added in v1.0.1

func (obj *CubeTexture) SetPrivateDataBytes(
	refguid GUID,
	data []byte,
	flags uint32,
) Error

SetPrivateDataBytes associates data with the resource that is intended for use by the application, not by Direct3D. Data is passed by value, and multiple sets of data can be associated with a single resource.

func (*CubeTexture) UnlockRect

func (obj *CubeTexture) UnlockRect(faceType CUBEMAP_FACES, level uint) Error

UnlockRect unlocks a rectangle on a cube texture resource.

type DEBUGMONITORTOKENS

type DEBUGMONITORTOKENS uint32

DEBUGMONITORTOKENS defines the debug monitor tokens.

type DECLMETHOD

type DECLMETHOD byte

DECLMETHOD defines the vertex declaration method which is a predefined operation performed by the tessellator (or any procedural geometry routine on the vertex data during tessellation).

type DECLTYPE

type DECLTYPE byte

DECLTYPE defines a vertex declaration data type.

type DECLUSAGE

type DECLUSAGE byte

DECLUSAGE identifies the intended use of vertex data.

type DEGREETYPE

type DEGREETYPE uint32

DEGREETYPE defines the degree of the variables in the equation that describes a curve.

type DEVICE_CREATION_PARAMETERS

type DEVICE_CREATION_PARAMETERS struct {
	AdapterOrdinal uint32
	DeviceType     DEVTYPE
	HFocusWindow   HWND
	BehaviorFlags  uint32
}

DEVICE_CREATION_PARAMETERS describes the creation parameters for a device.

type DEVINFO_D3D9BANDWIDTHTIMINGS

type DEVINFO_D3D9BANDWIDTHTIMINGS struct {
	MaxBandwidthUtilized                float32
	FrontEndUploadMemoryUtilizedPercent float32
	VertexRateUtilizedPercent           float32
	TriangleSetupRateUtilizedPercent    float32
	FillRateUtilizedPercent             float32
}

DEVINFO_D3D9BANDWIDTHTIMINGS contains throughput metrics for help in understanding the performance of an application.

type DEVINFO_D3D9CACHEUTILIZATION

type DEVINFO_D3D9CACHEUTILIZATION struct {
	TextureCacheHitRate             float32
	PostTransformVertexCacheHitRate float32
}

DEVINFO_D3D9CACHEUTILIZATION measures the cache hit rate performance for textures and indexed vertices.

type DEVINFO_D3D9INTERFACETIMINGS

type DEVINFO_D3D9INTERFACETIMINGS struct {
	WaitingForGPUToUseApplicationResourceTimePercent float32
	WaitingForGPUToAcceptMoreCommandsTimePercent     float32
	WaitingForGPUToStayWithinLatencyTimePercent      float32
	WaitingForGPUExclusiveResourceTimePercent        float32
	WaitingForGPUOtherTimePercent                    float32
}

DEVINFO_D3D9INTERFACETIMINGS contains the percent of time processing data in the driver. These statistics may help identify cases when the driver is waiting for other resources.

type DEVINFO_D3D9PIPELINETIMINGS

type DEVINFO_D3D9PIPELINETIMINGS struct {
	VertexProcessingTimePercent   float32
	PixelProcessingTimePercent    float32
	OtherGPUProcessingTimePercent float32
	GPUIdleTimePercent            float32
}

DEVINFO_D3D9PIPELINETIMINGS contains the percent of time processing data in the pipeline.

type DEVINFO_D3D9STAGETIMINGS

type DEVINFO_D3D9STAGETIMINGS struct {
	MemoryProcessingPercent      float32
	ComputationProcessingPercent float32
}

DEVINFO_D3D9STAGETIMINGS contains the percent of time processing shader data.

type DEVINFO_D3DVERTEXSTATS

type DEVINFO_D3DVERTEXSTATS struct {
	NumRenderedTriangles      uint32
	NumExtraClippingTriangles uint32
}

DEVINFO_D3DVERTEXSTATS reports the number of triangles that have been processed and clipped by the runtime's software vertex processing.

type DEVINFO_VCACHE

type DEVINFO_VCACHE struct {
	Pattern     uint32
	OptMethod   uint32
	CacheSize   uint32
	MagicNumber uint32
}

DEVINFO_VCACHE contains vertex cache optimization hints.

type DEVTYPE

type DEVTYPE uint32

DEVTYPE defines device types.

type DISPLAYMODE

type DISPLAYMODE struct {
	Width       uint32
	Height      uint32
	RefreshRate uint32
	Format      FORMAT
}

type Device

type Device struct {
	// contains filtered or unexported fields
}

Device and its methods are used to perform DrawPrimitive-based rendering, create resources, work with system-level variables, adjust gamma ramp levels, work with palettes and create shaders.

func (*Device) AddRef added in v1.0.1

func (obj *Device) AddRef() uint32

AddRef increments the reference count for an interface on an object. This method should be called for every new copy of a pointer to an interface on an object.

func (*Device) BeginScene

func (obj *Device) BeginScene() Error

BeginScene begins a scene. Applications must call BeginScene before performing any rendering and must call EndScene when rendering is complete and before calling BeginScene again.

func (*Device) BeginStateBlock

func (obj *Device) BeginStateBlock() Error

BeginStateBlock signals Direct3D to begin recording a device-state block.

func (*Device) Clear

func (obj *Device) Clear(
	rects []RECT,
	flags uint32,
	color COLOR,
	z float32,
	stencil uint32,
) Error

Clear clears one or more surfaces such as a render target, multiple render targets, a stencil buffer, and a depth buffer.

func (*Device) ColorFill

func (obj *Device) ColorFill(
	surface *Surface,
	rect *RECT,
	color COLOR,
) Error

ColorFill allows an application to fill a rectangular area of a POOL_DEFAULT surface with a specified color.

func (*Device) CreateAdditionalSwapChain

func (obj *Device) CreateAdditionalSwapChain(params PRESENT_PARAMETERS) (
	*SwapChain, PRESENT_PARAMETERS, Error,
)

CreateAdditionalSwapChain creates an additional swap chain for rendering multiple views.

func (*Device) CreateCubeTexture

func (obj *Device) CreateCubeTexture(
	edgeLength uint,
	levels uint,
	usage uint32,
	format FORMAT,
	pool POOL,
	sharedHandle uintptr,
) (*CubeTexture, Error)

CreateCubeTexture creates a cube texture resource.

func (*Device) CreateDepthStencilSurface

func (obj *Device) CreateDepthStencilSurface(
	width uint,
	height uint,
	format FORMAT,
	multiSample MULTISAMPLE_TYPE,
	multisampleQuality uint32,
	discard bool,
	sharedHandle uintptr,
) (*Surface, Error)

CreateDepthStencilSurface creates a depth-stencil resource.

func (*Device) CreateIndexBuffer

func (obj *Device) CreateIndexBuffer(
	length uint,
	usage uint32,
	format FORMAT,
	pool POOL,
	sharedHandle uintptr,
) (*IndexBuffer, Error)

CreateIndexBuffer creates an index buffer.

func (*Device) CreateOffscreenPlainSurface

func (obj *Device) CreateOffscreenPlainSurface(
	width uint,
	height uint,
	format FORMAT,
	pool POOL,
	sharedHandle uintptr,
) (*Surface, Error)

CreateOffscreenPlainSurface creates an off-screen surface.

func (*Device) CreatePixelShader

func (obj *Device) CreatePixelShader(
	function uintptr,
) (shader *PixelShader, err Error)

CreatePixelShader creates a pixel shader.

func (*Device) CreatePixelShaderFromBytes

func (obj *Device) CreatePixelShaderFromBytes(code []byte) (*PixelShader, Error)

CreatePixelShaderFromBytes creates a pixel shader from a byte slice.

func (*Device) CreateQuery

func (obj *Device) CreateQuery(typ QUERYTYPE) (query *Query, err Error)

CreateQuery creates a status query.

func (*Device) CreateRenderTarget

func (obj *Device) CreateRenderTarget(
	width uint,
	height uint,
	format FORMAT,
	multiSample MULTISAMPLE_TYPE,
	multisampleQuality uint32,
	lockable bool,
	sharedHandle uintptr,
) (*Surface, Error)

CreateRenderTarget creates a render-target surface.

func (*Device) CreateStateBlock

func (obj *Device) CreateStateBlock(typ STATEBLOCKTYPE) (*StateBlock, Error)

CreateStateBlock creates a new state block that contains the values for all device states, vertex-related states, or pixel-related states.

func (*Device) CreateTexture

func (obj *Device) CreateTexture(
	width uint,
	height uint,
	levels uint,
	usage uint32,
	format FORMAT,
	pool POOL,
	sharedHandle uintptr,
) (*Texture, Error)

CreateTexture creates a texture resource.

func (*Device) CreateVertexBuffer

func (obj *Device) CreateVertexBuffer(
	length uint,
	usage uint32,
	fvf uint32,
	pool POOL,
	sharedHandle uintptr,
) (*VertexBuffer, Error)

CreateVertexBuffer creates a vertex buffer.

func (*Device) CreateVertexDeclaration

func (obj *Device) CreateVertexDeclaration(
	vertexElements []VERTEXELEMENT,
) (*VertexDeclaration, Error)

CreateVertexDeclaration creates a vertex shader declaration from the device and the vertex elements. The last element should be DeclEnd().

func (*Device) CreateVertexShader

func (obj *Device) CreateVertexShader(function uintptr) (*VertexShader, Error)

CreateVertexShader creates a vertex shader.

func (*Device) CreateVertexShaderFromBytes

func (obj *Device) CreateVertexShaderFromBytes(code []byte) (*VertexShader, Error)

CreateVertexShaderFromBytes creates a vertex shader from a byte slice.

func (*Device) CreateVolumeTexture

func (obj *Device) CreateVolumeTexture(
	width uint,
	height uint,
	depth uint,
	levels uint,
	usage uint32,
	format FORMAT,
	pool POOL,
	sharedHandle uintptr,
) (*VolumeTexture, Error)

CreateVolumeTexture creates a volume texture resource.

func (*Device) DeletePatch

func (obj *Device) DeletePatch(handle uint) Error

DeletePatch frees a cached high-order patch.

func (*Device) DrawIndexedPrimitive

func (obj *Device) DrawIndexedPrimitive(
	typ PRIMITIVETYPE,
	baseVertexIndex int,
	minIndex uint,
	numVertices uint,
	startIndex uint,
	primitiveCount uint,
) Error

DrawIndexedPrimitive renders the specified geometric primitive into an array of vertices, based on indexing.

func (*Device) DrawIndexedPrimitiveUP

func (obj *Device) DrawIndexedPrimitiveUP(
	typ PRIMITIVETYPE,
	minVertexIndex uint,
	numVertices uint,
	primitiveCount uint,
	indexData uintptr,
	indexDataFormat FORMAT,
	vertexStreamZeroData uintptr,
	vertexStreamZeroStride uint,
) Error

DrawIndexedPrimitiveUP renders the specified geometric primitive with data specified by a user memory pointer.

func (*Device) DrawIndexedPrimitiveUPuint16

func (obj *Device) DrawIndexedPrimitiveUPuint16(
	primitiveType PRIMITIVETYPE,
	minVertexIndex uint,
	numVertices uint,
	primitiveCount uint,
	indexData []uint16,
	vertexStreamZeroData uintptr,
	vertexStreamZeroStride uint,
) (
	err Error,
)

DrawIndexedPrimitiveUPuint16 renders the specified geometric primitive with data specified by a user memory pointer.

func (*Device) DrawIndexedPrimitiveUPuint32

func (obj *Device) DrawIndexedPrimitiveUPuint32(
	primitiveType PRIMITIVETYPE,
	minVertexIndex uint,
	numVertices uint,
	primitiveCount uint,
	indexData []uint32,
	vertexStreamZeroData uintptr,
	vertexStreamZeroStride uint,
) Error

DrawIndexedPrimitiveUPuint32 renders the specified geometric primitive with data specified by a user memory pointer.

func (*Device) DrawPrimitive

func (obj *Device) DrawPrimitive(
	typ PRIMITIVETYPE,
	startVertex uint,
	primitiveCount uint,
) Error

DrawPrimitive renders a sequence of nonindexed, geometric primitives of the specified type from the current set of data input streams.

func (*Device) DrawPrimitiveUP

func (obj *Device) DrawPrimitiveUP(
	typ PRIMITIVETYPE,
	primitiveCount uint,
	vertexStreamZeroData uintptr,
	vertexStreamZeroStride uint,
) Error

DrawPrimitiveUP renders data specified by a user memory pointer as a sequence of geometric primitives of the specified type.

func (*Device) DrawRectPatch

func (obj *Device) DrawRectPatch(
	handle uint,
	numSegs [4]float32,
	rectPatchInfo *RECTPATCH_INFO,
) Error

DrawRectPatch draws a rectangular patch using the currently set streams.

func (*Device) DrawTriPatch

func (obj *Device) DrawTriPatch(
	handle uint,
	numSegs [3]float32,
	triPatchInfo *TRIPATCH_INFO,
) Error

DrawTriPatch draws a triangular patch using the currently set streams.

func (*Device) EndScene

func (obj *Device) EndScene() (err Error)

EndScene ends a scene that was begun by calling BeginScene.

func (*Device) EndStateBlock

func (obj *Device) EndStateBlock() (*StateBlock, Error)

EndStateBlock signals Direct3D to stop recording a device-state block and retrieve a pointer to the state block interface.

func (*Device) EvictManagedResources

func (obj *Device) EvictManagedResources() Error

EvictManagedResources evicts all managed resources, including both Direct3D and driver-managed resources.

func (*Device) GetAvailableTextureMem

func (obj *Device) GetAvailableTextureMem() uint

GetAvailableTextureMem returns an estimate of the amount of available texture memory.

func (*Device) GetBackBuffer

func (obj *Device) GetBackBuffer(
	swapChain uint,
	backBuffer uint,
	typ BACKBUFFER_TYPE,
) (*Surface, Error)

GetBackBuffer retrieves a back buffer from the device's swap chain. Call Release on the returned surface when finished using it.

func (*Device) GetClipPlane

func (obj *Device) GetClipPlane(index uint32) (plane [4]float32, err Error)

GetClipPlane retrieves the coefficients of a user-defined clipping plane for the device.

func (*Device) GetClipStatus

func (obj *Device) GetClipStatus() (clipStatus CLIPSTATUS, err Error)

GetClipStatus retrieves the clip status.

func (*Device) GetCreationParameters

func (obj *Device) GetCreationParameters() (DEVICE_CREATION_PARAMETERS, Error)

GetCreationParameters retrieves the creation parameters of the device.

func (*Device) GetCurrentTexturePalette

func (obj *Device) GetCurrentTexturePalette() (paletteNumber uint, err Error)

GetCurrentTexturePalette retrieves the current texture palette.

func (*Device) GetDepthStencilSurface

func (obj *Device) GetDepthStencilSurface() (*Surface, Error)

GetDepthStencilSurface returns the depth-stencil surface owned by the Direct3DDevice object. Call Release on the returned surface when finished using it.

func (*Device) GetDeviceCaps

func (obj *Device) GetDeviceCaps() (CAPS, Error)

GetDeviceCaps retrieves the capabilities of the rendering device.

func (*Device) GetDirect3D

func (obj *Device) GetDirect3D() (d3d *Direct3D, err Error)

GetDirect3D returns an interface to the instance of the Direct3D object that created the device. Call Release on the returned object when finished using it.

func (*Device) GetDisplayMode

func (obj *Device) GetDisplayMode(swapChain uint) (DISPLAYMODE, Error)

GetDisplayMode retrieves the display mode's spatial resolution, color resolution, and refresh frequency.

func (*Device) GetFVF

func (obj *Device) GetFVF() (fvf uint32, err Error)

GetFVF gets the fixed vertex function declaration.

func (*Device) GetFrontBufferData

func (obj *Device) GetFrontBufferData(swapChain uint, destSurface *Surface) Error

GetFrontBufferData generates a copy of the device's front buffer and places that copy in a system memory buffer provided by the application.

func (*Device) GetGammaRamp

func (obj *Device) GetGammaRamp(swapChain uint) GAMMARAMP

GetGammaRamp retrieves the gamma correction ramp for the swap chain.

func (*Device) GetIndices

func (obj *Device) GetIndices() (indexData *IndexBuffer, err Error)

GetIndices retrieves index data.

func (*Device) GetLight

func (obj *Device) GetLight(index uint32) (light LIGHT, err Error)

GetLight retrieves a set of lighting properties that this device uses.

func (*Device) GetLightEnable

func (obj *Device) GetLightEnable(index uint32) (bool, Error)

GetLightEnable retrieves the activity status - enabled or disabled - for a set of lighting parameters within a device.

func (*Device) GetMaterial

func (obj *Device) GetMaterial() (m MATERIAL, err Error)

GetMaterial retrieves the current material properties for the device.

func (*Device) GetNPatchMode

func (obj *Device) GetNPatchMode() float32

GetNPatchMode returns the N-patch mode segments.

func (*Device) GetNumberOfSwapChains

func (obj *Device) GetNumberOfSwapChains() uint

GetNumberOfSwapChains returns the number of implicit swap chains.

func (*Device) GetPaletteEntries

func (obj *Device) GetPaletteEntries(
	paletteNumber uint,
) (entries [256]PALETTEENTRY, err Error)

GetPaletteEntries retrieves palette entries.

func (*Device) GetPixelShader

func (obj *Device) GetPixelShader() (shader *PixelShader, err Error)

GetPixelShader retrieves the currently set pixel shader.

func (*Device) GetPixelShaderConstantB

func (obj *Device) GetPixelShaderConstantB(
	startRegister uint,
	constantData []int32,
) Error

GetPixelShaderConstantB returns a Boolean shader constant. The given bool slice is filled with the constant data.

func (*Device) GetPixelShaderConstantF

func (obj *Device) GetPixelShaderConstantF(
	startRegister uint,
	constantData []float32,
) Error

GetPixelShaderConstantF returns a floating-point shader constant. The given float slice is filled with the constant data. The length of the slice must be a multiple of four.

func (*Device) GetPixelShaderConstantI

func (obj *Device) GetPixelShaderConstantI(
	startRegister uint,
	constantData []int32,
) Error

GetPixelShaderConstantI returns an integer shader constant. The given int slice is filled with the constant data. The length of the slice must be a multiple of four.

func (*Device) GetRasterStatus

func (obj *Device) GetRasterStatus(swapChain uint) (RASTER_STATUS, Error)

GetRasterStatus returns information describing the raster of the monitor on which the swap chain is presented.

func (*Device) GetRenderState

func (obj *Device) GetRenderState(state RENDERSTATETYPE) (value uint32, err Error)

GetRenderState retrieves a render-state value for a device.

func (*Device) GetRenderTarget

func (obj *Device) GetRenderTarget(renderTargetIndex uint32) (*Surface, Error)

GetRenderTarget retrieves a render-target surface.

func (*Device) GetRenderTargetData

func (obj *Device) GetRenderTargetData(renderTarget, destSurface *Surface) Error

GetRenderTargetData copies the render-target data from device memory to system memory.

func (*Device) GetSamplerState

func (obj *Device) GetSamplerState(
	sampler uint32,
	typ SAMPLERSTATETYPE,
) (value uint32, err Error)

GetSamplerState return the sampler state value.

func (*Device) GetScissorRect

func (obj *Device) GetScissorRect() (r RECT, err Error)

GetScissorRect returns the scissor rectangle.

func (*Device) GetSoftwareVertexProcessing

func (obj *Device) GetSoftwareVertexProcessing() bool

GetSoftwareVertexProcessing returns true if software vertex processing is set. Otherwise, it returns false.

func (*Device) GetStreamSource

func (obj *Device) GetStreamSource(
	streamNumber uint,
) (
	streamData *VertexBuffer,
	offsetInBytes uint,
	stride uint,
	err Error,
)

GetStreamSource retrieves a vertex buffer bound to the specified data stream.

func (*Device) GetStreamSourceFreq

func (obj *Device) GetStreamSourceFreq(
	streamNumber uint,
) (divider uint32, err Error)

GetStreamSourceFreq returns the stream source frequency divider value.

func (*Device) GetSwapChain

func (obj *Device) GetSwapChain(swapChain uint) (*SwapChain, Error)

GetSwapChain returns a pointer to a swap chain.

func (*Device) GetTexture

func (obj *Device) GetTexture(stage uint32) (*BaseTexture, Error)

GetTexture retrieves a texture assigned to a stage for a device.

func (*Device) GetTextureStageState

func (obj *Device) GetTextureStageState(
	stage uint32,
	typ TEXTURESTAGESTATETYPE,
) (value uint32, err Error)

GetTextureStageState retrieves a state value for an assigned texture.

func (*Device) GetTransform

func (obj *Device) GetTransform(state TRANSFORMSTATETYPE) (m MATRIX, err Error)

GetTransform retrieves a matrix describing a transformation state.

func (*Device) GetVertexDeclaration

func (obj *Device) GetVertexDeclaration() (decl VertexDeclaration, err Error)

GetVertexDeclaration returns a vertex shader declaration.

func (*Device) GetVertexShader

func (obj *Device) GetVertexShader() (*VertexShader, Error)

GetVertexShader retrieves the currently set vertex shader.

func (*Device) GetVertexShaderConstantB

func (obj *Device) GetVertexShaderConstantB(
	startRegister uint,
	constantData []int32,
) Error

GetVertexShaderConstantB returns a Boolean shader constant. The given bool slice is filled with the constant data.

func (*Device) GetVertexShaderConstantF

func (obj *Device) GetVertexShaderConstantF(
	startRegister uint,
	constantData []float32,
) Error

GetVertexShaderConstantF returns a floating-point shader constant. The given float slice is filled with the constant data. The length of the slice must be a multiple of four.

func (*Device) GetVertexShaderConstantI

func (obj *Device) GetVertexShaderConstantI(
	startRegister uint,
	constantData []int32,
) Error

GetVertexShaderConstantI returns an integer shader constant. The given int slice is filled with the constant data. The length of the slice must be a multiple of four.

func (*Device) GetViewport

func (obj *Device) GetViewport() (v VIEWPORT, err Error)

GetViewport retrieves the viewport parameters currently set for the device.

func (*Device) LightEnable

func (obj *Device) LightEnable(lightIndex uint32, enable bool) Error

LightEnable enables or disables a set of lighting parameters within a device.

func (*Device) MultiplyTransform

func (obj *Device) MultiplyTransform(state TRANSFORMSTATETYPE, m MATRIX) Error

MultiplyTransform multiplies a device's world, view, or projection matrices by a specified matrix.

func (*Device) Present

func (obj *Device) Present(
	sourceRect *RECT,
	destRect *RECT,
	destWindowOverride HWND,
	dirtyRegion *RGNDATA,
) Error

Present presents the contents of the next buffer in the sequence of back buffers owned by the device.

func (*Device) ProcessVertices

func (obj *Device) ProcessVertices(
	srcStartIndex uint,
	destIndex uint,
	vertexCount uint,
	destBuffer *VertexBuffer,
	vertexDecl *VertexDeclaration,
	flags uint32,
) Error

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.

func (*Device) Release

func (obj *Device) Release() uint32

Release has to be called when finished using the object to free its associated resources.

func (*Device) Reset

func (obj *Device) Reset(params PRESENT_PARAMETERS) (PRESENT_PARAMETERS, Error)

Reset resets the type, size, and format of the swap chain.

func (*Device) SetClipPlane

func (obj *Device) SetClipPlane(index uint32, plane [4]float32) Error

SetClipPlane sets the coefficients of a user-defined clipping plane for the device.

func (*Device) SetClipStatus

func (obj *Device) SetClipStatus(clipStatus CLIPSTATUS) Error

SetClipStatus sets the clip status.

func (*Device) SetCurrentTexturePalette

func (obj *Device) SetCurrentTexturePalette(paletteNumber uint) Error

SetCurrentTexturePalette sets the current texture palette.

func (*Device) SetCursorPosition

func (obj *Device) SetCursorPosition(x int, y int, flags uint32)

SetCursorPosition sets the cursor position and update options.

func (*Device) SetCursorProperties

func (obj *Device) SetCursorProperties(
	xHotSpot uint,
	yHotSpot uint,
	cursorBitmap *Surface,
) Error

SetCursorProperties sets properties for the cursor.

func (*Device) SetDepthStencilSurface

func (obj *Device) SetDepthStencilSurface(newZStencil *Surface) (err Error)

SetDepthStencilSurface sets the depth stencil surface.

func (*Device) SetDialogBoxMode

func (obj *Device) SetDialogBoxMode(enableDialogs bool) Error

SetDialogBoxMode allows the use of GDI dialog boxes in full-screen mode applications.

func (*Device) SetFVF

func (obj *Device) SetFVF(fvf uint32) Error

SetFVF sets the current vertex stream declaration.

func (*Device) SetGammaRamp

func (obj *Device) SetGammaRamp(swapChain uint, flags uint32, ramp GAMMARAMP)

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).

func (*Device) SetIndices

func (obj *Device) SetIndices(indexData *IndexBuffer) Error

SetIndices sets index data.

func (*Device) SetLight

func (obj *Device) SetLight(index uint32, light LIGHT) Error

SetLight assigns a set of lighting properties for this device.

func (*Device) SetMaterial

func (obj *Device) SetMaterial(m MATERIAL) Error

SetMaterial sets the material properties for the device.

func (*Device) SetNPatchMode

func (obj *Device) SetNPatchMode(segmentCount float32) Error

SetNPatchMode enables or disables N-patches. segmentCount specifies the number of subdivision segments. If the number of segments is less than 1.0, N-patches are disabled. The default value is 0.0.

func (*Device) SetPaletteEntries

func (obj *Device) SetPaletteEntries(
	paletteNumber uint,
	entries [256]PALETTEENTRY,
) Error

SetPaletteEntries sets palette entries.

func (*Device) SetPixelShader

func (obj *Device) SetPixelShader(shader *PixelShader) Error

SetPixelShader sets the current pixel shader to a previously created pixel shader.

func (*Device) SetPixelShaderConstantB

func (obj *Device) SetPixelShaderConstantB(
	startRegister uint,
	constantData []int32,
) Error

SetPixelShaderConstantB sets a Boolean shader constant.

func (*Device) SetPixelShaderConstantF

func (obj *Device) SetPixelShaderConstantF(
	startRegister uint,
	constantData []float32,
) Error

SetPixelShaderConstantF sets a floating-point shader constant. The length of the slice must be a multiple of four.

func (*Device) SetPixelShaderConstantI

func (obj *Device) SetPixelShaderConstantI(
	startRegister uint,
	constantData []int32,
) Error

SetPixelShaderConstantI sets an integer shader constant. The length of the slice must be a multiple of four.

func (*Device) SetRenderState

func (obj *Device) SetRenderState(state RENDERSTATETYPE, value uint32) Error

SetRenderState sets a single device render-state parameter.

func (*Device) SetRenderStateBool

func (obj *Device) SetRenderStateBool(state RENDERSTATETYPE, value bool) Error

func (*Device) SetRenderStateFloat

func (obj *Device) SetRenderStateFloat(state RENDERSTATETYPE, value float32) Error

func (*Device) SetRenderTarget

func (obj *Device) SetRenderTarget(
	renderTargetIndex uint32,
	renderTarget *Surface,
) Error

SetRenderTarget sets a new color buffer for the device.

func (*Device) SetSamplerState

func (obj *Device) SetSamplerState(
	sampler uint32,
	typ SAMPLERSTATETYPE,
	value uint32,
) Error

SetSamplerState sets the sampler state value.

func (*Device) SetScissorRect

func (obj *Device) SetScissorRect(r RECT) Error

SetScissorRect sets the scissor rectangle.

func (*Device) SetSoftwareVertexProcessing

func (obj *Device) SetSoftwareVertexProcessing(software bool) Error

SetSoftwareVertexProcessing can be used to switch between software and hardware vertex processing.

func (*Device) SetStreamSource

func (obj *Device) SetStreamSource(
	streamNumber uint,
	streamData *VertexBuffer,
	offsetInBytes uint,
	stride uint,
) Error

SetStreamSource binds a vertex buffer to a device data stream.

func (*Device) SetStreamSourceFreq

func (obj *Device) SetStreamSourceFreq(
	streamNumber uint,
	frequencyParameter uint,
) Error

SetStreamSourceFreq sets the stream source frequency divider value. This may be used to draw several instances of geometry.

func (*Device) SetTexture

func (obj *Device) SetTexture(sampler uint32, texture BaseTextureImpl) Error

SetTexture assigns a texture to a stage for a device.

func (*Device) SetTextureStageState

func (obj *Device) SetTextureStageState(
	stage uint32,
	typ TEXTURESTAGESTATETYPE,
	value uint32,
) Error

SetTextureStageState sets the state value for the currently assigned texture.

func (*Device) SetTransform

func (obj *Device) SetTransform(state TRANSFORMSTATETYPE, matrix MATRIX) Error

SetTransform sets a single device transformation-related state.

func (*Device) SetVertexDeclaration

func (obj *Device) SetVertexDeclaration(decl *VertexDeclaration) Error

SetVertexDeclaration sets a vertex declaration.

func (*Device) SetVertexShader

func (obj *Device) SetVertexShader(shader *VertexShader) Error

SetVertexShader sets the vertex shader.

func (*Device) SetVertexShaderConstantB

func (obj *Device) SetVertexShaderConstantB(
	startRegister uint,
	constantData []int32,
) Error

SetVertexShaderConstantB sets a Boolean vertex shader constant.

func (*Device) SetVertexShaderConstantF

func (obj *Device) SetVertexShaderConstantF(
	startRegister uint,
	constantData []float32,
) Error

SetVertexShaderConstantF sets a floating-point vertex shader constant. The length of the slice must be a multiple of four.

func (*Device) SetVertexShaderConstantI

func (obj *Device) SetVertexShaderConstantI(
	startRegister uint,
	constantData []int32,
) Error

SetVertexShaderConstantI sets an integer vertex shader constant. The length of the slice must be a multiple of four.

func (*Device) SetViewport

func (obj *Device) SetViewport(v VIEWPORT) Error

SetViewport sets the viewport parameters for the device.

func (*Device) ShowCursor

func (obj *Device) ShowCursor(show bool) bool

ShowCursor displays or hides the cursor.

func (*Device) StretchRect

func (obj *Device) StretchRect(
	sourceSurface *Surface,
	sourceRect *RECT,
	destSurface *Surface,
	destRect *RECT,
	filter TEXTUREFILTERTYPE,
) Error

StretchRect copies 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.

func (*Device) TestCooperativeLevel

func (obj *Device) TestCooperativeLevel() Error

TestCooperativeLevel reports the current cooperative-level status of the Direct3D device for a windowed or full-screen application.

func (*Device) UpdateSurface

func (obj *Device) UpdateSurface(
	sourceSurface *Surface,
	sourceRect *RECT,
	destSurface *Surface,
	destPoint *POINT,
) Error

UpdateSurface copies rectangular subsets of pixels from one surface to another.

func (*Device) UpdateTexture

func (obj *Device) UpdateTexture(sourceTexture, destTexture *BaseTexture) Error

UpdateTexture updates the dirty portions of a texture.

func (*Device) ValidateDevice

func (obj *Device) ValidateDevice() (numPasses uint32, err Error)

ValidateDevice reports the device's ability to render the current texture-blending operations and arguments in a single pass.

type Direct3D

type Direct3D struct {
	// contains filtered or unexported fields
}

Direct3D and its methods are used to create Direct3D objects and set up the environment. Its interface includes methods for enumerating and retrieving capabilities of the device.

func Create

func Create(version uint) (*Direct3D, error)

Create takes the SDK version as argument and returns a new Direct3D object. Use SDK_VERSION as the parameter.

func (*Direct3D) AddRef added in v1.0.1

func (obj *Direct3D) AddRef() uint32

AddRef increments the reference count for an interface on an object. This method should be called for every new copy of a pointer to an interface on an object.

func (*Direct3D) CheckDepthStencilMatch

func (obj *Direct3D) CheckDepthStencilMatch(
	adapter uint,
	deviceType DEVTYPE,
	adapterFormat FORMAT,
	renderTargetFormat FORMAT,
	depthStencilFormat FORMAT,
) Error

CheckDepthStencilMatch determines whether a depth-stencil format is compatible with a render-target format in a particular display mode.

func (*Direct3D) CheckDeviceFormat

func (obj *Direct3D) CheckDeviceFormat(
	adapter uint,
	deviceType DEVTYPE,
	adapterFormat FORMAT,
	usage uint32,
	resType RESOURCETYPE,
	checkFormat FORMAT,
) Error

CheckDeviceFormat determines whether a surface format is available as a specified resource type and can be used as a texture, depth-stencil buffer, or render target, or any combination of the three, on a device representing this adapter.

func (*Direct3D) CheckDeviceFormatConversion

func (obj *Direct3D) CheckDeviceFormatConversion(
	adapter uint,
	deviceType DEVTYPE,
	sourceFormat FORMAT,
	targetFormat FORMAT,
) Error

CheckDeviceFormatConversion tests the device to see if it supports conversion from one display format to another.

func (*Direct3D) CheckDeviceMultiSampleType

func (obj *Direct3D) CheckDeviceMultiSampleType(
	adapter uint,
	deviceType DEVTYPE,
	surfaceFormat FORMAT,
	windowed bool,
	multiSampleType MULTISAMPLE_TYPE,
) (qualityLevels uint32, err Error)

CheckDeviceMultiSampleType determines if a multisampling technique is available on this device.

func (*Direct3D) CheckDeviceType

func (obj *Direct3D) CheckDeviceType(
	adapter uint,
	deviceType DEVTYPE,
	displayFormat FORMAT,
	backBufferFormat FORMAT,
	windowed bool,
) Error

CheckDeviceType verifies whether a hardware accelerated device type can be used on this adapter.

func (*Direct3D) CreateDevice

func (obj *Direct3D) CreateDevice(
	adapter uint,
	deviceType DEVTYPE,
	focusWindow HWND,
	behaviorFlags uint32,
	params PRESENT_PARAMETERS,
) (*Device, PRESENT_PARAMETERS, Error)

CreateDevice creates a device to represent the display adapter.

func (*Direct3D) EnumAdapterModes

func (obj *Direct3D) EnumAdapterModes(
	adapter uint,
	format FORMAT,
	mode uint,
) (displayMode DISPLAYMODE, err Error)

EnumAdapterModes queries the device to determine whether the specified adapter supports the requested format and display mode. This method could be used in a loop to enumerate all the available adapter modes.

Allowed formats are as follows:

FMT_A1R5G5B5
FMT_A2R10G10B10
FMT_A8R8G8B8
FMT_R5G6B5
FMT_X1R5G5B5
FMT_X8R8G8B8

EnumAdapterModes treats pixel formats 565 and 555 as equivalent, and returns the correct version. The difference comes into play only when the application locks the back buffer and there is an explicit flag that the application must set in order to accomplish this.

func (*Direct3D) GetAdapterCount

func (obj *Direct3D) GetAdapterCount() uint

GetAdapterCount returns the number of adapters on the system.

func (*Direct3D) GetAdapterDisplayMode

func (obj *Direct3D) GetAdapterDisplayMode(
	adapter uint,
) (mode DISPLAYMODE, err Error)

GetAdapterDisplayMode retrieves the current display mode of the adapter.

func (*Direct3D) GetAdapterIdentifier

func (obj *Direct3D) GetAdapterIdentifier(
	adapter uint,
	flags uint32,
) (id ADAPTER_IDENTIFIER, err Error)

GetAdapterIdentifier describes the physical display adapters present in the system when the IDirect3D9 interface was instantiated. Adapter must be a value from 0 to GetAdapterCount()-1.

func (*Direct3D) GetAdapterModeCount

func (obj *Direct3D) GetAdapterModeCount(adapter uint, format FORMAT) uint

GetAdapterModeCount returns the number of display modes available on this adapter.

func (*Direct3D) GetAdapterMonitor

func (obj *Direct3D) GetAdapterMonitor(adapter uint) HMONITOR

GetAdapterMonitor returns the handle of the monitor associated with the Direct3D object.

func (*Direct3D) GetDeviceCaps

func (obj *Direct3D) GetDeviceCaps(
	adapter uint,
	deviceType DEVTYPE,
) (caps CAPS, err Error)

GetDeviceCaps retrieves device-specific information about a device.

func (*Direct3D) RegisterSoftwareDevice

func (obj *Direct3D) RegisterSoftwareDevice(initFunc uintptr) Error

RegisterSoftwareDevice registers a pluggable software device. Software devices provide software rasterization enabling applications to access a variety of software rasterizers.

func (*Direct3D) Release

func (obj *Direct3D) Release() uint32

Release has to be called when finished using the object to free its associated resources.

type Error

type Error interface {
	error
	// Code returns the Direct3D error code for a function. Call this function
	// only if the Error is not nil, if the error code is D3D_OK or any other
	// code that signifies success, a function will return nil as the Error
	// instead of a non-nil error with that code in it. This way, functions
	// behave in a standard Go way, returning nil as the error in case of
	// success and only returning non-nil errors if something went wrong.
	Code() int32
}

Error is returned by all Direct3D9 functions. It encapsulates the error code returned by Direct3D. If a function succeeds it will return nil as the Error and if it fails you can retrieve the error code using the Code() function. You can check the result against the predefined error codes (like ERR_DEVICELOST, E_OUTOFMEMORY etc).

type FILLMODE

type FILLMODE uint32

FILLMODE defines constants describing the fill mode.

type FOGMODE

type FOGMODE uint32

FOGMODE defines constants that describe the fog mode.

type FORMAT

type FORMAT uint32

FORMAT defines the various types of surface formats.

func (FORMAT) String added in v1.2.0

func (f FORMAT) String() string

type GAMMARAMP

type GAMMARAMP struct {
	Red   [256]uint16
	Green [256]uint16
	Blue  [256]uint16
}

GAMMARAMP contains red, green, and blue ramp data.

type GUID

type GUID struct {
	Data1 uint32
	Data2 uint16
	Data3 uint16
	Data4 [8]uint8
}

GUID is a globally unique identifier.

type HANDLE added in v1.0.1

type HANDLE uintptr

type HDC added in v1.0.1

type HDC HANDLE

type HMONITOR added in v1.0.1

type HMONITOR HANDLE

type HWND added in v1.0.1

type HWND HANDLE

type INDEXBUFFER_DESC

type INDEXBUFFER_DESC struct {
	Format FORMAT
	Type   RESOURCETYPE
	Usage  uint32
	Pool   POOL
	Size   uint32
}

INDEXBUFFER_DESC describes an index buffer.

type IndexBuffer

type IndexBuffer struct {
	// contains filtered or unexported fields
}

IndexBuffer and its methods are used to manipulate an index buffer resource.

func (*IndexBuffer) AddRef added in v1.0.1

func (obj *IndexBuffer) AddRef() uint32

AddRef increments the reference count for an interface on an object. This method should be called for every new copy of a pointer to an interface on an object.

func (*IndexBuffer) FreePrivateData added in v1.0.1

func (obj *IndexBuffer) FreePrivateData(refguid GUID) Error

FreePrivateData frees the specified private data associated with this resource.

func (*IndexBuffer) GetDesc

func (obj *IndexBuffer) GetDesc() (desc INDEXBUFFER_DESC, err Error)

GetDesc retrieves a description of the index buffer resource.

func (*IndexBuffer) GetDevice added in v1.0.1

func (obj *IndexBuffer) GetDevice() (device *Device, err Error)

GetDevice retrieves the device associated with a resource. Call Release on the returned device when finished using it.

func (*IndexBuffer) GetPriority added in v1.0.1

func (obj *IndexBuffer) GetPriority() uint32

GetPriority retrieves the priority for this resource.

func (*IndexBuffer) GetPrivateData added in v1.0.1

func (obj *IndexBuffer) GetPrivateData(refguid GUID) (data []byte, err Error)

GetPrivateData copies the private data associated with the resource to a provided buffer.

func (*IndexBuffer) GetType added in v1.0.1

func (obj *IndexBuffer) GetType() RESOURCETYPE

GetType returns the type of the resource.

func (*IndexBuffer) Lock

func (obj *IndexBuffer) Lock(
	offsetToLock uint,
	sizeToLock uint,
	flags uint32,
) (data IndexBufferMemory, err Error)

Lock locks a range of index data and obtains a pointer to the index buffer memory.

func (*IndexBuffer) PreLoad added in v1.0.1

func (obj *IndexBuffer) PreLoad()

PreLoad preloads a managed resource.

func (*IndexBuffer) Release

func (obj *IndexBuffer) Release() uint32

Release has to be called when finished using the object to free its associated resources.

func (*IndexBuffer) SetPriority added in v1.0.1

func (obj *IndexBuffer) SetPriority(priorityNew uint32) uint32

SetPriority assigns the priority of a resource for scheduling purposes.

func (*IndexBuffer) SetPrivateData added in v1.0.1

func (obj *IndexBuffer) SetPrivateData(
	refguid GUID,
	data uintptr,
	sizeOfData uint32,
	flags uint32,
) Error

SetPrivateData associates data with the resource that is intended for use by the application, not by Direct3D. Data is passed by value, and multiple sets of data can be associated with a single resource.

func (*IndexBuffer) SetPrivateDataBytes added in v1.0.1

func (obj *IndexBuffer) SetPrivateDataBytes(
	refguid GUID,
	data []byte,
	flags uint32,
) Error

SetPrivateDataBytes associates data with the resource that is intended for use by the application, not by Direct3D. Data is passed by value, and multiple sets of data can be associated with a single resource.

func (*IndexBuffer) Unlock

func (obj *IndexBuffer) Unlock() Error

Unlock unlocks index data.

type IndexBufferMemory

type IndexBufferMemory struct {
	Memory uintptr
}

IndexBufferMemory encapsulates a raw memory pointer and provides methods to get and set typical slice types.

func (IndexBufferMemory) GetUint16s

func (m IndexBufferMemory) GetUint16s(offsetInBytes int, data []uint16)

GetUint16s copies data from memory to the given slice, starting at the given offset in bytes.

func (IndexBufferMemory) GetUint32s

func (m IndexBufferMemory) GetUint32s(offsetInBytes int, data []uint32)

GetUint32s copies data from memory to the given slice, starting at the given offset in bytes.

func (IndexBufferMemory) GetUint8s added in v1.0.1

func (m IndexBufferMemory) GetUint8s(offsetInBytes int, data []uint8)

GetUint8s copies data from memory to the given slice, starting at the given offset in bytes.

func (IndexBufferMemory) SetUint16s

func (m IndexBufferMemory) SetUint16s(offsetInBytes int, data []uint16)

SetUint16s copies the given slice to the memory, starting at the given offset in bytes.

func (IndexBufferMemory) SetUint32s

func (m IndexBufferMemory) SetUint32s(offsetInBytes int, data []uint32)

SetUint32s copies the given slice to the memory, starting at the given offset in bytes.

func (IndexBufferMemory) SetUint8s added in v1.0.1

func (m IndexBufferMemory) SetUint8s(offsetInBytes int, data []uint8)

SetUint8s copies the given slice to the memory, starting at the given offset in bytes.

type LIGHT

type LIGHT struct {
	Type         LIGHTTYPE
	Diffuse      COLORVALUE
	Specular     COLORVALUE
	Ambient      COLORVALUE
	Position     VECTOR
	Direction    VECTOR
	Range        float32
	Falloff      float32
	Attenuation0 float32
	Attenuation1 float32
	Attenuation2 float32
	Theta        float32
	Phi          float32
}

LIGHT defines a set of lighting properties.

type LIGHTTYPE

type LIGHTTYPE uint32

LIGHTTYPE defines the light type.

type LOCKED_BOX

type LOCKED_BOX struct {
	RowPitch   int32
	SlicePitch int32
	PBits      uintptr
}

LOCKED_BOX describes a locked box (volume).

type LOCKED_RECT

type LOCKED_RECT struct {
	Pitch int32
	PBits uintptr
}

LOCKED_RECT describes a locked rectangular region.

func (LOCKED_RECT) SetAllBytes

func (r LOCKED_RECT) SetAllBytes(data []byte, srcStride int)

SetAllBytes will fill the whole rect with the given data, taking into account the rect's pitch. The given byte slice is expected to have the given stride in bytes, i.e. one line in the given data is <srcStride> bytes in length.

type LUID

type LUID struct {
	LowPart  uint32
	HighPart int32
}

LUID is a 64-bit value guaranteed to be unique only on the system on which it was generated. The uniqueness of a locally unique identifier (LUID) is guaranteed only until the system is restarted.

type MATERIAL

type MATERIAL struct {
	Diffuse  COLORVALUE
	Ambient  COLORVALUE
	Specular COLORVALUE
	Emissive COLORVALUE
	Power    float32
}

MATERIAL specifies material properties.

type MATERIALCOLORSOURCE

type MATERIALCOLORSOURCE uint32

MATERIALCOLORSOURCE defines the location at which a color or color component must be accessed for lighting calculations.

type MATRIX

type MATRIX [16]float32

MATRIX describes a matrix.

type MULTISAMPLE_TYPE

type MULTISAMPLE_TYPE uint32

MULTISAMPLE_TYPE defines the levels of full-scene multisampling that the device can apply.

type PALETTEENTRY

type PALETTEENTRY struct {
	PeRed   byte
	PeGreen byte
	PeBlue  byte
	PeFlags byte
}

PALETTEENTRY specifies the color and usage of an entry in a logical palette.

type PATCHEDGESTYLE

type PATCHEDGESTYLE uint32

PATCHEDGESTYLE defines whether the current tessellation mode is discrete or continuous.

type POINT

type POINT struct {
	X int32
	Y int32
}

POINT describes a 2D point.

type POOL

type POOL uint32

POOL defines the memory class that holds the buffers for a resource.

type PRESENT_PARAMETERS

type PRESENT_PARAMETERS struct {
	BackBufferWidth            uint32
	BackBufferHeight           uint32
	BackBufferFormat           FORMAT
	BackBufferCount            uint32
	MultiSampleType            MULTISAMPLE_TYPE
	MultiSampleQuality         uint32
	SwapEffect                 SWAPEFFECT
	HDeviceWindow              HWND
	Windowed                   int32
	EnableAutoDepthStencil     int32
	AutoDepthStencilFormat     FORMAT
	Flags                      uint32
	FullScreen_RefreshRateInHz uint32
	PresentationInterval       uint32
}

PRESENT_PARAMETERS describes the presentation parameters.

type PRIMITIVETYPE

type PRIMITIVETYPE uint32

PRIMITIVETYPE defines the primitives supported by Direct3D.

type PSHADERCAPS2_0

type PSHADERCAPS2_0 struct {
	Caps                    uint32
	DynamicFlowControlDepth int32
	NumTemps                int32
	StaticFlowControlDepth  int32
	NumInstructionSlots     int32
}

PSHADERCAPS2_0 describes pixel shader driver caps.

type PixelShader

type PixelShader struct {
	// contains filtered or unexported fields
}

PixelShader and its methods are used to manipulate a pixel shader resource.

func (*PixelShader) AddRef added in v1.0.1

func (obj *PixelShader) AddRef() uint32

AddRef increments the reference count for an interface on an object. This method should be called for every new copy of a pointer to an interface on an object.

func (*PixelShader) GetDevice

func (obj *PixelShader) GetDevice() (device *Device, err Error)

GetDevice retrieves the associated device. Call Release on the returned device when finished using it.

func (*PixelShader) GetFunction

func (obj *PixelShader) GetFunction() (data []byte, err Error)

GetFunction returns the shader data.

func (*PixelShader) Release

func (obj *PixelShader) Release() uint32

Release has to be called when finished using the object to free its associated resources.

type QUERYTYPE

type QUERYTYPE byte

QUERYTYPE identifies the query type.

type Query

type Query struct {
	// contains filtered or unexported fields
}

Query and its methods are used to perform asynchronous queries on a driver.

func (*Query) AddRef added in v1.0.1

func (obj *Query) AddRef() uint32

AddRef increments the reference count for an interface on an object. This method should be called for every new copy of a pointer to an interface on an object.

func (*Query) GetData

func (obj *Query) GetData(data []byte, flags uint32) Error

GetData polls a queried resource to get the query state or a query result.

func (*Query) GetDataSize

func (obj *Query) GetDataSize() uint32

GetDataSize returns the number of bytes in the query data.

func (*Query) GetDevice

func (obj *Query) GetDevice() (device *Device, err Error)

GetDevice retrieves the associated device. Call Release on the returned device when finished using it.

func (*Query) GetType

func (obj *Query) GetType() QUERYTYPE

GetType returns the query type.

func (*Query) Issue

func (obj *Query) Issue(issueFlags uint32) Error

Issue issues a query.

func (*Query) Release

func (obj *Query) Release() uint32

Release has to be called when finished using the object to free its associated resources.

type RANGE

type RANGE struct {
	Offset uint32
	Size   uint32
}

RANGE defines a range.

type RASTER_STATUS

type RASTER_STATUS struct {
	InVBlank int32
	ScanLine uint32
}

RASTER_STATUS describes the raster status.

type RECT

type RECT struct {
	Left   int32
	Top    int32
	Right  int32
	Bottom int32
}

RECT describes a rectangle.

type RECTPATCH_INFO

type RECTPATCH_INFO struct {
	StartVertexOffsetWidth  uint32
	StartVertexOffsetHeight uint32
	Width                   uint32
	Height                  uint32
	Stride                  uint32
	Basis                   BASISTYPE
	Degree                  DEGREETYPE
}

RECTPATCH_INFO describes a rectangular high-order patch.

type RENDERSTATETYPE

type RENDERSTATETYPE uint32

RENDERSTATETYPE defines set-up states for all kinds of vertex and pixel processing. Some render states set up vertex processing, and some set up pixel processing. Render states can be saved and restored using stateblocks.

type RESOURCESTATS

type RESOURCESTATS struct {
	BThrashing            uint32
	ApproxBytesDownloaded uint32
	NumEvicts             uint32
	NumVidCreates         uint32
	LastPri               uint32
	NumUsed               uint32
	NumUsedInVidMem       uint32
	WorkingSet            uint32
	WorkingSetBytes       uint32
	TotalManaged          uint32
	TotalBytes            uint32
}

RESOURCESTATS contains resource statistics gathered by the DEVINFO_ResourceManager when using the asynchronous query mechanism.

type RESOURCETYPE

type RESOURCETYPE uint32

RESOURCETYPE defines resource types.

type RGNDATA

type RGNDATA struct {
	Rdh    RGNDATAHEADER
	Buffer [1]byte
}

RGNDATA contains region data.

type RGNDATAHEADER

type RGNDATAHEADER struct {
	DwSize   uint32
	IType    uint32
	NCount   uint32
	NRgnSize uint32
	RcBound  RECT
}

RGNDATAHEADER describes region data.

type Resource

type Resource struct {
	// contains filtered or unexported fields
}

Resource and its methods are used to query and prepare resources.

func (*Resource) AddRef added in v1.0.1

func (obj *Resource) AddRef() uint32

AddRef increments the reference count for an interface on an object. This method should be called for every new copy of a pointer to an interface on an object.

func (*Resource) FreePrivateData

func (obj *Resource) FreePrivateData(refguid GUID) Error

FreePrivateData frees the specified private data associated with this resource.

func (*Resource) GetDevice

func (obj *Resource) GetDevice() (device *Device, err Error)

GetDevice retrieves the device associated with a resource. Call Release on the returned device when finished using it.

func (*Resource) GetPriority

func (obj *Resource) GetPriority() uint32

GetPriority retrieves the priority for this resource.

func (*Resource) GetPrivateData

func (obj *Resource) GetPrivateData(refguid GUID) (data []byte, err Error)

GetPrivateData copies the private data associated with the resource to a provided buffer.

func (*Resource) GetType

func (obj *Resource) GetType() RESOURCETYPE

GetType returns the type of the resource.

func (*Resource) PreLoad

func (obj *Resource) PreLoad()

PreLoad preloads a managed resource.

func (*Resource) Release

func (obj *Resource) Release() uint32

Release has to be called when finished using the object to free its associated resources.

func (*Resource) SetPriority

func (obj *Resource) SetPriority(priorityNew uint32) uint32

SetPriority assigns the priority of a resource for scheduling purposes.

func (*Resource) SetPrivateData

func (obj *Resource) SetPrivateData(
	refguid GUID,
	data uintptr,
	sizeOfData uint32,
	flags uint32,
) Error

SetPrivateData associates data with the resource that is intended for use by the application, not by Direct3D. Data is passed by value, and multiple sets of data can be associated with a single resource.

func (*Resource) SetPrivateDataBytes

func (obj *Resource) SetPrivateDataBytes(
	refguid GUID,
	data []byte,
	flags uint32,
) Error

SetPrivateDataBytes associates data with the resource that is intended for use by the application, not by Direct3D. Data is passed by value, and multiple sets of data can be associated with a single resource.

type SAMPLERSTATETYPE

type SAMPLERSTATETYPE uint32

SAMPLERSTATETYPE defines texture sampling operations such as texture addressing and texture filtering. Some sampler states set-up vertex processing, and some set-up pixel processing. Sampler states can be saved and restored using stateblocks.

type SAMPLER_TEXTURE_TYPE

type SAMPLER_TEXTURE_TYPE uint32

SAMPLER_TEXTURE_TYPE defines the sampler texture types for vertex shaders.

type SHADEMODE

type SHADEMODE uint32

SHADEMODE defines constants that describe the supported shading modes.

type STATEBLOCKTYPE

type STATEBLOCKTYPE uint32

STATEBLOCKTYPE predefines sets of pipeline state used by state blocks.

type STENCILOP

type STENCILOP uint32

STENCILOP defines stencil-buffer operations.

type SURFACE_DESC

type SURFACE_DESC struct {
	Format             FORMAT
	Type               RESOURCETYPE
	Usage              uint32
	Pool               POOL
	MultiSampleType    MULTISAMPLE_TYPE
	MultiSampleQuality uint32
	Width              uint32
	Height             uint32
}

SURFACE_DESC describes a surface.

type SWAPEFFECT

type SWAPEFFECT uint32

SWAPEFFECT defines swap effects.

type StateBlock

type StateBlock struct {
	// contains filtered or unexported fields
}

StateBlock and its methods are used to encapsulate render states.

func (*StateBlock) AddRef added in v1.0.1

func (obj *StateBlock) AddRef() uint32

AddRef increments the reference count for an interface on an object. This method should be called for every new copy of a pointer to an interface on an object.

func (*StateBlock) Apply

func (obj *StateBlock) Apply() Error

Apply applies the state block to the current device state.

func (*StateBlock) Capture

func (obj *StateBlock) Capture() Error

Capture captures the current value of states that are included in a stateblock.

func (*StateBlock) GetDevice

func (obj *StateBlock) GetDevice() (device *Device, err Error)

GetDevice retrieves the associated device. Call Release on the returned device when finished using it.

func (*StateBlock) Release

func (obj *StateBlock) Release() uint32

Release has to be called when finished using the object to free its associated resources.

type Surface

type Surface struct {
	// contains filtered or unexported fields
}

Surface and its methods are used to query and prepare surfaces.

func (*Surface) AddRef added in v1.0.1

func (obj *Surface) AddRef() uint32

AddRef increments the reference count for an interface on an object. This method should be called for every new copy of a pointer to an interface on an object.

func (*Surface) FreePrivateData added in v1.0.1

func (obj *Surface) FreePrivateData(refguid GUID) Error

FreePrivateData frees the specified private data associated with this resource.

func (*Surface) GetContainerCubeTexture

func (obj *Surface) GetContainerCubeTexture(riid GUID) (tex *CubeTexture, err Error)

GetContainerCubeTexture provides access to the parent cube texture.

func (Surface) GetContainerSwapChain

func (obj Surface) GetContainerSwapChain(riid GUID) (chain *SwapChain, err Error)

GetContainerSwapChain provides access to the parent swap chain if this surface is a back buffer.

func (*Surface) GetContainerTexture

func (obj *Surface) GetContainerTexture(riid GUID) (tex *Texture, err Error)

GetContainerTexture provides access to the parent texture.

func (*Surface) GetDC

func (obj *Surface) GetDC() (hdc HDC, err Error)

GetDC retrieves a device context.

func (*Surface) GetDesc

func (obj *Surface) GetDesc() (desc SURFACE_DESC, err Error)

GetDesc retrieves a description of the surface.

func (*Surface) GetDevice added in v1.0.1

func (obj *Surface) GetDevice() (device *Device, err Error)

GetDevice retrieves the device associated with a resource. Call Release on the returned device when finished using it.

func (*Surface) GetPriority added in v1.0.1

func (obj *Surface) GetPriority() uint32

GetPriority retrieves the priority for this resource.

func (*Surface) GetPrivateData added in v1.0.1

func (obj *Surface) GetPrivateData(refguid GUID) (data []byte, err Error)

GetPrivateData copies the private data associated with the resource to a provided buffer.

func (*Surface) GetType added in v1.0.1

func (obj *Surface) GetType() RESOURCETYPE

GetType returns the type of the resource.

func (*Surface) LockRect

func (obj *Surface) LockRect(
	rect *RECT,
	flags uint32,
) (lockedRect LOCKED_RECT, err Error)

LockRect locks a rectangle on a surface.

func (*Surface) PreLoad added in v1.0.1

func (obj *Surface) PreLoad()

PreLoad preloads a managed resource.

func (*Surface) Release

func (obj *Surface) Release() uint32

Release has to be called when finished using the object to free its associated resources.

func (*Surface) ReleaseDC

func (obj *Surface) ReleaseDC(hdc HDC) Error

ReleaseDC releases a device context handle.

func (*Surface) SetPriority added in v1.0.1

func (obj *Surface) SetPriority(priorityNew uint32) uint32

SetPriority assigns the priority of a resource for scheduling purposes.

func (*Surface) SetPrivateData added in v1.0.1

func (obj *Surface) SetPrivateData(
	refguid GUID,
	data uintptr,
	sizeOfData uint32,
	flags uint32,
) Error

SetPrivateData associates data with the resource that is intended for use by the application, not by Direct3D. Data is passed by value, and multiple sets of data can be associated with a single resource.

func (*Surface) SetPrivateDataBytes added in v1.0.1

func (obj *Surface) SetPrivateDataBytes(
	refguid GUID,
	data []byte,
	flags uint32,
) Error

SetPrivateDataBytes associates data with the resource that is intended for use by the application, not by Direct3D. Data is passed by value, and multiple sets of data can be associated with a single resource.

func (*Surface) UnlockRect

func (obj *Surface) UnlockRect() Error

UnlockRect unlocks a rectangle on a surface.

type SwapChain

type SwapChain struct {
	// contains filtered or unexported fields
}

SwapChain and its methods are used to manipulate a swap chain.

func (*SwapChain) AddRef added in v1.0.1

func (obj *SwapChain) AddRef() uint32

AddRef increments the reference count for an interface on an object. This method should be called for every new copy of a pointer to an interface on an object.

func (*SwapChain) GetBackBuffer

func (obj *SwapChain) GetBackBuffer(
	backBuffer uint,
	typ BACKBUFFER_TYPE,
) (buffer *Surface, err Error)

GetBackBuffer retrieves a back buffer from the swap chain of the device. Call Release on the returned surface when finished using it.

func (*SwapChain) GetDevice

func (obj *SwapChain) GetDevice() (device *Device, err Error)

GetDevice retrieves the device associated with the swap chain. Call Release on the returned device when finished using it.

func (*SwapChain) GetDisplayMode

func (obj *SwapChain) GetDisplayMode() (mode DISPLAYMODE, err Error)

GetDisplayMode retrieves the display mode's spatial resolution, color resolution, and refresh frequency.

func (*SwapChain) GetFrontBufferData

func (obj *SwapChain) GetFrontBufferData(destSurface *Surface) Error

GetFrontBufferData generates a copy of the swapchain's front buffer and places that copy in a system memory buffer provided by the application. Call Release on the returned surface when finished using it.

func (*SwapChain) GetPresentParameters

func (obj *SwapChain) GetPresentParameters() (params PRESENT_PARAMETERS, err Error)

GetPresentParameters retrieves the presentation parameters associated with a swap chain.

func (*SwapChain) GetRasterStatus

func (obj *SwapChain) GetRasterStatus() (status RASTER_STATUS, err Error)

GetRasterStatus returns information describing the raster of the monitor on which the swap chain is presented.

func (*SwapChain) Present

func (obj *SwapChain) Present(
	sourceRect *RECT,
	destRect *RECT,
	destWindowOverride HWND,
	dirtyRegion *RGNDATA,
	flags uint32,
) Error

Present presents the contents of the next buffer in the sequence of back buffers owned by the swap chain.

func (*SwapChain) Release

func (obj *SwapChain) Release() uint32

Release has to be called when finished using the object to free its associated resources.

type TEXTUREADDRESS

type TEXTUREADDRESS uint32

TEXTUREADDRESS defines constants that describe the supported texture-addressing modes.

type TEXTUREFILTERTYPE

type TEXTUREFILTERTYPE uint32

TEXTUREFILTERTYPE defines texture filtering modes for a texture stage.

type TEXTUREOP

type TEXTUREOP uint32

TEXTUREOP defines per-stage texture-blending operations.

type TEXTURESTAGESTATETYPE

type TEXTURESTAGESTATETYPE uint32

TEXTURESTAGESTATETYPE defines multi-blender texture operations. Some sampler states set up vertex processing, and some set up pixel processing. Texture stage states can be saved and restored using stateblocks.

type TEXTURETRANSFORMFLAGS

type TEXTURETRANSFORMFLAGS uint32

TEXTURETRANSFORMFLAGS defines texture coordinate transformation values.

type TRANSFORMSTATETYPE

type TRANSFORMSTATETYPE uint32

TRANSFORMSTATETYPE defines constants that describe transformation state values.

func TSWorldMatrix

func TSWorldMatrix(index int) TRANSFORMSTATETYPE

TSWorldMatrix maps indices in the range 0 through 255 to the corresponding transform states.

type TRIPATCH_INFO

type TRIPATCH_INFO struct {
	StartVertexOffset uint32
	NumVertices       uint32
	Basis             BASISTYPE
	Degree            DEGREETYPE
}

TRIPATCH_INFO describes a triangular high-order patch.

type Texture

type Texture struct {
	// contains filtered or unexported fields
}

Texture and its methods are used to manipulate a texture resource.

func (*Texture) AddDirtyRect

func (obj *Texture) AddDirtyRect(dirtyRect *RECT) Error

AddDirtyRect adds a dirty region to a texture resource.

func (*Texture) AddRef added in v1.0.1

func (obj *Texture) AddRef() uint32

AddRef increments the reference count for an interface on an object. This method should be called for every new copy of a pointer to an interface on an object.

func (*Texture) FreePrivateData added in v1.0.1

func (obj *Texture) FreePrivateData(refguid GUID) Error

FreePrivateData frees the specified private data associated with this resource.

func (*Texture) GenerateMipSubLevels added in v1.0.1

func (obj *Texture) GenerateMipSubLevels()

GenerateMipSubLevels generates mip sub levels.

func (*Texture) GetAutoGenFilterType added in v1.0.1

func (obj *Texture) GetAutoGenFilterType() TEXTUREFILTERTYPE

GetAutoGenFilterType returns the filter type that is used for automatically generated mipmap sublevels.

func (*Texture) GetDevice added in v1.0.1

func (obj *Texture) GetDevice() (device *Device, err Error)

GetDevice retrieves the device associated with a resource. Call Release on the returned device when finished using it.

func (*Texture) GetLOD added in v1.0.1

func (obj *Texture) GetLOD() uint32

GetLOD returns a value clamped to the maximum level-of-detail set for a managed texture (this method is not supported for an unmanaged texture).

func (*Texture) GetLevelCount added in v1.0.1

func (obj *Texture) GetLevelCount() uint32

GetLevelCount returns the number of texture levels in a multilevel texture.

func (*Texture) GetLevelDesc

func (obj *Texture) GetLevelDesc(level uint) (desc SURFACE_DESC, err Error)

GetLevelDesc retrieves a level description of a texture resource.

func (*Texture) GetPriority added in v1.0.1

func (obj *Texture) GetPriority() uint32

GetPriority retrieves the priority for this resource.

func (*Texture) GetPrivateData added in v1.0.1

func (obj *Texture) GetPrivateData(refguid GUID) (data []byte, err Error)

GetPrivateData copies the private data associated with the resource to a provided buffer.

func (*Texture) GetSurfaceLevel

func (obj *Texture) GetSurfaceLevel(level uint) (surface *Surface, err Error)

GetSurfaceLevel retrieves the specified texture surface level.

func (*Texture) GetType added in v1.0.1

func (obj *Texture) GetType() RESOURCETYPE

GetType returns the type of the resource.

func (*Texture) LockRect

func (obj *Texture) LockRect(
	level uint,
	rect *RECT,
	flags uint32,
) (lockedRect LOCKED_RECT, err Error)

LockRect locks a rectangle on a texture resource.

func (*Texture) PreLoad added in v1.0.1

func (obj *Texture) PreLoad()

PreLoad preloads a managed resource.

func (*Texture) Release

func (obj *Texture) Release() uint32

Release has to be called when finished using the object to free its associated resources.

func (*Texture) SetAutoGenFilterType added in v1.0.1

func (obj *Texture) SetAutoGenFilterType(typ TEXTUREFILTERTYPE) Error

SetAutoGenFilterType sets the filter type that is used for automatically generated mipmap sublevels.

func (*Texture) SetLOD added in v1.0.1

func (obj *Texture) SetLOD(lodNew uint32) uint32

SetLOD sets the most detailed level-of-detail for a managed texture.

func (*Texture) SetPriority added in v1.0.1

func (obj *Texture) SetPriority(priorityNew uint32) uint32

SetPriority assigns the priority of a resource for scheduling purposes.

func (*Texture) SetPrivateData added in v1.0.1

func (obj *Texture) SetPrivateData(
	refguid GUID,
	data uintptr,
	sizeOfData uint32,
	flags uint32,
) Error

SetPrivateData associates data with the resource that is intended for use by the application, not by Direct3D. Data is passed by value, and multiple sets of data can be associated with a single resource.

func (*Texture) SetPrivateDataBytes added in v1.0.1

func (obj *Texture) SetPrivateDataBytes(
	refguid GUID,
	data []byte,
	flags uint32,
) Error

SetPrivateDataBytes associates data with the resource that is intended for use by the application, not by Direct3D. Data is passed by value, and multiple sets of data can be associated with a single resource.

func (*Texture) UnlockRect

func (obj *Texture) UnlockRect(level uint) Error

UnlockRect unlocks a rectangle on a texture resource.

type VECTOR

type VECTOR struct {
	X float32
	Y float32
	Z float32
}

VECTOR defines a vector.

type VERTEXBLENDFLAGS

type VERTEXBLENDFLAGS uint16

VERTEXBLENDFLAGS defines flags used to control the number or matrices that the system applies when performing multimatrix vertex blending.

type VERTEXBUFFER_DESC

type VERTEXBUFFER_DESC struct {
	Format FORMAT
	Type   RESOURCETYPE
	Usage  uint32
	Pool   POOL
	Size   uint32
	FVF    uint32
}

VERTEXBUFFER_DESC describes a vertex buffer.

type VERTEXELEMENT

type VERTEXELEMENT struct {
	Stream     uint16
	Offset     uint16
	Type       DECLTYPE
	Method     DECLMETHOD
	Usage      DECLUSAGE
	UsageIndex byte
}

VERTEXELEMENT defines the vertex data layout. Each vertex can contain one or more data types, and each data type is described by a vertex element.

func DeclEnd

func DeclEnd() VERTEXELEMENT

DeclEnd marks the end of a slice of VERTEXELEMENTs.

type VIEWPORT

type VIEWPORT struct {
	X      uint32
	Y      uint32
	Width  uint32
	Height uint32
	MinZ   float32
	MaxZ   float32
}

VIEWPORT defines the window dimensions of a render-target surface onto which a 3D volume projects.

type VOLUME_DESC

type VOLUME_DESC struct {
	Format FORMAT
	Type   RESOURCETYPE
	Usage  uint32
	Pool   POOL
	Width  uint32
	Height uint32
	Depth  uint32
}

VOLUME_DESC describes a volume.

type VSHADERCAPS2_0

type VSHADERCAPS2_0 struct {
	Caps                    uint32
	DynamicFlowControlDepth int32
	NumTemps                int32
	StaticFlowControlDepth  int32
}

VSHADERCAPS2_0 contains vertex shader capabilities.

type VertexBuffer

type VertexBuffer struct {
	// contains filtered or unexported fields
}

VertexBuffer and its methods are used to manipulate vertex buffer resources.

func (*VertexBuffer) AddRef added in v1.0.1

func (obj *VertexBuffer) AddRef() uint32

AddRef increments the reference count for an interface on an object. This method should be called for every new copy of a pointer to an interface on an object.

func (*VertexBuffer) FreePrivateData added in v1.0.1

func (obj *VertexBuffer) FreePrivateData(refguid GUID) Error

FreePrivateData frees the specified private data associated with this resource.

func (*VertexBuffer) GetDesc

func (obj *VertexBuffer) GetDesc() (desc VERTEXBUFFER_DESC, err Error)

GetDesc retrieves a description of the vertex buffer resource.

func (*VertexBuffer) GetDevice added in v1.0.1

func (obj *VertexBuffer) GetDevice() (device *Device, err Error)

GetDevice retrieves the device associated with a resource. Call Release on the returned device when finished using it.

func (*VertexBuffer) GetPriority added in v1.0.1

func (obj *VertexBuffer) GetPriority() uint32

GetPriority retrieves the priority for this resource.

func (*VertexBuffer) GetPrivateData added in v1.0.1

func (obj *VertexBuffer) GetPrivateData(refguid GUID) (data []byte, err Error)

GetPrivateData copies the private data associated with the resource to a provided buffer.

func (*VertexBuffer) GetType added in v1.0.1

func (obj *VertexBuffer) GetType() RESOURCETYPE

GetType returns the type of the resource.

func (*VertexBuffer) Lock

func (obj *VertexBuffer) Lock(
	offsetToLock uint,
	sizeToLock uint,
	flags uint32,
) (data VertexBufferMemory, err Error)

Lock locks a range of vertex data and obtains a pointer to the vertex buffer memory.

func (*VertexBuffer) PreLoad added in v1.0.1

func (obj *VertexBuffer) PreLoad()

PreLoad preloads a managed resource.

func (*VertexBuffer) Release

func (obj *VertexBuffer) Release() uint32

Release has to be called when finished using the object to free its associated resources.

func (*VertexBuffer) SetPriority added in v1.0.1

func (obj *VertexBuffer) SetPriority(priorityNew uint32) uint32

SetPriority assigns the priority of a resource for scheduling purposes.

func (*VertexBuffer) SetPrivateData added in v1.0.1

func (obj *VertexBuffer) SetPrivateData(
	refguid GUID,
	data uintptr,
	sizeOfData uint32,
	flags uint32,
) Error

SetPrivateData associates data with the resource that is intended for use by the application, not by Direct3D. Data is passed by value, and multiple sets of data can be associated with a single resource.

func (*VertexBuffer) SetPrivateDataBytes added in v1.0.1

func (obj *VertexBuffer) SetPrivateDataBytes(
	refguid GUID,
	data []byte,
	flags uint32,
) Error

SetPrivateDataBytes associates data with the resource that is intended for use by the application, not by Direct3D. Data is passed by value, and multiple sets of data can be associated with a single resource.

func (*VertexBuffer) Unlock

func (obj *VertexBuffer) Unlock() Error

Unlock unlocks vertex data.

type VertexBufferMemory

type VertexBufferMemory struct {
	Memory uintptr
}

VertexBufferMemory encapsulates a raw memory pointer and provides methods to get and set typical slice types.

func (VertexBufferMemory) GetBytes

func (m VertexBufferMemory) GetBytes(offsetInBytes int, data []byte)

GetBytes copies data from memory to the given slice, starting at the given offset in bytes.

func (VertexBufferMemory) GetFloat32s

func (m VertexBufferMemory) GetFloat32s(offsetInBytes int, data []float32)

GetFloat32s copies data from memory to the given slice, starting at the given offset in bytes.

func (VertexBufferMemory) GetFloat64s

func (m VertexBufferMemory) GetFloat64s(offsetInBytes int, data []float64)

GetFloat64s copies data from memory to the given slice, starting at the given offset in bytes.

func (VertexBufferMemory) GetInt16s

func (m VertexBufferMemory) GetInt16s(offsetInBytes int, data []int16)

GetInt16s copies data from memory to the given slice, starting at the given offset in bytes.

func (VertexBufferMemory) GetInt32s

func (m VertexBufferMemory) GetInt32s(offsetInBytes int, data []int32)

GetInt32s copies data from memory to the given slice, starting at the given offset in bytes.

func (VertexBufferMemory) GetInt8s

func (m VertexBufferMemory) GetInt8s(offsetInBytes int, data []int8)

GetInt8s copies data from memory to the given slice, starting at the given offset in bytes.

func (VertexBufferMemory) GetUint16s

func (m VertexBufferMemory) GetUint16s(offsetInBytes int, data []uint16)

GetUint16s copies data from memory to the given slice, starting at the given offset in bytes.

func (VertexBufferMemory) GetUint32s

func (m VertexBufferMemory) GetUint32s(offsetInBytes int, data []uint32)

GetUint32s copies data from memory to the given slice, starting at the given offset in bytes.

func (VertexBufferMemory) GetUint8s

func (m VertexBufferMemory) GetUint8s(offsetInBytes int, data []uint8)

GetUint8s copies data from memory to the given slice, starting at the given offset in bytes.

func (VertexBufferMemory) SetBytes

func (m VertexBufferMemory) SetBytes(offsetInBytes int, data []byte)

SetBytes copies the given slice to the memory, starting at the given offset in bytes.

func (VertexBufferMemory) SetFloat32s

func (m VertexBufferMemory) SetFloat32s(offsetInBytes int, data []float32)

SetFloat32s copies the given slice to the memory, starting at the given offset in bytes.

func (VertexBufferMemory) SetFloat64s

func (m VertexBufferMemory) SetFloat64s(offsetInBytes int, data []float64)

SetFloat64s copies the given slice to the memory, starting at the given offset in bytes.

func (VertexBufferMemory) SetInt16s

func (m VertexBufferMemory) SetInt16s(offsetInBytes int, data []int16)

SetInt16s copies the given slice to the memory, starting at the given offset in bytes.

func (VertexBufferMemory) SetInt32s

func (m VertexBufferMemory) SetInt32s(offsetInBytes int, data []int32)

SetInt32s copies the given slice to the memory, starting at the given offset in bytes.

func (VertexBufferMemory) SetInt8s

func (m VertexBufferMemory) SetInt8s(offsetInBytes int, data []int8)

SetInt8s copies the given slice to the memory, starting at the given offset in bytes.

func (VertexBufferMemory) SetUint16s

func (m VertexBufferMemory) SetUint16s(offsetInBytes int, data []uint16)

SetUint16s copies the given slice to the memory, starting at the given offset in bytes.

func (VertexBufferMemory) SetUint32s

func (m VertexBufferMemory) SetUint32s(offsetInBytes int, data []uint32)

SetUint32s copies the given slice to the memory, starting at the given offset in bytes.

func (VertexBufferMemory) SetUint8s

func (m VertexBufferMemory) SetUint8s(offsetInBytes int, data []uint8)

SetUint8s copies the given slice to the memory, starting at the given offset in bytes.

type VertexDeclaration

type VertexDeclaration struct {
	// contains filtered or unexported fields
}

VertexDeclaration and its methods are used to encapsulate the vertex shader declaration.

func (*VertexDeclaration) AddRef added in v1.0.1

func (obj *VertexDeclaration) AddRef() uint32

AddRef increments the reference count for an interface on an object. This method should be called for every new copy of a pointer to an interface on an object.

func (*VertexDeclaration) GetDeclaration

func (obj *VertexDeclaration) GetDeclaration() (decl []VERTEXELEMENT, err Error)

GetDeclaration returns the vertex shader declaration.

func (*VertexDeclaration) GetDevice

func (obj *VertexDeclaration) GetDevice() (device *Device, err Error)

GetDevice retrieves the associated device. Call Release on the returned device when finished using it.

func (*VertexDeclaration) Release

func (obj *VertexDeclaration) Release() uint32

Release has to be called when finished using the object to free its associated resources.

type VertexShader

type VertexShader struct {
	// contains filtered or unexported fields
}

VertexShader and its methods are used to encapsulate the functionality of a vertex shader.

func (*VertexShader) AddRef added in v1.0.1

func (obj *VertexShader) AddRef() uint32

AddRef increments the reference count for an interface on an object. This method should be called for every new copy of a pointer to an interface on an object.

func (*VertexShader) GetDevice

func (obj *VertexShader) GetDevice() (device *Device, err Error)

GetDevice retrieves the associated device. Call Release on the returned device when finished using it.

func (*VertexShader) GetFunction

func (obj *VertexShader) GetFunction() (data []byte, err Error)

GetFunction returns the shader data.

func (*VertexShader) Release

func (obj *VertexShader) Release() uint32

Release has to be called when finished using the object to free its associated resources.

type Volume

type Volume struct {
	// contains filtered or unexported fields
}

Volume and its methods are used to manipulate volume resources.

func (*Volume) AddRef added in v1.0.1

func (obj *Volume) AddRef() uint32

AddRef increments the reference count for an interface on an object. This method should be called for every new copy of a pointer to an interface on an object.

func (*Volume) FreePrivateData

func (obj *Volume) FreePrivateData(refguid GUID) Error

FreePrivateData frees the specified private data associated with this volume.

func (*Volume) GetContainer

func (obj *Volume) GetContainer(riid GUID) (tex *VolumeTexture, err Error)

GetContainer provides access to the parent volume texture object, if this surface is a child level of a volume texture. Call Release on the returned volume texture when finished using it.

func (*Volume) GetDesc

func (obj *Volume) GetDesc() (desc VOLUME_DESC, err Error)

GetDesc retrieves a description of the volume.

func (*Volume) GetDevice

func (obj *Volume) GetDevice() (device *Device, err Error)

GetDevice retrieves the device associated with a volume.

func (*Volume) GetPrivateData

func (obj *Volume) GetPrivateData(refguid GUID) (data []byte, err Error)

GetPrivateData copies the private data associated with the volume to a buffer.

func (*Volume) LockBox

func (obj *Volume) LockBox(
	box *BOX,
	flags uint32,
) (locked *LOCKED_BOX, err Error)

LockBox locks a box on a volume resource.

func (*Volume) Release

func (obj *Volume) Release() uint32

Release has to be called when finished using the object to free its associated resources.

func (*Volume) SetPrivateData

func (obj *Volume) SetPrivateData(
	refguid GUID,
	data uintptr,
	sizeOfData uint32,
	flags uint32,
) Error

SetPrivateData associates data with the volume that is intended for use by the application, not by Direct3D.

func (Volume) SetPrivateDataInBytes

func (obj Volume) SetPrivateDataInBytes(
	refguid GUID,
	data []byte,
	flags uint32,
) Error

SetPrivateDataInBytes associates data with the volume that is intended for use by the application, not by Direct3D.

func (*Volume) UnlockBox

func (obj *Volume) UnlockBox() Error

UnlockBox unlocks a box on a volume resource.

type VolumeTexture

type VolumeTexture struct {
	// contains filtered or unexported fields
}

VolumeTexture and its methods are used to manipulate a volume texture resource.

func (*VolumeTexture) AddDirtyBox

func (obj *VolumeTexture) AddDirtyBox(dirtyBox *BOX) Error

AddDirtyBox adds a dirty region to a volume texture resource.

func (*VolumeTexture) AddRef added in v1.0.1

func (obj *VolumeTexture) AddRef() uint32

AddRef increments the reference count for an interface on an object. This method should be called for every new copy of a pointer to an interface on an object.

func (*VolumeTexture) FreePrivateData added in v1.0.1

func (obj *VolumeTexture) FreePrivateData(refguid GUID) Error

FreePrivateData frees the specified private data associated with this resource.

func (*VolumeTexture) GenerateMipSubLevels added in v1.0.1

func (obj *VolumeTexture) GenerateMipSubLevels()

GenerateMipSubLevels generates mip sub levels.

func (*VolumeTexture) GetAutoGenFilterType added in v1.0.1

func (obj *VolumeTexture) GetAutoGenFilterType() TEXTUREFILTERTYPE

GetAutoGenFilterType returns the filter type that is used for automatically generated mipmap sublevels.

func (*VolumeTexture) GetDevice added in v1.0.1

func (obj *VolumeTexture) GetDevice() (device *Device, err Error)

GetDevice retrieves the device associated with a resource. Call Release on the returned device when finished using it.

func (*VolumeTexture) GetLOD added in v1.0.1

func (obj *VolumeTexture) GetLOD() uint32

GetLOD returns a value clamped to the maximum level-of-detail set for a managed texture (this method is not supported for an unmanaged texture).

func (*VolumeTexture) GetLevelCount added in v1.0.1

func (obj *VolumeTexture) GetLevelCount() uint32

GetLevelCount returns the number of texture levels in a multilevel texture.

func (*VolumeTexture) GetLevelDesc

func (obj *VolumeTexture) GetLevelDesc(level uint) (desc VOLUME_DESC, err Error)

GetLevelDesc retrieves a level description of a volume texture resource.

func (*VolumeTexture) GetPriority added in v1.0.1

func (obj *VolumeTexture) GetPriority() uint32

GetPriority retrieves the priority for this resource.

func (*VolumeTexture) GetPrivateData added in v1.0.1

func (obj *VolumeTexture) GetPrivateData(refguid GUID) (data []byte, err Error)

GetPrivateData copies the private data associated with the resource to a provided buffer.

func (*VolumeTexture) GetType added in v1.0.1

func (obj *VolumeTexture) GetType() RESOURCETYPE

GetType returns the type of the resource.

func (*VolumeTexture) GetVolumeLevel

func (obj *VolumeTexture) GetVolumeLevel(level uint) (volume *Volume, err Error)

GetVolumeLevel retrieves the specified volume texture level. Call Release on the returned volume when finished using it.

func (*VolumeTexture) LockBox

func (obj *VolumeTexture) LockBox(
	level uint,
	box *BOX,
	flags uint32,
) (lockedVolume LOCKED_BOX, err Error)

LockBox locks a box on a volume texture resource.

func (*VolumeTexture) PreLoad added in v1.0.1

func (obj *VolumeTexture) PreLoad()

PreLoad preloads a managed resource.

func (*VolumeTexture) Release

func (obj *VolumeTexture) Release() uint32

Release has to be called when finished using the object to free its associated resources.

func (*VolumeTexture) SetAutoGenFilterType added in v1.0.1

func (obj *VolumeTexture) SetAutoGenFilterType(typ TEXTUREFILTERTYPE) Error

SetAutoGenFilterType sets the filter type that is used for automatically generated mipmap sublevels.

func (*VolumeTexture) SetLOD added in v1.0.1

func (obj *VolumeTexture) SetLOD(lodNew uint32) uint32

SetLOD sets the most detailed level-of-detail for a managed texture.

func (*VolumeTexture) SetPriority added in v1.0.1

func (obj *VolumeTexture) SetPriority(priorityNew uint32) uint32

SetPriority assigns the priority of a resource for scheduling purposes.

func (*VolumeTexture) SetPrivateData added in v1.0.1

func (obj *VolumeTexture) SetPrivateData(
	refguid GUID,
	data uintptr,
	sizeOfData uint32,
	flags uint32,
) Error

SetPrivateData associates data with the resource that is intended for use by the application, not by Direct3D. Data is passed by value, and multiple sets of data can be associated with a single resource.

func (*VolumeTexture) SetPrivateDataBytes added in v1.0.1

func (obj *VolumeTexture) SetPrivateDataBytes(
	refguid GUID,
	data []byte,
	flags uint32,
) Error

SetPrivateDataBytes associates data with the resource that is intended for use by the application, not by Direct3D. Data is passed by value, and multiple sets of data can be associated with a single resource.

func (*VolumeTexture) UnlockBox

func (obj *VolumeTexture) UnlockBox(level uint) Error

UnlockBox unlocks a box on a volume texture resource.

type ZBUFFERTYPE

type ZBUFFERTYPE uint32

ZBUFFERTYPE defines constants that describe depth-buffer formats.

Directories

Path Synopsis
samples
display_info Module
fullscreen Module
rotating_quad Module
screenshot Module
simple_glow Module

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL