title: First triangle does not render after using GLSL-shaders
body: <p>I'm currently learning OpenGL (and GLSL) from this <a href="http://www.opengl-tutorial.org/" rel="nofollow">tutorial</a>. So far I made it to Tutorial 2: The First Triangle. My code is a bit different since I'm more comfortable programming C, instead of the more common C++. Also, I used glfw3 to open my window, where the tutorial uses glfw, I believe. As for now I've been able to write everything in C, and everything worked til the point where I used my first shaders. Whenever i use them, my triangle wont render. I'm on a Mac and I haven't had the time to upgrade to OSX 10.9 (Mavericks) and therefore I'm forced to use OpenGL 3.2 and GLSL 1.2.</p>
  
  <p>tl;dr: problem: My triangle will not render whenever I use the shaders.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>int main(void) {
  GLFWwindow* window;
  
  /* Initialize the library */
  if(!glfwInit()) {
      return -1;
  }
  
  /* Create a windowed mode window and its OpenGL context */
  window = glfwCreateWindow(640, 480, "Tutorial 1", NULL, NULL);
  if (!window) {
      glfwTerminate();
      return -1;
  }
  
  /* Make the window's context current */
  glfwMakeContextCurrent(window);
  
  /* Initialize GLEW */
  glewExperimental = GL_TRUE; // Needed in core profile
  if(glewInit() != GLEW_OK) {
      fprintf(stderr, "Failed to initialize GLEW\n");
      return -1;
  }
  
  GLuint VertexArrayID;
  glGenVertexArrays(1, &amp;VertexArrayID);
  glBindVertexArray(VertexArrayID);
  
  /* Triangle's vertices */
  static const GLfloat g_vertex_buffer_data[] = {
      -1.0f, -1.0f, 0.0f,
      1.0f, -1.0f, 0.0f,
      0.0f,  1.0f, 0.0f,
  };
  
  // This will identify our vertex buffer
  GLuint vertexbuffer;
  // Generate 1 buffer, put the resulting identifier in vertexbuffer
  glGenBuffers(1, &amp;vertexbuffer);
  // The following commands will talk about our 'vertexbuffer' buffer
  glBindBuffer(GL_ARRAY_BUFFER, vertexbuffer);
  // Give our vertices to OpenGL.
  glBufferData(GL_ARRAY_BUFFER, sizeof(g_vertex_buffer_data), g_vertex_buffer_data, GL_STATIC_DRAW);  
  
  // Create and compile our GLSL program from the shaders
  GLuint programID = LoadShaders("VertexShader.txt", "FragmentShader.txt");
  
  glClearColor(0.0f, 0.0f, 0.4f, 0.0f);
  
  /* Loop until the user closes the window */
  while (!glfwWindowShouldClose(window)) {
      /* Render here */
      // 1rst attribute buffer : vertices
      glClear(GL_COLOR_BUFFER_BIT);
  
      glEnableVertexAttribArray(0);
      glBindBuffer(GL_ARRAY_BUFFER, vertexbuffer);
      glVertexAttribPointer(
          0,                  // attribute 0. No particular reason for 0, but must match the layout in the shader.
          3,                  // size
          GL_FLOAT,           // type
          GL_FALSE,           // normalized?
          0,                  // stride
          (void*)0            // array buffer offset
      );
  
      // Use our shader
      glUseProgram(programID);
  
      // Draw the triangle !
      glDrawArrays(GL_TRIANGLES, 0, 3); // Starting from vertex 0; 3 vertices total -&gt; 1 triangle
      glDisableVertexAttribArray(0);
  
      /* Swap front and back buffers */
      glfwSwapBuffers(window);
      /* Poll for and process events */
      glfwPollEvents();
  }
  
  glfwTerminate();
  return 0;
  }
  </code></pre>
  
  <p>And here is my VertexShader:</p>
  
  <pre><code>#version 120
  vec3 vertexPosition_modelspace;
  
  void main() {
      gl_Position.xyz = vertexPosition_modelspace;
      gl_Position.w = 1.0;
  }
  </code></pre>
  
  <p>My FragmentShader:</p>
  
  <pre><code>#version 120
  vec3 color;
  
  void main() {
      color = vec3(1, 0, 0);
  }
  </code></pre>
  
  <p>I think it might have something to do with shadersfiles, I think I might have translated them wrong from the tutorial (he uses GLSL 3.3).</p>