Nothing wrong with that piece of code, so you have to show more. How do you set up the window? The modelview and projection matrix? Any other states enabled?
Getting a line on the screen involves more than just sending the vertices.
void __fastcall TForm1::OpenGLPanel1Paint(TObject *Sender)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLineWidth(10.0);
glBegin(GL_LINES);
//vertex 1/2 for one line
glColor3f( 0.0f, 1.0f, 0.0f);
glVertex2f(-0.5f, -0.3f);
//vertex 2/2 for one line
I have downloaded the OpenGL_DP libraries form the net, it creates an OpenGLPanel and now on you can draw anything. For example the same code I’ve posted with
glBegin(GL_POLYGON) works very well. It is only GL_LINES that doesn’t work.