added camera pan for parallax and improved line drawing with preview line
This commit is contained in:
@@ -381,3 +381,28 @@ void Slice9::create_impl(float w, float h, float r, float tr, GLushort *idx, Sha
|
||||
*idx++ = 12; // D
|
||||
*idx++ = 0; // A
|
||||
}
|
||||
void ui::LineSegment::create_impl(GLushort* idx, vertex_t* vertices)
|
||||
{
|
||||
count[0] = 2;
|
||||
count[1] = 2;
|
||||
ioff[0] = (GLvoid*)0;
|
||||
ioff[1] = (GLvoid*)0;
|
||||
vertices[0] = { { 0, 0, 0, 1 }, { 0, 0 } }; // A
|
||||
vertices[1] = { { 0, 0, 0, 1 }, { 0, 1 } }; // B
|
||||
idx[0] = 0;
|
||||
idx[1] = 1;
|
||||
}
|
||||
void ui::LineSegment::update_vertices(const glm::vec4 data[2])
|
||||
{
|
||||
static vertex_t vertices[2];
|
||||
vertices[0] = { data[0], { 0, 0 } }; // A
|
||||
vertices[1] = { data[1], { 0, 1 } }; // B
|
||||
glBindBuffer(GL_ARRAY_BUFFER, buffers[0]);
|
||||
glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);
|
||||
static GLushort idx[4] { 0, 1 };
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, buffers[1]);
|
||||
glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(idx), idx, GL_STATIC_DRAW);
|
||||
|
||||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user