MCPcopy Create free account
hub / github.com/MyGUI/mygui / lock

Method lock

Platforms/Ogre/OgrePlatform/src/MyGUI_OgreTexture.cpp:82–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80 }
81
82 void* OgreTexture::lock(TextureUsage _access)
83 {
84 if (_access == TextureUsage::Write)
85 {
86 return mTexture->getBuffer()->lock(Ogre::HardwareBuffer::HBL_WRITE_ONLY);
87 }
88
89 // здесь проверить режим создания, и возможно так залочить без пиксель бокса
90
91 // для чтения копируем в пиксель бокс
92 delete[] (uint8*)mTmpData.data;
93 mTmpData.data = nullptr;
94
95 mTmpData =
96 Ogre::PixelBox(mTexture->getWidth(), mTexture->getHeight(), mTexture->getDepth(), mTexture->getFormat());
97 mTmpData.data = new uint8[mTexture->getBuffer()->getSizeInBytes()];
98
99 mTexture->getBuffer()->blitToMemory(mTmpData);
100
101 return mTmpData.data;
102 }
103
104 void OgreTexture::unlock()
105 {

Callers 1

updateMethod · 0.45

Calls 4

getWidthMethod · 0.45
getHeightMethod · 0.45
getDepthMethod · 0.45
getFormatMethod · 0.45

Tested by

no test coverage detected