Hi,
the
loadImage
function returns an
ImageSourceRef, which
can then be used to create the actual texture. In the current version
of Cinder, you should use a
shared pointer to a
gl::Texture, which is
called a
gl::TextureRef. Better
still, try to specify the type of the texture, e.g.
gl::Texture2dRef.
Finally, you may want to load your image from the assets folder, so
use
loadAsset to
find it for you.
To summarize: here's how to load the image and create a
texture from it:
gl::Texture2dRef texture
= gl::Texture2d::create( loadImage( loadAsset(
"image.jpg" ) ) );
-Paul
P.S.: the
Texture classes are defined in
"cinder/gl/Texture.h"
, but you can also include
"cinder/gl/gl.h"
to get access to all the
OpenGL classes. The loadImage function is part of the
"cinder/ImageIo.h"
, which is already
included if you include "cinder/gl/Texture.h"
.