-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathalpha_func.go
44 lines (36 loc) · 1.21 KB
/
alpha_func.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
package osg
import (
"github.com/flywave/go-osg/model"
)
func getComparisonFunc(obj interface{}) interface{} {
return obj.(*model.AlphaFunc).ComparisonFunc
}
func setComparisonFunc(obj interface{}, fc interface{}) {
obj.(*model.AlphaFunc).ComparisonFunc = *fc.(*int)
}
func getReferenceValue(obj interface{}) interface{} {
return obj.(*model.AlphaFunc).ReferenceValue
}
func setReferenceValue(obj interface{}, fc interface{}) {
obj.(*model.AlphaFunc).ReferenceValue = *fc.(*float32)
}
func init() {
ser := NewEnumSerializer("Function", getComparisonFunc, setComparisonFunc)
ser.Add("NEVER", model.GLNEVER)
ser.Add("LESS", model.GLLESS)
ser.Add("EQUAL", model.GLEQUAL)
ser.Add("LEQUAL", model.GLLEQUAL)
ser.Add("GREATER", model.GLGREATER)
ser.Add("NOTEQUAL", model.GLNOTEQUAL)
ser.Add("GEQUAL", model.GLGEQUAL)
ser.Add("GEQUAL", model.GLALWAYS)
serf := NewPropByValSerializer("ReferenceValue", false, getReferenceValue, setReferenceValue)
fn := func() interface{} {
al := model.NewAlphaFunc()
return al
}
wrap := NewObjectWrapper("AlphaFunc", fn, "osg::Object osg::StateAttribute osg::AlphaFunc")
wrap.AddSerializer(ser, RWENUM)
wrap.AddSerializer(serf, RWFLOAT)
GetObjectWrapperManager().AddWrap(wrap)
}