-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
36 lines (32 loc) · 764 Bytes
/
Copy pathmain.cpp
File metadata and controls
36 lines (32 loc) · 764 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
// This code is to draw a triangle within the window. The code is using opengl programmable
// pipeline with Shader class.
// Copyright by Rui @njupt.
// 2022.9
#include <iostream>
#include <glew/glew.h>
#include <glfw/glfw3.h>
#include <glm/glm.hpp>
#include "Shader.h"
#include "Minicore.h"
#include "Windows.h"
#include "Tutorial.h"
int main()
{
Tutorial tutorial;
tutorial.InitWindow("Tutorial4");
tutorial.initUI();
tutorial.CreateObjects();
tutorial.CreateShaders();
float currentTime = 0.0f;
float lastTime = 0.0f;
//extern float deltaTime;
while (!tutorial.IsWindowClosed())
{
tutorial.RenderScreen();
currentTime = glfwGetTime();
deltaTime = currentTime - lastTime;
lastTime = currentTime;
tutorial.RenderScreen();
}
return 0;
}