Hi guys
I have a window on which i display my figure(stick). I have a sperate code that is quite basic and it draws some stars on teh top left corner of a window now basically i am trying to merge two things but i am getting a a window with only figure in it
void myDisplay(void){
Body b;
glutSwapBuffers();
glClearColor(0.4, 1, 1, 0.0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glColor3f(0.0, 0.0, 0.0);
glColor3ub(0, 0, 0);
b.drawCyborg();
glutSwapBuffers();
glClear(GL_COLOR_BUFFER_BIT);
DrawStars();
glFlush();
}
and this is my int main
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
glutInitWindowSize(WIN_WIDTH, WIN_HEIGHT);
glutInitWindowPosition(50, 50);
glutCreateWindow("window figure with stars");
myInit();
glutDisplayFunc(myDisplay);
glutReshapeFunc(myReshape);
glutMotionFunc(pressed_mouse);
glutMouseFunc(mouse);
glutCreateMenu(menu);
glutAddMenuEntry("view_hor/vert", 0);
glutAddMenuEntry("view_zoom_in/out", 1);
glutAddMenuEntry("view_lft-rgt/up-dow", 2);
glutAddMenuEntry("quit", 3);
glutAttachMenu(GLUT_MIDDLE_BUTTON);
glutKeyboardFunc(keyboard);
redisplay_all();
glutMainLoop();
now this work fine now problem is it does draw stars as i have called my function drawStars(); in the end. However it draws figure correctly. Any guesses where i am missing the trick. I am quite new so pardon my basic questions