Click here to Skip to main content
15,892,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to draw points using sharpgl but when the code is compiled it gives only white console with no output why is this happening and what is the solution of this thanks in advance.

C#
private static int width = 400, height = 300;
        static void Main(string[] args)
        {

            Glut.glutInit();
            Glut.glutInitDisplayMode(Glut.GLUT_SINGLE | Glut.GLUT_RGB);
            Glut.glutInitWindowSize(width, height);
            Glut.glutCreateWindow("OpenGL Tutorial");
            init();
            Glut.glutDisplayFunc(OnDisplay);
            Glut.glutMainLoop();
        }

        private static void OnDisplay()
        {
            Gl.glClear(Gl.GL_COLOR_BUFFER_BIT | Gl.GL_DEPTH_BUFFER_BIT);
            Gl.glLoadIdentity();
            Gl.glTranslatef(0.0f, 0.0f, -4.0f);
            Gl.glColor3f(0.0f, 0.0f, 1.0f);
            Gl.glPointSize(10.0f);
            Gl.glBegin(Gl.GL_POINTS);
            Gl.glVertex3f(1.0f, 1.0f, 0.0f);
            Gl.glVertex3f(-1.0f, -1.0f, 0.0f);
            Gl.glEnd();
        }
        static void init()
        {

            Gl.glClearColor(1.0f, 1.0f, 1.0f, 0.0f);
            Gl.glMatrixMode(Gl.GL_PROJECTION);
        }
Posted

1 solution

 
Share this answer
 
Comments
Member 14756922 27-Mar-20 5:34am    
how to draw points like the holo circle instead of a square box

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900