MCPcopy Create free account
hub / github.com/OGRECave/ogre-next / doImageIO

Function doImageIO

RenderSystems/GLES2/src/OgreGLES2Texture.cpp:39–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37
38namespace Ogre {
39 static inline void doImageIO(const String &name, const String &group,
40 const String &ext,
41 vector<Image>::type &images,
42 Texture *tex)
43 {
44 size_t imgIdx = images.size();
45 images.push_back(Image());
46
47 DataStreamPtr dstream =
48 ResourceGroupManager::getSingleton().openResource(
49 name, group, true, tex);
50
51 images[imgIdx].load(dstream, ext);
52
53 if(!Root::getSingleton().getRenderSystem()->getCapabilities()->hasCapability(RSC_NON_POWER_OF_2_TEXTURES) ||
54 (Root::getSingleton().getRenderSystem()->getCapabilities()->getNonPOW2TexturesLimited() && tex->getNumMipmaps() > 0))
55 {
56 size_t w = 0, h = 0;
57
58 // Scale to nearest power of 2
59 w = GLES2PixelUtil::optionalPO2(images[imgIdx].getWidth());
60 h = GLES2PixelUtil::optionalPO2(images[imgIdx].getHeight());
61 if((images[imgIdx].getWidth() != w) || (images[imgIdx].getHeight() != h))
62 images[imgIdx].resize(w, h);
63 }
64 }
65
66 GLES2Texture::GLES2Texture(ResourceManager* creator, const String& name,
67 ResourceHandle handle, const String& group, bool isManual,

Callers 1

prepareImplMethod · 0.85

Calls 9

openResourceMethod · 0.80
sizeMethod · 0.45
push_backMethod · 0.45
loadMethod · 0.45
getRenderSystemMethod · 0.45
getNumMipmapsMethod · 0.45
getWidthMethod · 0.45
getHeightMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected