im trying to test GL_Line strip by drawing line strips between points and it always starts at 0,0 even i start to draw at the middle of the screen.
i simplified my test data to just draw two points but still the same.
the result is the line is drawn from 0,0 to any points in my vertices.
Im using orthographic projection and pases 2D vectors to my shaders to draw it on 3D, but that is not the concern.
here is my non simplified testing: im trying to draw linestrips using mouse, but it always starts at 0,0
Here is the code (the simplified version/first image)
float vertices[] = {
SCR_WIDTH/2,SCR_HEIGHT/2,
SCR_WIDTH,SCR_HEIGHT,
};
unsigned int VBO = 0;
unsigned int VAO = 0;
glGenBuffers(1, &VBO);
glGenVertexArrays(1, &VAO);
glBindVertexArray(VAO);
glBindBuffer(GL_ARRAY_BUFFER, VBO);
glBufferData(GL_ARRAY_BUFFER, 4 * sizeof(float),
vertices, GL_STATIC_DRAW);
glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, 2 * sizeof(float), (void*)0);
glEnableVertexAttribArray(0);
glDrawArrays(GL_LINE_STRIP, 0, 4);
Im using OpenGL 3.1 right now on desktop as i am writing a code that will be ported to OpenGL ES 2.0 after i write it in desktop, (android studio is slow so i do my opengl coding in Visual Studio)