git-svn-id: svn://db.shs.com.ru/libs@536 a8b55f48-bf90-11e4-a774-851b48703e85

This commit is contained in:
2019-05-24 19:06:35 +00:00
parent 1082db07c6
commit 58fce3cd81
29 changed files with 394 additions and 599 deletions

View File

@@ -33,9 +33,7 @@ GLVBO::~GLVBO() {
void GLVBO::init() {
#if QT_VERSION >= 0x050600
initializeOpenGLFunctions();
#endif
if (!isInit()) {
//glGenVertexArrays(1, &va_);
glGenBuffers(1, &buffer_);
@@ -83,9 +81,7 @@ void GLVBO::calculateBinormals() {
bool GLVBO::rebuffer(bool clear_) {
#if QT_VERSION >= 0x050600
initializeOpenGLFunctions();
#endif
QVector<GLfloat> data;
//data.clear();
calculateBinormals();
@@ -120,7 +116,7 @@ bool GLVBO::rebuffer(bool clear_) {
}
void GLVBO::draw(GLenum type, __GLShaderProgram__ * prog, bool simplest) {
void GLVBO::draw(GLenum type, QOpenGLShaderProgram * prog, bool simplest) {
if (buffer_ == 0 || vert_count == 0) return;
if (changed) rebuffer();
//qDebug() << "draw" << vert_count;
@@ -289,9 +285,8 @@ bool GLVBO::loadFromFile(const QString & filename) {
}
Box3D GLVBO::boundingBox(const QMatrix4x4 & mat) const {
Box3D GLVBO::boundingBox() const {
if (vertices_.size() < 3) return Box3D();
bool mi = mat.isIdentity();
int vcnt = vertices_.size() / 3;
//qDebug() << "calculateBinormals" << vcnt << tcnt << vertices_.size() << texcoords_.size() << "...";
GLfloat mix, miy, miz, max, may, maz;