Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/gui/ObjectTypes/CChart.cpp
/* Copyright (C) 2019 Wildfire Games. | /* Copyright (C) 2020 Wildfire Games. | ||||
* This file is part of 0 A.D. | * This file is part of 0 A.D. | ||||
* | * | ||||
* 0 A.D. is free software: you can redistribute it and/or modify | * 0 A.D. is free software: you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation, either version 2 of the License, or | * the Free Software Foundation, either version 2 of the License, or | ||||
* (at your option) any later version. | * (at your option) any later version. | ||||
* | * | ||||
* 0 A.D. is distributed in the hope that it will be useful, | * 0 A.D. is distributed in the hope that it will be useful, | ||||
▲ Show 20 Lines • Show All 71 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
void CChart::DrawLine(const CShaderProgramPtr& shader, const CGUIColor& color, const std::vector<float>& vertices) const | void CChart::DrawLine(const CShaderProgramPtr& shader, const CGUIColor& color, const std::vector<float>& vertices) const | ||||
{ | { | ||||
shader->Uniform(str_color, color); | shader->Uniform(str_color, color); | ||||
shader->VertexPointer(3, GL_FLOAT, 0, &vertices[0]); | shader->VertexPointer(3, GL_FLOAT, 0, &vertices[0]); | ||||
shader->AssertPointersBound(); | shader->AssertPointersBound(); | ||||
#if !CONFIG2_GLES | |||||
glEnable(GL_LINE_SMOOTH); | glEnable(GL_LINE_SMOOTH); | ||||
#endif | |||||
glLineWidth(1.1f); | glLineWidth(1.1f); | ||||
if (!g_Renderer.m_SkipSubmit) | if (!g_Renderer.m_SkipSubmit) | ||||
glDrawArrays(GL_LINE_STRIP, 0, vertices.size() / 3); | glDrawArrays(GL_LINE_STRIP, 0, vertices.size() / 3); | ||||
glLineWidth(1.0f); | glLineWidth(1.0f); | ||||
#if !CONFIG2_GLES | |||||
glDisable(GL_LINE_SMOOTH); | glDisable(GL_LINE_SMOOTH); | ||||
#endif | |||||
} | } | ||||
void CChart::DrawTriangleStrip(const CShaderProgramPtr& shader, const CGUIColor& color, const std::vector<float>& vertices) const | void CChart::DrawTriangleStrip(const CShaderProgramPtr& shader, const CGUIColor& color, const std::vector<float>& vertices) const | ||||
{ | { | ||||
shader->Uniform(str_color, color); | shader->Uniform(str_color, color); | ||||
shader->VertexPointer(3, GL_FLOAT, 0, &vertices[0]); | shader->VertexPointer(3, GL_FLOAT, 0, &vertices[0]); | ||||
shader->AssertPointersBound(); | shader->AssertPointersBound(); | ||||
▲ Show 20 Lines • Show All 216 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator