title: GLSL 150 GL 3.2 black textures
body: <p>I can't get my textures to work, all the screen is black.
  Here is my code for loading the images, I use lodepng:</p>
  
  <pre><code>std::vector&lt;unsigned char&gt; image;
  unsigned int error = lodepng::decode(image, w, h, filename);
  GLuint texture_id;
  glGenTextures(1, &amp;texture_id);
  glActiveTexture(GL_TEXTURE0);
  glBindTexture(GL_TEXTURE_2D, texture_id);
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
  glTexImage2D(GL_TEXTURE_2D, 0, 4, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, &amp;image[0]);
  glBindTexture(GL_TEXTURE_2D, 0);
  </code></pre>
  
  <p>For the rendering I do this:</p>
  
  <pre><code>glActiveTexture(GL_TEXTURE0);
  glBindTexture(GL_TEXTURE_2D, texture_id_from_above); //texture_id were checked, seemed fine
  glUniform1i(shader_sampler_loc, GL_TEXTURE0);
  </code></pre>
  
  <p>and my frag shader(trimmed version) is basically doing this:</p>
  
  <pre><code>uniform sampler2D sampler;
  void main(void) {
      gl_FragColor = texture2D(sampler, uv_coord);
  }
  </code></pre>
  
  <p>The UV-coordinates are fine, the vector from lodepng containes many elements and there is no error returned. To further pin the problem I tried this:</p>
  
  <pre><code>    gl_FragColor = texture2D(sampler, uv_coord)*0.5 + vec4(1, 1, 1, 1)*0.5f
  </code></pre>
  
  <p>To see if the whole assignment is somehow skipped or the texture in fact black. As a result I still only get a black window. But by removing</p>
  
  <pre><code>glActiveTexture(GL_TEXTURE0); //x2, and
  glUniform1i(sampler_loc, GL_TEXTURE0);
  </code></pre>
  
  <p>all my objects appear gray. I have no clue what is wrong.</p>
  
  <p>BTW: it was working before moving to OpenGL 3.2 (had 2.1 before), and all images are ^2. I use CORE_PROFILE &amp;&amp; FORWARD_COMPAT.</p>
  
  <p>Vertex shader:</p>
  
  <pre><code>#version 150
  
  //VBO vertex attributes
  attribute vec3 pos;
  attribute vec2 tex;
  attribute vec3 normal;
  
  varying vec2 uv_coord;
  
  uniform mat4 mvp_mat;
  
  void main(void) {
      gl_Position = mvp_mat * vec4(pos, 1);
      uv_coord = tex;
  }
  </code></pre>