glerminal/examples/basic.cpp
2024-05-19 21:46:56 -05:00

46 lines
624 B
C++

#include <glerminal.h>
#include <cstdlib>
namespace
{
void init()
{
glerminal_load_sprites_file("resources/basic.png");
}
void mainloop(float dt)
{
static float time = 1;
time += dt;
if (time < 0.2f)
{
return;
}
else
{
time = 0;
}
for (int i = 0; i < 40; i++)
{
for (int j = 0; j < 25; j++)
{
for (int k = 0; k < 256; k++)
{
glerminal_set(i, j, k, rand() % 3 == 0);
glerminal_offset(i, j, k, (rand() * rand()) % 64 - 32, (rand() * rand()) % 64 - 32);
}
}
}
glerminal_flush();
}
}
int main(int argc, char** argv)
{
glerminal_run(init, mainloop);
}