Advertisement
Guest User

nama.cpp

a guest
Apr 23rd, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.45 KB | None | 0 0
  1. #include <stdlib.h>
  2. #include <GL/glut.h>
  3.  
  4. void renderScene(void){
  5.     glClearColor(1.0, 1.0, 1.0, 0);
  6.     glClear(GL_COLOR_BUFFER_BIT);
  7.     glColor3f(0.0f, 0.0f, 0.0f);
  8.     glBegin(GL_LINE_STRIP);
  9.         glVertex2f(-0.8, -0.7);
  10.         glVertex2f(-0.8, 0.7);
  11.         glVertex2f(-0.7, 0.0);
  12.         glVertex2f(-0.6, 0.7);
  13.         glVertex2f(-0.6, -0.7);
  14.     glEnd();
  15.     glBegin(GL_POINTS);
  16.         glVertex2f(-0.55, -0.7);
  17.     glEnd();
  18.     glBegin(GL_LINE_STRIP);
  19.         glVertex2f(-0.4, 0.7);
  20.         glVertex2f(-0.2, 0.7);;
  21.     glEnd();
  22.     glBegin(GL_LINE_STRIP);
  23.         glVertex2f(-0.3, 0.7);
  24.         glVertex2f(-0.3, -0.7);
  25.     glEnd();
  26.     glBegin(GL_LINE_STRIP);
  27.         glVertex2f(-0.1, -0.7);
  28.         glVertex2f(-0.1, 0.7);
  29.         glVertex2f(0.010, 0.7);
  30.         glVertex2f(0.03, 0.58);
  31.         glVertex2f(0.03, 0.39);
  32.         glVertex2f(0.010, 0.27);
  33.         glVertex2f(-0.1, 0.27);
  34.         glVertex2f(0.050, -0.7);
  35.     glEnd();
  36.     glBegin(GL_LINE_STRIP);
  37.         glVertex2f(0.15, -0.7);
  38.         glVertex2f(0.15, 0.7);
  39.     glEnd();
  40.     glBegin(GL_LINE_STRIP);
  41.         glVertex2f(0.35, -0.7);
  42.         glVertex2f(0.515, 0.7);
  43.         glVertex2f(0.68, -0.7);
  44.     glEnd();
  45.     glBegin(GL_LINE_STRIP);
  46.         glVertex2f(0.419, -0.25);
  47.         glVertex2f(0.60, -0.25);
  48.     glEnd();
  49.    
  50.     glBegin(GL_POINTS);
  51.         glVertex2f(0.73, -0.7);
  52.     glEnd();
  53.     glFlush();
  54. }
  55.  
  56. int main(int argc, char **argv){
  57.     glutInit(&argc, argv);
  58.     glutInitDisplayMode(GLUT_DEPTH | GLUT_SINGLE | GLUT_RGBA);
  59.     glutInitWindowPosition(180,200);
  60.     glutInitWindowSize(1000, 400);
  61.     glutCreateWindow("NAMA");
  62.     glutDisplayFunc(renderScene);
  63.     glutMainLoop();
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement