nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
lib/gamnit: fix `Subtexture::gl_texture` not being set
[nit.git]
/
lib
/
gamnit
/
textures.nit
diff --git
a/lib/gamnit/textures.nit
b/lib/gamnit/textures.nit
index
e29b71e
..
ce5546e
100644
(file)
--- a/
lib/gamnit/textures.nit
+++ b/
lib/gamnit/textures.nit
@@
-39,7
+39,7
@@
abstract class Texture
var error: nullable Error = null
# OpenGL handle to this texture
var error: nullable Error = null
# OpenGL handle to this texture
- var gl_texture: Int is noinit
+ fun gl_texture: Int do return root.gl_texture
# Prepare a subtexture from this texture
fun subtexture(left, top, width, height: Numeric): GamnitSubtexture
# Prepare a subtexture from this texture
fun subtexture(left, top, width, height: Numeric): GamnitSubtexture
@@
-92,6
+92,8
@@
class GamnitRootTexture
# Has this texture been loaded yet?
var loaded = false
# Has this texture been loaded yet?
var loaded = false
+ redef var gl_texture = -1
+
init do all_root_textures.add self
private fun load_from_pixels(pixels: Pointer, width, height: Int, format: GLPixelFormat)
init do all_root_textures.add self
private fun load_from_pixels(pixels: Pointer, width, height: Int, format: GLPixelFormat)