Merged branch opengl into opengl
This commit is contained in:
@@ -153,16 +153,13 @@ int main(int argc, char* args[]) {
|
||||
|
||||
int loopNumber = -1;
|
||||
double lastTime = glfwGetTime();
|
||||
double lastTimeLoop = glfwGetTime();
|
||||
int nbFrames = 0;
|
||||
|
||||
/* Loop until the user closes the window */
|
||||
while (!glfwWindowShouldClose(window)) {
|
||||
|
||||
// Foreground texture counter
|
||||
loopNumber++;
|
||||
if (loopNumber >= lenTexFG) {
|
||||
loopNumber = 0;
|
||||
}
|
||||
|
||||
|
||||
// Measure speed
|
||||
double currentTime = glfwGetTime();
|
||||
@@ -175,6 +172,15 @@ int main(int argc, char* args[]) {
|
||||
lastTime += 1.0;
|
||||
}
|
||||
|
||||
// Foreground texture counter
|
||||
if ( currentTime - lastTimeLoop >= 0.08 ){
|
||||
loopNumber++;
|
||||
if (loopNumber >= lenTexFG) {
|
||||
loopNumber = 0;
|
||||
}
|
||||
lastTimeLoop += 0.08;
|
||||
}
|
||||
|
||||
// Set current foreground texture
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
glBindTexture(GL_TEXTURE_2D, texFGs[loopNumber]);
|
||||
|
||||
Reference in New Issue
Block a user