Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #define _USE_MATH_DEFINES
- #include <math.h>
- #include <glut.h>
- #include <iostream>
- using namespace std;
- float* X;
- float* Y;
- void osi() {
- glClear(GL_COLOR_BUFFER_BIT); //очистим цвета в glClearColor
- glBegin(GL_LINES);
- glColor3f(0.0, 0.0, 0.0);
- glVertex2i(-600, 0);
- glVertex2i(600, 0);
- glVertex2i(0, -600);
- glVertex2i(0, 600);
- glEnd();
- glBegin(GL_LINE_STRIP);
- //glColor3f(0.4, 0.7, 0.7);
- for (float x = -600; x <= 600; x++) {
- float y =100* x*x;
- glVertex2f(x, y);
- }
- glEnd();
- glFlush();
- }
- int main(int argc, char **argv) {
- glutInit(&argc, argv);
- glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
- glutInitWindowSize(600, 400);
- glutCreateWindow("GRAFIC");
- glClearColor(1.0, 1.0, 1.0, 1.0);
- glOrtho(-600.0, 600.0, -600.0,600.0, -0.5, 0.5);
- glutDisplayFunc(osi);
- glutMainLoop();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement