#include void drawLines(double x1, double y1, double x2, double y2, double red, double green, double blue); int main(void) { GLFWwindow* window; if (!glfwInit()) return -1; window = glfwCreateWindow(640, 480, "Hello World", NULL, NULL); if (!window) { glfwTerminate(); return -1; } glfwMakeContextCurrent(window); while (!glfwWindowShouldClose(window)) { /* Render here */ glClear(GL_COLOR_BUFFER_BIT); for (float i = -0.5; i <= 4000; i += 100.9) { int j = 0; drawLines(5.0, 5.0, 500.0, -0.5 + i, 0.0 + j, 0.0 + j, 1.0 + j); j++; } for (float i = 0; i < 1; i += 0.1) { } glfwSwapBuffers(window); glfwPollEvents(); } glfwTerminate(); return 0; } void drawLines(double x1, double y1, double x2, double y2, double red, double green, double blue) { double w = 600; double h = 400; x1 = 2 * x1 / w - 1; y1 = 2 * y1 / h - 1; x2 = 2 * x2 / w - 1; y2 = 2 * y2 / h - 1; glBegin(GL_LINES); //glColor3f(red, green, blue); glVertex2f(x1, y1); glVertex2f(x2, y2); glEnd(); glFlush(); }