update
This commit is contained in:
parent
98cf7a3229
commit
c6d3c704ec
@ -1,3 +1,4 @@
|
||||
#include <cmath>
|
||||
#include<glad/glad.h>
|
||||
#include<GLFW/glfw3.h>
|
||||
#include <chrono>
|
||||
@ -6,10 +7,31 @@
|
||||
#include <thread>
|
||||
|
||||
void render(){
|
||||
glBegin(GL_POINTS);
|
||||
glBegin(GL_TRIANGLES);
|
||||
|
||||
glColor3f(1.0f,0.0f,0.0f);
|
||||
glVertex3f(0.0f,0.5f,0.0f);
|
||||
glColor3f(0.0f,1.0f,0.0f);
|
||||
glVertex3f(-0.5,-0.5,0.0f);
|
||||
glColor3f(0.0f,0.0f,1.0f);
|
||||
glVertex3f(0.5f,-0.5f,0.0f);
|
||||
|
||||
glEnd();
|
||||
|
||||
glBegin(GL_POINTS);
|
||||
static float num = 0.0f;
|
||||
static float speed = 0.01f;
|
||||
num+=speed;
|
||||
if(num>1.0f){
|
||||
num=1.0f;
|
||||
speed = -0.01f;
|
||||
}else if(num<0.0f){
|
||||
num=0.0f;
|
||||
speed=0.01f;
|
||||
}
|
||||
glColor3f(num,num,num);
|
||||
glVertex3f(0.0f,0.0f,0.0f);
|
||||
|
||||
glEnd();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user