-
Notifications
You must be signed in to change notification settings - Fork 13
/
macros_windows.go
45 lines (38 loc) · 1.76 KB
/
macros_windows.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package d3d9
// PSVersion creates a pixel shader version token.
func PSVersion(major, minor uint) uint32 {
return uint32(0xFFFF0000 | ((major) << 8) | (minor))
}
// VSVersion creates a vertex shader version token.
func VSVersion(major, minor uint) uint32 {
return uint32(0xFFFE0000 | ((major) << 8) | (minor))
}
// TSWorldMatrix maps indices in the range 0 through 255 to the corresponding
// transform states.
func TSWorldMatrix(index int) TRANSFORMSTATETYPE {
return TRANSFORMSTATETYPE(index + 256)
}
// 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 FVFTexCoordSize1(CoordIndex uint) uint32 {
return uint32(int(FVF_TEXTUREFORMAT1) << (CoordIndex*2 + 16))
}
// 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 FVFTexCoordSize2(CoordIndex uint) uint32 {
return FVF_TEXTUREFORMAT2
}
// 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 FVFTexCoordSize3(CoordIndex uint) uint32 {
return FVF_TEXTUREFORMAT3 << (CoordIndex*2 + 16)
}
// 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 FVFTexCoordSize4(CoordIndex uint) uint32 {
return FVF_TEXTUREFORMAT4 << (CoordIndex*2 + 16)
}