-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathtexture1d.go
48 lines (40 loc) · 1.12 KB
/
texture1d.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
46
47
48
package osg
import (
"github.com/flywave/go-osg/model"
)
func getImage(obj interface{}) interface{} {
td := obj.(*model.Texture)
return td.Image
}
func setImage(obj interface{}, val interface{}) {
td := obj.(*model.Texture)
td.Image = val.(*model.Image)
}
func getTexWidth(obj interface{}) interface{} {
td := obj.(*model.Texture)
return &td.TextureWidth
}
func setTexWidth(obj interface{}, val interface{}) {
td := obj.(*model.Texture)
td.TextureWidth = val.(uint32)
}
func getTexHeight(obj interface{}) interface{} {
td := obj.(*model.Texture)
return &td.TextureWidth
}
func setTexHeight(obj interface{}, val interface{}) {
td := obj.(*model.Texture)
td.TextureWidth = val.(uint32)
}
func init() {
fn := func() interface{} {
td := model.NewTexture1d()
return td
}
wrap := NewObjectWrapper("Texture1D", fn, "osg::Object osg::StateAttribute osg::Texture osg::Texture1D")
ser1 := NewImageSerializer("Image", getImage, setImage)
ser2 := NewPropByValSerializer("TextureWidth", false, getTexWidth, setTexWidth)
wrap.AddSerializer(ser1, RWIMAGE)
wrap.AddSerializer(ser2, RWUINT)
GetObjectWrapperManager().AddWrap(wrap)
}