mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-14 11:46:56 +02:00
line being sent as array
This commit is contained in:
parent
4d4a90e9ce
commit
533148f26d
3 changed files with 5 additions and 4 deletions
|
@ -43,7 +43,7 @@ void RenderableLineEntityItem::render(RenderArgs* args) {
|
|||
glRotatef(glm::degrees(glm::angle(rotation)), axis.x, axis.y, axis.z);
|
||||
geometryCache->updateVertices(_lineVerticesID, getLinePoints(), lineColor);
|
||||
|
||||
geometryCache->renderVertices(gpu::LINES, _lineVerticesID);
|
||||
geometryCache->renderVertices(gpu::LINE_STRIP, _lineVerticesID);
|
||||
glPopMatrix();
|
||||
RenderableDebugableEntityItem::render(this, args);
|
||||
};
|
||||
|
|
|
@ -66,9 +66,11 @@ class LineEntityItem : public EntityItem {
|
|||
_points = points;
|
||||
// _points = QVector<glm::vec3>(0);
|
||||
// glm::vec3 p1 = { 0,0,0};
|
||||
// glm::vec3 p2 = {1, 1,0};
|
||||
// glm::vec3 p2 = {1, -1,2};
|
||||
// glm::vec3 p3 = {4, 0, 0};
|
||||
// _points <<p1;
|
||||
// _points<< p2;
|
||||
// _points<<p3;
|
||||
}
|
||||
|
||||
const QVector<glm::vec3>& getLinePoints() const{
|
||||
|
|
|
@ -660,7 +660,6 @@ void GeometryCache::updateVertices(int id, const QVector<glm::vec2>& points, con
|
|||
|
||||
void GeometryCache::updateVertices(int id, const QVector<glm::vec3>& points, const glm::vec4& color) {
|
||||
BatchItemDetails& details = _registeredVertices[id];
|
||||
|
||||
if (details.isCreated) {
|
||||
details.clear();
|
||||
#ifdef WANT_DEBUG
|
||||
|
@ -799,7 +798,7 @@ void GeometryCache::renderVertices(gpu::Primitive primitiveType, int id) {
|
|||
batch.setInputFormat(details.streamFormat);
|
||||
batch.setInputStream(0, *details.stream);
|
||||
batch.draw(primitiveType, details.vertices, 0);
|
||||
|
||||
|
||||
gpu::GLBackend::renderBatch(batch);
|
||||
|
||||
glDisableClientState(GL_VERTEX_ARRAY);
|
||||
|
|
Loading…
Reference in a new issue