Caching of textures
Posted: 29 Dec 2022, 22:25
Hi there!
I'm implement game UI via Noesis and have get freezes on first open windows where used texture atlas for icons, sure somewhere i'm make mistake with resource organization and missing caching in TextureProvider.
Please, explain to me how to correct preload big texture in TextureProvider and share it between multiply xaml (game windows) in most correct way.
For now i make in each .xaml (like MyGameWindow1.xaml) merged resource with global resource file:
and in Resource.xaml (which in global resource file):
In XamlProvider i realised caching and each .xaml loadings only once in memory, but as follows from my observations it not preventing from loading texture atlases in each .xaml.
As example: MyWindow1.xaml uses Atlas1 and MyWindow2.xaml uses Atlas1, but after open MyWindow1.xaml and get loaded Atlas1 it not loads Atlas1 for MyWindow2.xaml, after open second one window it will be again freeze for first opening.
With best regards.
I'm implement game UI via Noesis and have get freezes on first open windows where used texture atlas for icons, sure somewhere i'm make mistake with resource organization and missing caching in TextureProvider.
Please, explain to me how to correct preload big texture in TextureProvider and share it between multiply xaml (game windows) in most correct way.
For now i make in each .xaml (like MyGameWindow1.xaml) merged resource with global resource file:
Code: Select all
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Resources.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
Code: Select all
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="SkillAtlas_Common.xaml" />
<ResourceDictionary Source="SkillAtlas_Master.xaml" />
</ResourceDictionary.MergedDictionaries>
// ... other Styles, Templates and etc.
As example: MyWindow1.xaml uses Atlas1 and MyWindow2.xaml uses Atlas1, but after open MyWindow1.xaml and get loaded Atlas1 it not loads Atlas1 for MyWindow2.xaml, after open second one window it will be again freeze for first opening.
With best regards.