Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ACGL
acgl
Commits
004694a7
Commit
004694a7
authored
Oct 23, 2013
by
Janis Born
Browse files
change signature for custom texture loading functions
Warning: might break some existing code
parent
6d9ff644
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/ACGL/OpenGL/Data/TextureDataLoadStore.hh
View file @
004694a7
...
...
@@ -29,7 +29,7 @@ namespace OpenGL{
///////////////////////////////////////////////////////////////////////////////////////////////////
//! functionpointer which can be used for generic Texture loading
typedef
SharedTextureData
(
*
TextureLoadFuncPtr
)(
const
std
::
string
&
);
typedef
SharedTextureData
(
*
TextureLoadFuncPtr
)(
const
std
::
string
&
,
ColorSpace
);
//! registers a functionpointer to be used for loading specified file types (E.G. provide a load function which loads compressed)
void
registerTextureLoadFunction
(
std
::
vector
<
std
::
string
>
_endings
,
TextureLoadFuncPtr
_function
);
...
...
src/ACGL/OpenGL/Data/TextureDataLoadStore.cc
View file @
004694a7
...
...
@@ -93,22 +93,22 @@ SharedTextureData loadTextureData(const std::string &_filename, ColorSpace _colo
SharedTextureData
textureData
;
if
(
textureLoadFunctions
.
find
(
fileEnding
)
!=
textureLoadFunctions
.
end
())
{
textureData
=
textureLoadFunctions
[
fileEnding
](
_filename
);
textureData
=
textureLoadFunctions
[
fileEnding
](
_filename
,
_colorSpace
);
}
else
if
(
fileEnding
==
"png"
)
{
textureData
=
loadTextureDataFromLodepng
(
_filename
);
textureData
=
loadTextureDataFromLodepng
(
_filename
,
_colorSpace
);
}
else
if
(
fileEnding
==
"hdr"
)
{
textureData
=
loadTextureDataFromRGBE
(
_filename
);
textureData
=
loadTextureDataFromRGBE
(
_filename
,
_colorSpace
);
}
else
if
(
fileEnding
==
"exr"
)
{
textureData
=
loadTextureDataFromEXR
(
_filename
);
textureData
=
loadTextureDataFromEXR
(
_filename
,
_colorSpace
);
}
else
if
(
fileEnding
==
"ppm"
)
{
textureData
=
loadTextureDataFromPNM
(
_filename
);
textureData
=
loadTextureDataFromPNM
(
_filename
,
_colorSpace
);
}
#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"
)
{
textureData
=
loadTextureDataFromQT
(
_filename
);
textureData
=
loadTextureDataFromQT
(
_filename
,
_colorSpace
);
}
#endif
else
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment