Commit 67d811a3 authored by Robert Menzel's avatar Robert Menzel

added more simple texture data load/save functions and a screenshot function

parent b280d4b7
......@@ -34,7 +34,7 @@ public:
mFragDataLocations()
{
mDepthAttachment.name = "";
mDepthAttachment.texture = ConstSharedTexture();
mDepthAttachment.texture = ConstSharedTextureBase();
mDepthAttachment.renderBuffer = ConstSharedRenderBuffer();
}
virtual ~FrameBufferObjectControl() {}
......@@ -43,10 +43,10 @@ public:
// ============================================================================================ METHODS \/
// ==================================================================================================== \/
public:
inline FrameBufferObjectControl& depthTexture (const ConstSharedTexture& _pDepthTexture) { mDepthAttachment.texture = _pDepthTexture; return *this; }
inline FrameBufferObjectControl& depthTexture (const ConstSharedTextureBase& _pDepthTexture) { mDepthAttachment.texture = _pDepthTexture; return *this; }
inline FrameBufferObjectControl& depthRenderBuffer (const ConstSharedRenderBuffer& _pDepthRenderBuffer) { mDepthAttachment.renderBuffer = _pDepthRenderBuffer; return *this; }
inline FrameBufferObjectControl& colorTexture(const std::string& _name, const ConstSharedTexture& _texture)
inline FrameBufferObjectControl& colorTexture(const std::string& _name, const ConstSharedTextureBase& _texture)
{
FrameBufferObject::Attachment attachment = {_name, _texture, SharedRenderBuffer(), (GLuint) mColorAttachments.size(), Image()};
mColorAttachments.push_back(attachment);
......
......@@ -7,6 +7,8 @@
#ifndef ACGL_OPENGL_CONTROLLER_TEXTURECONTROL_HH
#define ACGL_OPENGL_CONTROLLER_TEXTURECONTROL_HH
#ifdef ACGL_INCLUDE_DEPRECATED_FUNCTIONALITY
/**
* Can create an empty texture, if a texture should get loaded from a file,
* see TextureControlFile.
......@@ -121,4 +123,6 @@ protected:
} // OpenGL
} // ACGL
#endif
#endif // ACGL_OPENGL_CONTROLLER_TEXTURECONTROL_HH
......@@ -7,6 +7,8 @@
#ifndef ACGL_OPENGL_CONTROLLER_TEXTURECONTROLCUBEMAP_HH
#define ACGL_OPENGL_CONTROLLER_TEXTURECONTROLCUBEMAP_HH
#ifdef ACGL_INCLUDE_DEPRECATED_FUNCTIONALITY
/**
* Can set up a cube map out of multiple TextureData objects.
*/
......@@ -107,4 +109,6 @@ protected:
} // OpenGL
} // ACGL
#endif
#endif // ACGL_OPENGL_CONTROLLER_TEXTURECONTROL_HH
......@@ -7,6 +7,8 @@
#ifndef ACGL_OPENGL_CONTROLLER_TEXTURECONTROLFILE_HH
#define ACGL_OPENGL_CONTROLLER_TEXTURECONTROLFILE_HH
#ifdef ACGL_INCLUDE_DEPRECATED_FUNCTIONALITY
#include <ACGL/ACGL.hh>
#include <ACGL/Resource/FileController.hh>
......@@ -83,4 +85,6 @@ protected:
} // OpenGL
} // ACGL
#endif
#endif // ACGL_OPENGL_CONTROLLER_TEXTURECONTROLFILE_HH
......@@ -7,6 +7,8 @@
#ifndef ACGL_OPENGL_CONTROLLER_TEXTUREDATACONTROLFILEJPG_HH
#define ACGL_OPENGL_CONTROLLER_TEXTUREDATACONTROLFILEJPG_HH
#ifdef ACGL_INCLUDE_DEPRECATED_FUNCTIONALITY
#include <ACGL/ACGL.hh>
#include <ACGL/OpenGL/Controller/DataControlFile.hh>
......@@ -45,4 +47,6 @@ ACGL_SMARTPOINTER_TYPEDEFS(TextureDataControlFileJPG)
} // OpenGL
} // ACGL
#endif
#endif // ACGL_OPENGL_CONTROLLER_TEXTUREDATACONTROLFILEJPG_HH
......@@ -7,6 +7,8 @@
#ifndef ACGL_OPENGL_CONTROLLER_TEXTUREDATACONTROLFILEPNG_HH
#define ACGL_OPENGL_CONTROLLER_TEXTUREDATACONTROLFILEPNG_HH
#ifdef ACGL_INCLUDE_DEPRECATED_FUNCTIONALITY
#include <ACGL/ACGL.hh>
#include <ACGL/OpenGL/Controller/DataControlFile.hh>
......@@ -45,4 +47,6 @@ ACGL_SMARTPOINTER_TYPEDEFS(TextureDataControlFilePNG)
} // OpenGL
} // ACGL
#endif
#endif // ACGL_OPENGL_CONTROLLER_TEXTUREDATACONTROLFILEPNG_HH
......@@ -7,6 +7,8 @@
#ifndef ACGL_OPENGL_CONTROLLER_TEXTUREDATACONTROLFILEPNM_HH
#define ACGL_OPENGL_CONTROLLER_TEXTUREDATACONTROLFILEPNM_HH
#ifdef ACGL_INCLUDE_DEPRECATED_FUNCTIONALITY
/**
* A minimal PNM loader (with some bugs). No external dependencies, so this is at least
* one image type that can be loaded without extra libs.
......@@ -61,4 +63,6 @@ ACGL_SMARTPOINTER_TYPEDEFS(TextureDataControlFilePNM)
} // OpenGL
} // ACGL
#endif
#endif // ACGL_OPENGL_CONTROLLER_TEXTUREDATACONTROLFILEPNM_HH
......@@ -14,20 +14,74 @@
#include <ACGL/ACGL.hh>
#include <ACGL/OpenGL/Data/TextureData.hh>
#include <ACGL/OpenGL/Tools.hh>
#include <string>
namespace ACGL{
namespace OpenGL{
//! saves to a PPM file
bool saveTextureDataToPPM(const ConstSharedTextureData& _textureData, const std::string &_filename);
///////////////////////////////////////////////////////////////////////////////////////////////////
// generic load/save
///////////////////////////////////////////////////////////////////////////////////////////////////
//! generic load function that will use one of the loading functions below based on the file ending
SharedTextureData loadTextureData(const std::string &_filename);
//! generic save function that will use one of the saving functions below based on the file ending
bool saveTextureData(const SharedTextureData &_textureData, const std::string &_filename);
//! saves the viewport visible part of the framebuffer 0 to a file named _prefix_DATE-TIME._fileEnding
bool saveScreenshot( const std::string &_prefix = "screenshot", const std::string _fileEnding = "png" );
///////////////////////////////////////////////////////////////////////////////////////////////////
// library specific load
///////////////////////////////////////////////////////////////////////////////////////////////////
//! loads from a PNG using the simple lodepng library
SharedTextureData loadTextureDataFromLodepng(const std::string &_filename);
#ifdef ACGL_COMPILE_WITH_QT
//! loads from the QT library
SharedTextureData loadTextureDataFromQT(const std::string &_filename);
#endif
///////////////////////////////////////////////////////////////////////////////////////////////////
// library specific save
///////////////////////////////////////////////////////////////////////////////////////////////////
//! saves to a PPM file
bool saveTextureDataToPPM(const SharedTextureData &_textureData, const std::string &_filename);
//! save to a PNG file with lodepng
bool saveTextureDataToLodepng( SharedTextureData _data, const std::string &_filename );
bool saveTextureDataToLodepng( const SharedTextureData &_data, const std::string &_filename );
#ifdef ACGL_COMPILE_WITH_QT
bool saveTextureDataToQT( const SharedTextureData &_data, const std::string &_filename );
#endif
// helper for saveTextureDataToLodepng
template< typename T>
unsigned char *preProcess( const SharedTextureData &_data)
{
unsigned int channelCount = getNumberOfChannels( _data->getFormat() );
unsigned int pixelCount = _data->getWidth() * _data->getHeight();
T *processedrawdata = new T[pixelCount * channelCount];
// copy & flip the image:
T *originalrawdata = (T*) _data->getData();
for (int i = 0; i < _data->getHeight(); ++i) {
size_t srcOffset = _data->getWidth() * i * channelCount;
size_t dstOffset = _data->getWidth() * (_data->getHeight()-i-1) * channelCount;
memcpy( processedrawdata + dstOffset, originalrawdata + srcOffset, _data->getWidth()*channelCount * sizeof(T) );
}
return (unsigned char *) processedrawdata;
}
} // OpenGL
} // ACGL
......
......@@ -206,11 +206,10 @@ public:
ACGL_SMARTPOINTER_TYPEDEFS(UniformMatrix4f)
//=========================
class UniformTexture : public UniformData<ConstSharedTexture>
class UniformTexture : public UniformData<ConstSharedTextureBase>
{
public:
UniformTexture(void) : UniformData<ConstSharedTexture>() {}
UniformTexture(void) : UniformData<ConstSharedTextureBase>() {}
virtual ~UniformTexture(void) {}
void apply(GLint _location, GLenum _unit) const { glUniform1i(_location, _unit); mValue->bind(_unit); }
};
......
......@@ -39,8 +39,10 @@ typedef Resource::MultiFileManager<ShaderProgram> ShaderProgramFileManager;
typedef Resource::NameManager<ShaderProgramObject> ShaderProgramObjectNameManager;
#ifdef ACGL_INCLUDE_DEPRECATED_FUNCTIONALITY
typedef Resource::NameManager<Texture> TextureNameManager;
typedef Resource::FileManager<Texture> TextureFileManager;
#endif
typedef Resource::NameManager<TextureData> TextureDataNameManager;
typedef Resource::FileManager<TextureData> TextureDataFileManager;
......
......@@ -87,7 +87,7 @@ public:
ACGL::Utils::error() << "could not generate FrameBufferObject!" << std::endl;
return;
}
mDepthAttachment.texture = ConstSharedTexture();
mDepthAttachment.texture = ConstSharedTextureBase();
mDepthAttachment.renderBuffer = ConstSharedRenderBuffer();
mDepthAttachment.name = ""; // not useful here
mDepthAttachment.location = 0; // not useful here
......@@ -133,7 +133,7 @@ public:
*/
inline bool attachColorRenderBuffer(const std::string &_name, const ConstSharedRenderBuffer& _renderBuffer)
{
Attachment a = {_name, SharedTexture(), _renderBuffer, 0xFFFFFFFF, Image()};
Attachment a = {_name, SharedTextureBase(), _renderBuffer, 0xFFFFFFFF, Image()};
return attachColorAttachment( a );
}
......@@ -145,7 +145,7 @@ public:
inline bool attachColorRenderBuffer(const std::string &_name, const ConstSharedRenderBuffer& _renderBuffer, GLuint _location )
{
Attachment a = {_name, SharedTexture(), _renderBuffer, _location, Image()};
Attachment a = {_name, SharedTextureBase(), _renderBuffer, _location, Image()};
return attachColorAttachment( a );
}
......@@ -237,8 +237,12 @@ public:
//! returns the current contents of the default FrameBuffer
//! the format of the returned TextureData will be GL_RGB, the type will be GL_UNSIGNED_INT
//! _readBuffer = GL_INVALID_ENUM will read out the default read buffer
static SharedTextureData getImageData(GLsizei _width, GLsizei _height, GLint _x = 0, GLint _y = 0, GLenum _readBuffer = GL_INVALID_ENUM);
//! get the part of the framebuffer thats part of the current viewport
static SharedTextureData getImageData();
// =================================================================================================== \/
// ============================================================================================ FIELDS \/
// =================================================================================================== \/
......
......@@ -238,6 +238,8 @@ public:
//! sets a texture uniform to a given texture unit and also binds the texture to the same unit
inline void setTexture (GLint _location, const ConstSharedTextureBase& _texture, GLint _unit) const { glUniform1i(_location, _unit); _texture->bind(_unit); }
inline void setTexture (const std::string& _nameInShader, const ConstSharedTextureBase& _texture, GLint _unit) const { setUniform( getUniformLocation(_nameInShader), (GLint) _unit); _texture->bind(_unit); }
#ifdef ACGL_INCLUDE_DEPRECATED_FUNCTIONALITY
//! set the texture to the texture unit the uniform is set to.
//! Note: it is not guaranteed that all uniforms for textures are set to unique samplers by default after linking!
void setTexture( const std::string& _nameInShader, const ConstSharedTexture& _texture ) const {
......@@ -248,6 +250,7 @@ public:
_texture->bind( unit );
}
}
#endif
#if (ACGL_OPENGL_VERSION >= 41)
// DSA versions:
......
......@@ -438,7 +438,7 @@ ACGL_SMARTPOINTER_TYPEDEFS(TextureCubeMap)
#ifdef ACGL_INCLUDE_DEPRECATED_FUNCTIONALITY
//
// Full compatibility with the old Texture class:
//
......@@ -729,7 +729,7 @@ private:
};
ACGL_SMARTPOINTER_TYPEDEFS(Texture)
#endif
} // OpenGL
} // ACGL
......
......@@ -4,6 +4,8 @@
* Distributed under the terms of the MIT License (see LICENSE.TXT). *
**********************************************************************/
#ifdef ACGL_INCLUDE_DEPRECATED_FUNCTIONALITY
#include <ACGL/OpenGL/Controller/TextureControlCubeMap.hh>
using namespace ACGL::Utils;
......@@ -108,3 +110,4 @@ SharedTexture TextureControlCubeMap::create(void)
return texture;
}
#endif
......@@ -4,6 +4,8 @@
* Distributed under the terms of the MIT License (see LICENSE.TXT). *
**********************************************************************/
#ifdef ACGL_INCLUDE_DEPRECATED_FUNCTIONALITY
#include <ACGL/OpenGL/Controller/TextureControlFile.hh>
#include <ACGL/OpenGL/Controller/DataControlFileFactory.hh>
......@@ -101,3 +103,5 @@ bool TextureControlFile::update(SharedTexture& texture)
updateFileModificationTime();
return true;
}
#endif
......@@ -7,6 +7,8 @@
#include <ACGL/OpenGL/Controller/TextureDataControlFileJPG.hh>
#include <ACGL/OpenGL/Controller/DataControlFileFactory.hh>
#ifdef ACGL_INCLUDE_DEPRECATED_FUNCTIONALITY
#ifdef ACGL_COMPILE_WITH_QT
#include <QtGui/QImage>
#include <QtOpenGL/QGLWidget>
......@@ -45,3 +47,5 @@ int_t TextureDataControlFileJPG::registerType(void)
sTypeID = TextureDataControlFileFactory::the()->registerType("jpg", &TextureDataControlFileJPG::creator);
return sTypeID;
}
#endif
......@@ -7,6 +7,8 @@
#include <ACGL/OpenGL/Controller/TextureDataControlFilePNG.hh>
#include <ACGL/OpenGL/Controller/DataControlFileFactory.hh>
#ifdef ACGL_INCLUDE_DEPRECATED_FUNCTIONALITY
#ifdef ACGL_COMPILE_WITH_QT
#include <QtGui/QImage>
#include <QtOpenGL/QGLWidget>
......@@ -45,3 +47,5 @@ int_t TextureDataControlFilePNG::registerType(void)
sTypeID = TextureDataControlFileFactory::the()->registerType("png", &TextureDataControlFilePNG::creator);
return sTypeID;
}
#endif
......@@ -4,6 +4,8 @@
* Distributed under the terms of the MIT License (see LICENSE.TXT). *
**********************************************************************/
#ifdef ACGL_INCLUDE_DEPRECATED_FUNCTIONALITY
#include <ACGL/OpenGL/Controller/TextureDataControlFilePNM.hh>
#include <ACGL/OpenGL/Controller/DataControlFileFactory.hh>
#include <ACGL/OpenGL/Tools.hh>
......@@ -215,3 +217,5 @@ int_t TextureDataControlFilePNM::registerType(void)
sTypeID = TextureDataControlFileFactory::the()->registerType("ppm", &TextureDataControlFilePNM::creator);
return sTypeID;
}
#endif
......@@ -6,6 +6,12 @@
#include <ACGL/OpenGL/Data/TextureDataLoadStore.hh>
#include <ACGL/OpenGL/Tools.hh>
#include <ACGL/Base/FileHelpers.hh>
// for the screenshot function:
#include <ACGL/OpenGL/Objects/FrameBufferObject.hh>
#include <cstdio>
#include <ctime>
#include <fstream>
#include "lodepng/lodepng.h"
......@@ -17,61 +23,74 @@ using namespace ACGL::Utils;
namespace ACGL{
namespace OpenGL{
bool saveTextureDataToPPM(const ConstSharedTextureData& _textureData, const std::string &_filename)
{
if(_textureData->getFormat() != GL_RGB)
{
error() << "saveTextureDataToPPM: Unsupported texture format, must be GL_RGB" << std::endl;
return false;
}
///////////////////////////////////////////////////////////////////////////////////////////////////
// generic load/save
///////////////////////////////////////////////////////////////////////////////////////////////////
std::ofstream outFileStream(_filename.c_str(), std::ios_base::out | std::ios_base::binary);
SharedTextureData loadTextureData(const std::string &_filename)
{
// lower case file ending:
std::string fileEnding = Base::FileHelpers::getFileEnding( _filename );
if(!outFileStream.good())
{
error() << "saveTextureDataToPPM: Could not open file " << _filename << std::endl;
return false;
if (fileEnding == "png") {
return loadTextureDataFromLodepng( _filename );
}
#ifdef ACGL_COMPILE_WITH_QT
else if ( fileEnding == "bmp" || fileEnding == "jpg" || fileEnding == "jpeg"
|| fileEnding == "png" || fileEnding == "pbm" || fileEnding == "ppm"
|| fileEnding == "tif" || fileEnding == "tiff"|| fileEnding == "xbm"
|| fileEnding == "xpm" || fileEnding == "pgm") {
return loadTextureDataFromQT( _filename );
}
#endif
else {
error() << "file format of " << _filename << " not supported" << std::endl;
}
// Use the binary-encoded RGB texture format
outFileStream << "P6" << std::endl;
return SharedTextureData();
}
// Width and height
outFileStream << _textureData->getWidth() << " " << _textureData->getHeight() << std::endl;
bool saveTextureData(const SharedTextureData &_textureData, const std::string &_filename)
{
// lower case file ending:
std::string fileEnding = Base::FileHelpers::getFileEnding( _filename );
// Maximum value
uint_t maxValue;
if(_textureData->getType() == GL_UNSIGNED_BYTE)
{
maxValue = 255;
if (fileEnding == "png") {
return saveTextureDataToLodepng( _textureData, _filename );
}
else
{
error() << "saveTextureDataToPPM: Unsupported texture type, must be GL_UNSIGNED_BYTE" << std::endl;
return false;
#ifdef ACGL_COMPILE_WITH_QT
else if ( fileEnding == "bmp" || fileEnding == "jpg" || fileEnding == "jpeg"
|| fileEnding == "png" || fileEnding == "ppm"
|| fileEnding == "tif" || fileEnding == "tiff"|| fileEnding == "xbm"
|| fileEnding == "xpm") {
return saveTextureDataToQT( _textureData, _filename );
}
#endif
else if (fileEnding == "ppm") {
return saveTextureDataToPPM( _textureData, _filename );
} else {
error() << "file format of " << _filename << " not supported" << std::endl;
}
outFileStream << maxValue;
// Single whitespace as a delimiter
outFileStream << "\n";
return false;
}
// Now, write the image data in binary format
for(GLsizei y = 0; y < _textureData->getHeight(); ++y)
{
for(GLsizei x = 0; x < _textureData->getWidth(); ++x)
{
GLsizei i = ((_textureData->getHeight() - y - 1) * _textureData->getWidth()) + x;
outFileStream.put(_textureData->getData()[(3*i + 0) * getGLTypeSize(_textureData->getType())]);
outFileStream.put(_textureData->getData()[(3*i + 1) * getGLTypeSize(_textureData->getType())]);
outFileStream.put(_textureData->getData()[(3*i + 2) * getGLTypeSize(_textureData->getType())]);
}
}
bool saveScreenshot( const std::string &_prefix, const std::string _fileEnding )
{
time_t rawtime;
time( &rawtime );
outFileStream.close();
return true;
char timestring[30];
strftime( timestring, 30, "_%Y-%m-%d_%H-%M-%S", localtime( &rawtime ) );
std::string filename = _prefix + timestring + "." + _fileEnding;
return ACGL::OpenGL::saveTextureData( FrameBufferObject::getImageData(), filename );
}
///////////////////////////////////////////////////////////////////////////////////////////////////
// library specific load
///////////////////////////////////////////////////////////////////////////////////////////////////
SharedTextureData loadTextureDataFromLodepng(const std::string &_filename)
{
......@@ -149,29 +168,92 @@ SharedTextureData loadTextureDataFromLodepng(const std::string &_filename)
return data;
}
// helper for saveTextureDataToLodepng
template< typename T>
unsigned char *preProcess( SharedTextureData _data)
#ifdef ACGL_COMPILE_WITH_QT
//! loads from the QT library
SharedTextureData loadTextureDataFromQT(const std::string &_filename)
{
unsigned int channelCount = getNumberOfChannels( _data->getFormat() );
SharedTextureData data;
unsigned int pixelCount = _data->getWidth() * _data->getHeight();
T *processedrawdata = new T[pixelCount * channelCount];
QImage image = QImage( QString(_filename.c_str()) );
// copy & flip the image:
T *originalrawdata = (T*) _data->getData();
if (image.isNull())
{
ACGL::Utils::error() << "Loading image " << _filename << " has failed!" << std::endl;
return data;
}
for (int i = 0; i < _data->getHeight(); ++i) {
size_t srcOffset = _data->getWidth() * i * channelCount;
size_t dstOffset = _data->getWidth() * (_data->getHeight()-i-1) * channelCount;
image = QGLWidget::convertToGLFormat(image);
GLubyte *pImageData = new GLubyte[image.byteCount()];
memcpy(pImageData, image.bits(), image.byteCount());
data->setData( pImageData );
data->setWidth( image.width() );
data->setHeight( image.height() );
memcpy( processedrawdata + dstOffset, originalrawdata + srcOffset, _data->getWidth()*channelCount * sizeof(T) );
return data;
}
#endif
///////////////////////////////////////////////////////////////////////////////////////////////////
// library specific save
///////////////////////////////////////////////////////////////////////////////////////////////////
bool saveTextureDataToPPM(const SharedTextureData& _textureData, const std::string &_filename)
{
if(_textureData->getFormat() != GL_RGB)
{
error() << "saveTextureDataToPPM: Unsupported texture format, must be GL_RGB" << std::endl;
return false;
}
std::ofstream outFileStream(_filename.c_str(), std::ios_base::out | std::ios_base::binary);
if(!outFileStream.good())
{
error() << "saveTextureDataToPPM: Could not open file " << _filename << std::endl;
return false;
}
// Use the binary-encoded RGB texture format
outFileStream << "P6" << std::endl;
// Width and height
outFileStream << _textureData->getWidth() << " " << _textureData->getHeight() << std::endl;
// Maximum value
uint_t maxValue;
if(_textureData->getType() == GL_UNSIGNED_BYTE)
{
maxValue = 255;
}
else
{
error() << "saveTextureDataToPPM: Unsupported texture type, must be GL_UNSIGNED_BYTE" << std::endl;
return false;
}
outFileStream << maxValue;
// Single whitespace as a delimiter
outFileStream << "\n";
// Now, write the image data in binary format
for(GLsizei y = 0; y < _textureData->getHeight(); ++y)
{
for(GLsizei x = 0; x < _textureData->getWidth(); ++x)
{
GLsizei i = ((_textureData->getHeight() - y - 1) * _textureData->getWidth()) + x;
outFileStream.put(_textureData->getData()[(3*i + 0) * getGLTypeSize(_textureData->getType())]);
outFileStream.put(_textureData->getData()[(3*i + 1) * getGLTypeSize(_textureData->getType())]);
outFileStream.put(_textureData->getData()[(3*i + 2) * getGLTypeSize(_textureData->getType())]);
}
}
return (unsigned char *) processedrawdata;
outFileStream.close();
return true;
}
bool saveTextureDataToLodepng( SharedTextureData _data, const std::string &_filename )
bool saveTextureDataToLodepng( const SharedTextureData &_data, const std::string &_filename )
{
GLenum channelDataType = _data->getType();
unsigned int channelCount = getNumberOfChannels( _data->getFormat() );
......@@ -228,6 +310,13 @@ bool saveTextureDataToLodepng( SharedTextureData _data, const std::string &_file
return true;
}
#ifdef ACGL_COMPILE_WITH_QT
bool saveTextureDataToQT( const SharedTextureData &_data, const std::string &_filename )
{
// TODO implement me
return false;
}
#endif
} // OpenGL
} // ACGL
......@@ -17,6 +17,7 @@ using namespace ACGL::OpenGL;
void ACGL::OpenGL::initStaticFileTypes(void)
{
#ifdef ACGL_INCLUDE_DEPRECATED_FUNCTIONALITY
//
// Textures
//
......@@ -25,7 +26,7 @@ void ACGL::OpenGL::initStaticFileTypes(void)
TextureDataControlFilePNG::registerType();
#endif
TextureDataControlFilePNM::registerType();
#endif
//
// Geometry, Meshes, Vertex data
//
......
......@@ -5,6 +5,7 @@
**********************************************************************/
#include <ACGL/OpenGL/Objects/FrameBufferObject.hh>
#include <ACGL/OpenGL/HiLevelObjects/Viewport.hh>
using namespace ACGL;
using namespace ACGL::OpenGL;
......@@ -309,3 +310,12 @@ SharedTextureData FrameBufferObject::getImageData(GLsizei _width, GLsizei _heigh
return texData;
}
SharedTextureData FrameBufferObject::getImageData()
{
Viewport currentViewport;
currentViewport.setFromGLContext();
return FrameBufferObject::getImageData( currentViewport.getWidth(), currentViewport.getHeight(), currentViewport.getOffsetX(), currentViewport.getOffsetY() );
}
......@@ -690,6 +690,8 @@ void TextureBase::texSubImage3D( const SharedTextureData &_data, GLint _mipmapLe
openGLRareErrorOccured();
}
#ifdef ACGL_INCLUDE_DEPRECATED_FUNCTIONALITY
//////////////////////////////////////////////////////////////////////////
//