construct logo VAOs
This commit is contained in:
parent
9a99e5a052
commit
a41cd245a9
@ -5,7 +5,7 @@ import glamour.vao;
|
||||
import glamour.shader;
|
||||
import glamour.vbo;
|
||||
import gl3n.linalg;
|
||||
import logo;
|
||||
static import logo;
|
||||
|
||||
enum int WIDTH = 1920;
|
||||
enum int HEIGHT = 1080;
|
||||
@ -17,6 +17,7 @@ mat4 view_matrix;
|
||||
|
||||
void init()
|
||||
{
|
||||
logo.init();
|
||||
glClearColor (1.0, 0.7, 0.0, 0.0);
|
||||
glViewport(0, 0, WIDTH, HEIGHT);
|
||||
immutable string shader_src = `
|
||||
|
16
src/logo.d
16
src/logo.d
@ -9,15 +9,29 @@ immutable enum int GENTEX = 0;
|
||||
immutable enum int CORPORATION = 1;
|
||||
|
||||
/* Indexed by: face/wire, word, character */
|
||||
VAO[][2][2] m_vaos;
|
||||
VAO[][2][2] object_vaos;
|
||||
|
||||
void init()
|
||||
{
|
||||
Buffer vertices_buffer = new Buffer(logoobj.vertices);
|
||||
int[][][][] objects = [logoobj.fg, logoobj.fc, logoobj.lg, logoobj.lc];
|
||||
int objects_index;
|
||||
for (int draw_type = FACE; draw_type <= WIRE; draw_type++)
|
||||
{
|
||||
for (int word = GENTEX; word <= CORPORATION; word++)
|
||||
{
|
||||
object_vaos[draw_type][word].length = objects[objects_index].length;
|
||||
for (int char_index = 0;
|
||||
char_index < objects[objects_index].length;
|
||||
char_index++)
|
||||
{
|
||||
VAO vao = new VAO();
|
||||
vertices_buffer.bind();
|
||||
ElementBuffer ibo = new ElementBuffer(objects[objects_index][char_index]);
|
||||
ibo.bind();
|
||||
object_vaos[draw_type][word][char_index] = vao;
|
||||
}
|
||||
objects_index++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user