I am trying to draw a set of crosshairs. I am following the learnopengl.com example. Do I need to have a shader if I only want to draw lines and not other geometric objects? The example shows a triangle. He instances a shader so it will fill the triangle correctly. Do I need to have a shader if i am only drawing lines? I am drawing other lines without a shader, but they are dynamic and I am using glBegin/glEnd with glVertex3f calls to do it.
Here is my initialization code:
GLuint CH1_VBO[Output_Count], CH1_VAO[Output_Count];
GLfloat CH1_Vertices[] = { -0.235, 0.000, 0.950,
-0.176, 0.000, 0.950,
-0.118, 0.000, 0.950,
-0.059, 0.000, 0.950,
0.059, 0.000, 0.950,
0.118, 0.000, 0.950,
0.176, 0.000, 0.950,
0.235, 0.000, 0.950,
-0.029, 0.412, 0.950,
0.029, 0.412, 0.950,
-0.059, 0.206, 0.950,
0.059, 0.206, 0.950,
-0.059, -0.206, 0.950,
0.059, -0.206, 0.950,
-0.029, -0.412, 0.950,
0.029, -0.412, 0.950 };
glGenVertexArrays( 1, &CH1_VAO[Output] );
glGenBuffers( 1, &CH1_VBO[Output] );
glBindVertexArray( CH1_VAO[Output] );
glBindBuffer( GL_ARRAY_BUFFER, CH1_VBO[Output] );
glBufferData(GL_ARRAY_BUFFER, sizeof(CH1_Vertices), CH1_Vertices, GL_STATIC_DRAW);
glBindVertexArray( 0 );
once inside the main loop for each output display, I call:
glBindVertexArray( CH1_VAO[Output] );
glDrawArrays( GL_LINES, 0, 16 );
glBindVertexArray( 0 );
absolutely nothing happens. I know the output is being rendered, because I have text being rendered to each output channel.
What am I missing?