title: How to generate and bind a texture in OpenGL
body: <p>I have inputted an image from file and stored it in a int array</p>
  
  <pre><code>private int[] dataBuffInt;
  BufferedImage image;
  
  image = ImageIO.read(getClass().getResource("/res/" + type + ".png"));
  int w = image.getWidth();
  int h = image.getHeight();
  
  this.dataBuffInt = image.getRGB(0, 0, w, h, null, 0, w); 
  </code></pre>
  
  <p>I now want to take that array and pass it over to generate and bind my texture, however I am stuck as GLuint does not work for me.</p>
  
  <pre><code>GL11.glGenTextures(tex);
  for (int i = 0; i &lt; tex.length; i++) {
  GL11.glBindTexture(GL_TEXTURE_2D, tex[i]); }
  </code></pre>
  
  <p>This is where I am at I assume the for loop is completely wrong, I feel I need to get the colour from the int[] using Color c = new Color(dataBuffInt[100]) with c.getRed() etc but I am lost.</p>
  
  <p>I hope someone understands my intentions, I am simply trying to read an image from a file and place it on screen.</p>
  
  <p>There are no exceptions for reading the file in and the values are being successfully printed out for RGBA. I assume the Gen/Bind process has gone wrong.</p>