在我的项目中,我希望为不同的对象使用一些纹理。
现在我有了以下代码:
private Texture[] textures = new Texture[1];
private int texture1 = 0; // Which Filter To Use
private String textureFilename = "src/data/image.jpg";还有textures[texture1].bind(gl);将它绑定到对象,在纹理被绑定到每个对象的那一分钟,这不是我想要的。
我假设有一种方法可以包含一个纹理列表,然后可以绑定到每个对象上?我只是想知道怎么做,我试着复制和编辑上面的代码,但它给了我错误,所以我猜我做错了。
发布于 2014-01-06 19:33:10
private Texture[] textures = new Texture[1+more];
//private int texture1 = 0; // Which Filter To Use
private String textureFilename[1+more] = "src/data/image.jpg";
File textureFile = new File(textFile);
textures[any] = TextureIO.newTexture(textureFilename[any], true);
// draw
gl.glEnable(GL.GL_TEXTURE_2D);
texture[Index].bind();
texture[Index].enable();
`...
https://stackoverflow.com/questions/14984938
复制相似问题