void smapGenViewTex(SphereMap *smap, int view) { initGenViewTex(smap); genViewTex(smap, view); copyImageToTexture(smap, smap->viewTexObjs[view], smap->viewOrigin, smap->viewTexDim); }
void smapGenSphereMapFromViewTexs(SphereMap *smap) { initDrawSphereMapMesh(smap); drawSphereMapMesh(smap); copyImageToTexture(smap, smap->smapTexObj, smap->smapOrigin, smap->smapTexDim); }
void smapGenViewTexs(SphereMap *smap) { int view; initGenViewTex(smap); for (view=0; view<6; view++) { genViewTex(smap, view); copyImageToTexture(smap, smap->viewTexObjs[view], smap->viewOrigin, smap->viewTexDim); } }
void smapGenSphereMapWithOneViewTex(SphereMap *smap) { int side; /* Make sure viewports are not obviously overlapping. */ assert(smap->viewOrigin[X] != smap->smapOrigin[X]); assert(smap->viewOrigin[Y] != smap->smapOrigin[Y]); /* Calculate sphere map mesh if needed. */ __smapValidateSphereMapMesh(smap->mesh); /* Five front and side faces. */ for (side=0; side<5; side++) { initGenViewTex(smap); genViewTex(smap, side); copyImageToTexture(smap, smap->viewTexObj, smap->viewOrigin, smap->viewTexDim); /* Preceeding copyImageToTexture does bind to smap->viewTexObj */ initDrawSphereMapMesh(smap); __smapDrawSphereMapMeshSide(smap->mesh, side); } initGenViewTex(smap); genViewTex(smap, SMAP_BACK); copyImageToTexture(smap, smap->viewTexObj, smap->viewOrigin, smap->viewTexDim); /* Preceeding copyImageToTexture does bind to smap->viewTexObj */ initDrawSphereMapMesh(smap); __smapDrawSphereMapMeshBack(smap->mesh); copyImageToTexture(smap, smap->smapTexObj, smap->smapOrigin, smap->smapTexDim); }
// static std::shared_ptr< DynamicTexture2D > D3D11Utils_Texture::createTextureFromImage( ID3D11Device* pDevice, const Image4ub& im, bool flipUD ) { std::shared_ptr< DynamicTexture2D > pTexture( DynamicTexture2D::createUnsignedByte4( pDevice, im.width(), im.height() ) ); copyImageToTexture( im, pTexture, flipUD ); return pTexture; }