fix starting point

This commit is contained in:
Mylloon 2023-05-08 09:17:25 +02:00
parent 39ff84c947
commit aa77e8120c
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -59,8 +59,9 @@ static void draw(void) {
static Uint32 t0 = -1; static Uint32 t0 = -1;
GLfloat t, d; GLfloat t, d;
if (t0 < 0.0f) if ((int)t0 == -1) {
t0 = SDL_GetTicks(); t0 = SDL_GetTicks();
}
t = (GLfloat)(SDL_GetTicks() - t0) / 1000.f; t = (GLfloat)(SDL_GetTicks() - t0) / 1000.f;
d = -1.1f + .25f * t; d = -1.1f + .25f * t;
@ -72,7 +73,7 @@ static void draw(void) {
gl4duBindMatrix("modview"); gl4duBindMatrix("modview");
gl4duLoadIdentityf(); gl4duLoadIdentityf();
gl4duTranslatef(0.f, d - 1.5f, -2.f); gl4duTranslatef(0.f, d, -2.f);
glActiveTexture(GL_TEXTURE0); glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, _texId); glBindTexture(GL_TEXTURE_2D, _texId);
gl4duScalef(1.f, .3f, 1.f); gl4duScalef(1.f, .3f, 1.f);