mirror of
https://git.shylie.info/shylie/glerminal.git
synced 2024-11-09 20:00:04 +00:00
43 lines
660 B
C++
43 lines
660 B
C++
#include <glerminal.h>
|
|
|
|
#include <cstdlib>
|
|
#include <cmath>
|
|
|
|
namespace
|
|
{
|
|
void init()
|
|
{
|
|
glerminal_load_sprites_file("resources/basic.png");
|
|
|
|
for (int i = 0; i < GRID_WIDTH; i++)
|
|
{
|
|
for (int j = 0; j < GRID_HEIGHT; j++)
|
|
{
|
|
glerminal_set(i, j, 0, 1);
|
|
}
|
|
}
|
|
}
|
|
|
|
void mainloop(float dt)
|
|
{
|
|
static float time = 0;
|
|
|
|
time += dt;
|
|
time = fmodf(time, 3.1415926f * 2);
|
|
|
|
for (int i = 0; i < GRID_WIDTH; i++)
|
|
{
|
|
for (int j = 0; j < GRID_HEIGHT; j++)
|
|
{
|
|
glerminal_offset(i, j, 0, cosf(time - i / 3.1415f), sinf(time - j / 3.1415f));
|
|
}
|
|
}
|
|
|
|
glerminal_flush();
|
|
}
|
|
}
|
|
|
|
int main(int argc, char** argv)
|
|
{
|
|
glerminal_run(init, mainloop);
|
|
} |