-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
45 lines (34 loc) · 661 Bytes
/
main.cpp
File metadata and controls
45 lines (34 loc) · 661 Bytes
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include <iostream>
#include "GLFW/glfw3.h"
using namespace std;
GLFWwindow *window;
int main()
{
if(!glfwInit())
{
cout << "Failed to init library" << endl;
return -1;
}
window = glfwCreateWindow(640, 480, "Test Win", nullptr, nullptr);
if(!window)
{
cout << "Error to created window" << endl;
glfwTerminate();
return -1;
}
glfwMakeContextCurrent(window);
glClearColor(1, 1, 1, 0);
while(!glfwWindowShouldClose(window))
{
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1, 0, 0);
glPointSize(5);
glBegin(GL_POINTS);
glVertex2f(0, 0);
glEnd();
glfwPollEvents();
glfwSwapBuffers(window);
}
glfwTerminate();
return 0;
}