Commit e8f64be6 authored by Martin Schultz's avatar Martin Schultz

use utility class for image conversion

parent b6adacd1
...@@ -51,6 +51,7 @@ ...@@ -51,6 +51,7 @@
#include <ACG/GL/globjects.hh> #include <ACG/GL/globjects.hh>
#include <ACG/GL/GLFormatInfo.hh> #include <ACG/GL/GLFormatInfo.hh>
#include <ACG/ShaderUtils/GLSLShader.hh> #include <ACG/ShaderUtils/GLSLShader.hh>
#include <ACG/Utils/ImageConversion.hh>
#include <QImage> #include <QImage>
#include <QGLWidget> #include <QGLWidget>
...@@ -640,7 +641,7 @@ bool Texture2D::loadFromFile( const std::string& _filename, GLenum _minFilter, G ...@@ -640,7 +641,7 @@ bool Texture2D::loadFromFile( const std::string& _filename, GLenum _minFilter, G
if (mipmaps) if (mipmaps)
autogenerateMipMaps(); autogenerateMipMaps();
QImage gltex = QGLWidget::convertToGLFormat ( qtex ); QImage gltex = ACG::Util::convertToGLFormat(gltex);
setData(0, GL_RGBA, gltex.width(), gltex.height(), GL_RGBA, GL_UNSIGNED_BYTE, gltex.bits()); setData(0, GL_RGBA, gltex.width(), gltex.height(), GL_RGBA, GL_UNSIGNED_BYTE, gltex.bits());
} }
......
...@@ -63,6 +63,7 @@ ...@@ -63,6 +63,7 @@
#include <ACG/GL/acg_glew.hh> #include <ACG/GL/acg_glew.hh>
#include "TextNode.hh" #include "TextNode.hh"
#include "../Utils/ImageConversion.hh"
//== NAMESPACES =============================================================== //== NAMESPACES ===============================================================
...@@ -405,7 +406,7 @@ updateFont() { ...@@ -405,7 +406,7 @@ updateFont() {
painter.end(); painter.end();
// convert finalImage to an OpenGL friendly format // convert finalImage to an OpenGL friendly format
finalImage = QGLWidget::convertToGLFormat(finalImage); finalImage = ACG::Util::convertToGLFormat(finalImage);
// generate a new texture from finalImage // generate a new texture from finalImage
if (!texture_) if (!texture_)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment