Skip to content
GitLab
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
8b934bde
Commit
8b934bde
authored
Jan 12, 2012
by
Janis Born
Browse files
only use QImage for file loading when ACGL_COMPILE_WITH_QT is set
parent
7bc45db3
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/ACGL/OpenGL/Controller/TextureControlFileJPG_QImage.cc
View file @
8b934bde
...
...
@@ -5,8 +5,10 @@
#include
<ACGL/OpenGL/Controller/TextureControlFileJPG.hh>
#ifdef ACGL_COMPILE_WITH_QT
#include
<QtGui/QImage>
#include
<QtOpenGL/QGLWidget>
#endif // ACGL_COMPILE_WITH_QT
using
namespace
ACGL
::
Base
;
using
namespace
ACGL
::
OpenGL
;
...
...
@@ -14,6 +16,7 @@ using namespace ACGL::Utils;
bool
TextureControlFileJPG
::
loadJPG
(
SharedTexture
&
texture
)
{
#ifdef ACGL_COMPILE_WITH_QT
QImage
image
=
QImage
(
QString
(
getFullFilePath
().
c_str
()));
if
(
image
.
isNull
())
...
...
@@ -33,4 +36,8 @@ bool TextureControlFileJPG::loadJPG(SharedTexture& texture)
GL_UNSIGNED_BYTE
);
texture
->
generateMipmaps
();
return
true
;
#else
error
()
<<
"Loading image "
<<
getFullFilePath
()
<<
" has failed (QImage not supported)!"
<<
std
::
endl
;
return
false
;
#endif // ACGL_COMPILE_WITH_QT
}
src/ACGL/OpenGL/Controller/TextureDataControlFileJPG.cc
View file @
8b934bde
...
...
@@ -6,14 +6,18 @@
#include
<ACGL/OpenGL/Controller/TextureDataControlFileJPG.hh>
#include
<ACGL/OpenGL/Controller/TextureDataControlFileFactory.hh>
#ifdef ACGL_COMPILE_WITH_QT
#include
<QtGui/QImage>
#include
<QtOpenGL/QGLWidget>
#endif // ACGL_COMPILE_WITH_QT
using
namespace
ACGL
;
using
namespace
ACGL
::
OpenGL
;
using
namespace
ACGL
::
Utils
;
bool
TextureDataControlFileJPG
::
load
(
SharedTextureData
&
texture
)
const
{
#ifdef ACGL_COMPILE_WITH_QT
QImage
image
=
QImage
(
QString
(
getFullFilePath
().
c_str
()));
if
(
image
.
isNull
())
...
...
@@ -29,6 +33,10 @@ bool TextureDataControlFileJPG::load(SharedTextureData& texture) const
texture
->
setWidth
(
image
.
width
());
texture
->
setHeight
(
image
.
height
());
return
true
;
#else
error
()
<<
"Loading image "
<<
getFullFilePath
()
<<
" has failed (QImage not supported)!"
<<
std
::
endl
;
return
false
;
#endif // ACGL_COMPILE_WITH_QT
}
int_t
TextureDataControlFileJPG
::
sTypeID
=
TextureDataControlFileFactory
::
the
()
->
registerType
(
"jpg"
,
&
TextureDataControlFileJPG
::
creator
);
src/ACGL/OpenGL/Controller/TextureDataControlFilePNG.cc
View file @
8b934bde
...
...
@@ -6,14 +6,18 @@
#include
<ACGL/OpenGL/Controller/TextureDataControlFilePNG.hh>
#include
<ACGL/OpenGL/Controller/TextureDataControlFileFactory.hh>
#ifdef ACGL_COMPILE_WITH_QT
#include
<QtGui/QImage>
#include
<QtOpenGL/QGLWidget>
#endif // ACGL_COMPILE_WITH_QT
using
namespace
ACGL
;
using
namespace
ACGL
::
OpenGL
;
using
namespace
ACGL
::
Utils
;
bool
TextureDataControlFilePNG
::
load
(
SharedTextureData
&
texture
)
const
{
#ifdef ACGL_COMPILE_WITH_QT
QImage
image
=
QImage
(
QString
(
getFullFilePath
().
c_str
()));
if
(
image
.
isNull
())
...
...
@@ -29,6 +33,10 @@ bool TextureDataControlFilePNG::load(SharedTextureData& texture) const
texture
->
setWidth
(
image
.
width
());
texture
->
setHeight
(
image
.
height
());
return
true
;
#else
error
()
<<
"Loading image "
<<
getFullFilePath
()
<<
" has failed (QImage not supported)!"
<<
std
::
endl
;
return
false
;
#endif
}
int_t
TextureDataControlFilePNG
::
sTypeID
=
TextureDataControlFileFactory
::
the
()
->
registerType
(
"png"
,
&
TextureDataControlFilePNG
::
creator
);
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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