taisei/src/vbo.h

44 lines
707 B
C
Raw Normal View History

2011-12-25 08:18:03 +01:00
/*
* This software is licensed under the terms of the MIT-License
* See COPYING for further information.
* ---
* Copyright (C) 2011, Lukas Weber <laochailan@web.de>
*/
2012-07-20 13:18:25 +02:00
#ifndef VBO_H
#define VBO_H
2011-12-25 08:18:03 +01:00
#include "matrix.h"
#include "resource/texture.h"
#include "resource/shader.h"
#include "taiseigl.h"
2011-12-25 08:18:03 +01:00
2012-07-14 19:13:41 +02:00
enum {
2012-07-20 20:43:48 +02:00
VBO_SIZE = 8192, // * sizeof(Vertex)
2012-07-14 19:13:41 +02:00
};
typedef struct VBO VBO;
struct VBO {
GLuint vbo;
int offset;
2011-12-25 08:18:03 +01:00
int size;
2012-07-14 19:13:41 +02:00
};
2011-12-25 08:18:03 +01:00
2012-07-14 19:13:41 +02:00
extern VBO _vbo;
2011-12-25 08:18:03 +01:00
2012-07-14 19:13:41 +02:00
typedef struct Vertex Vertex;
struct Vertex {
Vector x;
Vector n;
float s;
float t;
};
2011-12-25 08:18:03 +01:00
2012-07-14 19:13:41 +02:00
void init_vbo(VBO *vbo, int size);
void vbo_add_verts(VBO *vbo, Vertex *verts, int count);
2011-12-25 08:18:03 +01:00
void init_quadvbo();
void draw_quad();
2012-07-14 19:13:41 +02:00
void delete_vbo(VBO *vbo);
2011-12-25 08:18:03 +01:00
#endif