Thank you for the reply. Now I totally changed approach, but now I get a white quad.
public void render(){
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, material.getTextureID());
glBindVertexArray(getVAO());
glEnableVertexAttribArray(0);
glEnableVertexAttribArray(1);
glDrawElements(GL_TRIANGLES, indices.length, GL_UNSIGNED_INT, 0);
glDisableVertexAttribArray(0);
glDisableVertexAttribArray(1);
glBindVertexArray(0);
}
Maybe is the problem here?
public Mesh mesh = new Mesh(new float[]{
-0.5f, 0.5f, 0.0f,
-0.5f, -0.5f, 0.0f,
0.5f, -0.5f, 0.0f,
0.5f, 0.5f, 0.0f,
}, new float[]{
0.5f, 0.0f, 0.0f,
0.5f, 0.5f, 0.0f,
0.0f, 0.0f, 0.0f,
0.0f, 0.5f, 0.0f
}, new int[] {
0, 1, 2,
2, 3, 0
}, mat);
Where "mat" is the material object which contains the texture.
I really don't get the problem.
Thank you.