gooky's picture

Color3 and CallList

I am reading different tutorials in my quest to learn OpenGL.

I declare a list in the OnLoad:

id = GL.GenLists(1);
 
GL.NewList(id, ListMode.Compile); // create 
GL.Begin(BeginMode.Triangles);
 
//GL.Color3(1, 0, 0); 
GL.Vertex3(-1.0f, -1.0f, 4.0f);
GL.Vertex3(1.0f, -1.0f, 4.0f);
GL.Vertex3(0.0f, 1.0f, 4.0f);
 
GL.End();
GL.EndList();

Next I would like to draw the list in red to the screen in OnRenderFrame:

GL.Color3(1, 0, 0);
GL.CallList(id);

Nothing appears on the screen. If I uncomment "GL.Color3(1, 0, 0);" inside the creation of the list, the color shows, how come is that? It is like the "GL.Color3(1, 0, 0);" in the onrenderframe is not executed.

Best regards,

A newbee...


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
iliak's picture

Maybe list erases color definition with the one definied between gl.Begin() and gl.EndList()...

Iliak

www.mimicprod.net
www.dungeoneye.net : Open source remake of Eye of the Beholder II