I am trying to implement a sample program that draws three dots in a window.
No matter what point size I specify, the dots are always very tiny when I re-build and execute.
Here is my code:
#include <iostream.h>
#include <gl/glut.h>
//<<<<<<<<< myInit >>>>>>>>>>>>
void myInit(void)
{
glClearColor(1.0,1.0,1.0,0.0);
glColor3f(1.0, 0.0, 0.0);
glPointSize(10.0);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluOrtho2D(0.0, 640.0, 0.0, 480.0);
}
//<<<<<<<<< myDisplay >>>>>>>>>
void myDisplay(void)
{
cout << “In myDisplay…” << endl;
glClear(GL_COLOR_BUFFER_BIT); glBegin(GL_POINTS);
glVertex2i(100, 50);
glVertex2i(100, 130);
glVertex2i(150, 130);
glEnd();
glFlush();
}
//<<<<<<<<<<<< main >>>>>>>>>>>>>
void main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
glutInitWindowSize(640,480); glutInitWindowPosition(100,150); glutCreateWindow(“my first attempt”);
glutDisplayFunc(myDisplay); myInit();
glutMainLoop();
}
Thanks.