Added a bound for a start. Now the combination of mesh and renderer need to be tested.

This commit is contained in:
Hartmut Seichter 2019-02-07 13:15:21 +01:00
parent d1e5b558b7
commit 841b0eeb46
8 changed files with 110 additions and 23 deletions

View file

@ -15,6 +15,7 @@ class texture {
};
enum texture_shape {
shape_1d,
shape_2d,
shape_3d
};
@ -36,7 +37,6 @@ class texture {
texture(shared_ptr<image> i,texture_shape s,texture_type = color);
void set_image(shared_ptr<image> i);
shared_ptr<image> get() const { return _image; }

View file

@ -15,12 +15,11 @@ public:
~vertex_array();
bool ready() const;
void create(const mesh &m);
void destroy();
void draw();
bool ready() const;
protected:

View file

@ -120,8 +120,8 @@ struct triangle_renderer
const char* vertex_shader_2 = R"(
#version 400
uniform mat4 model_mat;
uniform mat4 view_mat = mat4
in vec3 vertex_p;
void main() {
gl_Position = model_mat * vec4(vertex_p, 1.0);
}

View file

@ -19,6 +19,8 @@ struct texture::impl {
GLuint gl_shape() {
switch (_host.shape()) {
case pw::texture::shape_1d:
return GL_TEXTURE_1D;
case pw::texture::shape_2d:
return GL_TEXTURE_2D;
case pw::texture::shape_3d: