title: OpenGL work shader?
body: <p>There are two shaders, vertex and fragment</p>
  
  <pre><code>const char *vShaderstr = 
  "#version 300 es\n"
  "layout(location = 0) in vec4 a_color;\n"
  "layout(location = 1) in vec2 a_position;\n"
  "out vec4 v_color;\n"
  "void main()\n"
  "{\n"
  " v_color = a_color;\n"
  " gl_Position.xy = a_position;\n"
  " gl_Position.z = 0.0;\n"
  " gl_Position.w = 1.0;\n"
  "}";
  const char *fShaderstr =
      "#version 300 es\n"
      "precision lowp float;\n"
      "in vec4 v_color;\n"
      "out vec4 o_fragColor;\n"
      "void main()\n"
      "{\n"
      " o_fragColor = v_color;\n"
      "}";
  </code></pre>
  
  <p>The problem is that I do not have colors in float, but in bytes of unsigned ones. And positions in int, instead of in float. And vec as I poned in the float. To send data to the pipeline I use such commands.</p>
  
  <pre><code>glVertexAttribPointer ( 0, 4, GL_UNSIGNED_BYTE, GL_FALSE, 0, pixels );
  glVertexAttribPointer ( 1, 2, GL_INT, GL_FALSE, 0, vertices );
  glEnableVertexAttribArray ( 0 );
  glEnableVertexAttribArray ( 1 );
  glDrawArrays ( GL_POINTS, 0, max_draw );
  </code></pre>
  
  <p>pixels from bytes. vertices of int.</p>