blob: 7f61b9bf7a83ab4f002b2e670411945789d7bff5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#include <math.h>
#include "../sponge.h"
#define SPONGE_EXAMPLE_IMPLEMENTATION
#include "example.h"
#define SPEED (2.0f / 360.0f * 2 * PI)
static float angle = 0.0f;
void draw_frame(sponge_Texture c) {
angle += SPEED;
float rf = (sinf(angle) + 1.0f) * 255.0f / 2.0f;
float gf = (sinf(angle + (PI * 2.0f / 3.0f)) + 1.0f) * 255.0f / 2.0f;
float bf = (sinf(angle + (PI * 4.0f / 3.0f)) + 1.0f) * 255.0f / 2.0f;
sponge_Color32 color;
color.a = 0xFF;
color.r = (((int)rf) & 0xFF);
color.g = (((int)gf) & 0xFF);
color.b = (((int)bf) & 0xFF);
sponge_clear(c, color);
}
|