#include "textureinformation.h"
#include "ui_textureinformation.h"
#include "modelcreatordata.h"
#include "gltostring.h"

TextureInformation::TextureInformation(QWidget *parent) :
    QWidget(parent),
    m_ui(new Ui::TextureInformation)
{
    m_ui->setupUi(this);
}

TextureInformation::~TextureInformation()
{
    delete m_ui;
}

void TextureInformation::changeEvent(QEvent *e)
{
    QWidget::changeEvent(e);
    switch (e->type()) {
    case QEvent::LanguageChange:
        m_ui->retranslateUi(this);
        break;
    default:
        break;
    }
}

void TextureInformation::textureLoaded(int id)
{
    QString lod_levels;
    lod_levels.setNum(MCD->texture[id].get_header()->lod_number, 10);
    QString is_compressed;
    is_compressed.setNum(MCD->texture[id].get_header()->is_comressed, 10);
    QString data_format;\
    data_format = gl2string(MCD->texture[id].get_header()->internal_format);
    QString data_type;
    data_type = gl2string(MCD->texture[id].get_header()->type);
    m_ui->LODLevels->setText(lod_levels);
    m_ui->DataFormat->setText(data_format);
    m_ui->DataType->setText(data_type);
    m_ui->IsCompressed->setText(is_compressed);
}
