| 958 | } |
| 959 | |
| 960 | bool TriTextureRes::CreateFromHostBitmap( Tr2HostBitmap* bitmap ) |
| 961 | { |
| 962 | USE_MAIN_THREAD_RENDER_CONTEXT(); |
| 963 | |
| 964 | DestroyOwnTexture(); |
| 965 | |
| 966 | if( !bitmap || !bitmap->IsValid() || !Tr2Renderer::IsResourceCreationAllowed() ) |
| 967 | { |
| 968 | return false; |
| 969 | } |
| 970 | |
| 971 | uint32_t memoryUse; |
| 972 | if( !Tr2ImageIOHelpers::CreateTexture( *bitmap, m_ownTexture, memoryUse, renderContext, USAGE_IMMUTABLE ) ) |
| 973 | { |
| 974 | return false; |
| 975 | } |
| 976 | m_isTextureResizable = false; |
| 977 | SetTexture( m_ownTexture ); |
| 978 | return true; |
| 979 | } |
| 980 | |
| 981 | bool TriTextureRes::CreateEmptyTexture( uint32_t width, uint32_t height, uint32_t mipCount, Tr2RenderContextEnum::PixelFormat format ) |
| 982 | { |
no test coverage detected