CPP
cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
//Dont run in sololearn editor
#include <iostream>
#include <GLFW/glfw3.h>
//using namespace std;
int width = 500,
height = 500;
int blocksX = 20;
int blocksy = 20;
const double PI = 3.141592;
const float radius = 0.25;
GLFWwindow* window;
void drawRect(float x, float y, float width, float height);
void Draw() {
//x, y, width, height
drawRect(-0.2, -0.4, 0.4, 0.9);
}
void Update() {
}
void drawRect(float x, float y, float width, float height) {
glBegin(GL_POLYGON);
glVertex2f(x, y);
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run