()
| 55 | } |
| 56 | |
| 57 | func newTexture2D() *Texture2D { |
| 58 | |
| 59 | t := new(Texture2D) |
| 60 | t.gs = nil |
| 61 | t.refcount = 1 |
| 62 | t.texname = 0 |
| 63 | t.magFilter = gls.LINEAR |
| 64 | t.minFilter = gls.LINEAR_MIPMAP_LINEAR |
| 65 | t.wrapS = gls.CLAMP_TO_EDGE |
| 66 | t.wrapT = gls.CLAMP_TO_EDGE |
| 67 | t.updateData = false |
| 68 | t.updateParams = true |
| 69 | t.genMipmap = true |
| 70 | |
| 71 | // Initialize Uniform elements |
| 72 | t.uniUnit.Init("MatTexture") |
| 73 | t.uniInfo.Init("MatTexinfo") |
| 74 | t.SetOffset(0, 0) |
| 75 | t.SetRepeat(1, 1) |
| 76 | t.SetFlipY(true) |
| 77 | t.SetVisible(true) |
| 78 | return t |
| 79 | } |
| 80 | |
| 81 | // NewTexture2DFromImage creates and returns a pointer to a new Texture2D |
| 82 | // using the specified image file as data. |
no test coverage detected