mat4_ortho(&ortho_mat, 0, 800, 0, 800, 0.0f, 100.0f);
GLuint ortho_mat_loc = glGetUniformLocation(program, "u_proj");
- logprint(LOG_LEVEL_INFO, "Projection loc: %d", ortho_mat_loc);
glUniformMatrix4fv(ortho_mat_loc, 1, false, (f32 *) ortho_mat);
GLuint planet_colors_loc = glGetUniformLocation(program, "u_planet_colors");
- logprint(LOG_LEVEL_INFO, "Planet color loc: %d", planet_colors_loc);
- GLfloat planet_colors[16] = {
+ persist GLfloat planet_colors[16] = {
1.0f, 0.0f, 0.0f, 1.0f,
0.0f, 1.0f, 0.0f, 1.0f,
0.0f, 0.0f, 1.0f, 1.0f,
auto state = alloc<SimState>();
// NOTE(Brendan): Need to initialize the array since it does not get constructed because I refuse to use the 'new' keyword. alloc<T> uses malloc under the hood and cannot initialize the result.
state->bodies.init();
- state->bodies.ensure_capacity(128);
+ state->bodies.ensure_capacity(1024);
- foreach (i, 0, 128)
+ foreach (i, 0, 1024)
{
Body tmp_body;
tmp_body.pos = V2f{ randf(0, 800), randf(0, 800) };
tmp_body.vel = V2f{ randf(-50.0f, 50.0f), randf(-50.0f, 50.0f) };
- tmp_body.mass = randf(5.0f, 25.0f);
+ tmp_body.mass = randf(2.0f, 10.0f);
tmp_body.color_idx = rand() % 4;
- logprint(LOG_LEVEL_INFO, "Body color idx: %d", tmp_body.color_idx);
state->bodies.push(tmp_body);
}