public static void NormalArray(bool enable)
 {
     if (enable && (_normalArray != GLStateEnabled.True))
     {
         GL11.EnableClientState(All11.NormalArray);
     }
     else
     {
         GL11.DisableClientState(All11.NormalArray);
     }
 }
 public static void ColorArray(bool enable)
 {
     if (enable && (_colorArray != GLStateEnabled.True))
     {
         GL11.EnableClientState(All11.ColorArray);
     }
     else
     {
         GL11.DisableClientState(All11.ColorArray);
     }
 }
        private static All11 _cull = All11.Ccw; // default

        public static void TextureCoordArray(bool enable)
        {
            if (enable && (_textureCoordArray != GLStateEnabled.True))
            {
                GL11.EnableClientState(All11.TextureCoordArray);
            }
            else
            {
                GL11.DisableClientState(All11.TextureCoordArray);
            }
        }
 public static void VertexArray(bool enable)
 {
     if (enable && (_vertextArray != GLStateEnabled.True))
     {
         GL11.EnableClientState(All11.VertexArray);
     }
     else
     {
         GL11.DisableClientState(All11.VertexArray);
     }
 }
Exemple #5
0
        public override void Render()
        {
            base.BeforeRender();

            GL.Disable(All.Texture2D);
            GL.Color4(FillColor.R, FillColor.G, FillColor.B, FillColor.A);
            GL.Enable(All.Points);

            GL.EnableClientState(All.VertexArray);

            var vArray = new float[Stars.Count * 3];

            for (var i = 0; i < Stars.Count; i++)
            {
                vArray[i * 3 + 0] = (float)(Stars[i].X + Position.X);
                vArray[i * 3 + 1] = (float)(Stars[i].Y + Position.Y);
                vArray[i * 3 + 2] = (float)(Stars[i].Z + Position.Z);
            }

            // pin the data, so that GC doesn't move them, while used
            // by native code
            unsafe
            {
                fixed(float *pv = vArray)
                {
                    GL.VertexPointer(3, All.Float, 0, new IntPtr(pv));
                    GL.DrawArrays(All.Points, 0, 4);
                    GL.Finish();
                }
            }

            GL.Enable(All.Texture2D);

            GL.DisableClientState(All.VertexArray);

            base.AfterRender();
        }