Added a bound for a start. Now the combination of mesh and renderer need to be tested.
This commit is contained in:
parent
d1e5b558b7
commit
841b0eeb46
8 changed files with 110 additions and 23 deletions
|
@ -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; }
|
||||
|
||||
|
|
|
@ -15,12 +15,11 @@ public:
|
|||
|
||||
~vertex_array();
|
||||
|
||||
bool ready() const;
|
||||
|
||||
void create(const mesh &m);
|
||||
void destroy();
|
||||
|
||||
void draw();
|
||||
bool ready() const;
|
||||
|
||||
protected:
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue