/* // SDLInitializerで一括して行なうことにした。 * /// <summary> * /// static class constructorはlazy instantiationが保証されているので * /// ここで SDL_imageが間接的に読み込むdllを事前に読み込む。 * /// </summary> * static Surface() * { * // image関連のDLLを必要ならば読み込んでおくべ。 * * DllManager d = DllManager.Instance; * string current = DllManager.DLL_CURRENT; * d.LoadLibrary(current, DLL_SDL_IMAGE); * d.LoadLibrary(current, DLL_ZIP); * d.LoadLibrary(current, DLL_PNG); * d.LoadLibrary(current, DLL_JPEG); * d.LoadLibrary(current, DLL_TIFF); * } */ /// <summary> /// /// </summary> public Surface() { This = this; CacheSystem = UnmanagedResourceManager.Instance.VideoMemory; CacheSystem.Add(this); }
public GlTexture() { This = this; // CacheObjectにmix-inするときのthisを渡す必要がある。 // defaultでUnmanagedResourceManagerのcache systemに接続 CacheSystem = UnmanagedResourceManager.Instance.VideoMemory; CacheSystem.Add(this); }
/// <summary> /// /// </summary> public Font() { This = this; // mix-in classにthisを渡す // defaultでUnmanagedResourceManagerのcache systemに接続 CacheSystem = UnmanagedResourceManager.Instance.UnmanagedMemory; CacheSystem.Add(this); SetColor(255, 255, 255); }
/// <summary> /// static class constructorはlazy instantiationが保証されているので /// ここで SDL_mixerが間接的に読み込むdllを事前に読み込む。 /// </summary> /* SDL_Initializerで行なうように変更 * static Sound() * { * // Sound関連のDLLを必要ならば読み込んでおくべ。 * * DllManager d = DllManager.Instance; * string current = DllManager.DLL_CURRENT; * d.LoadLibrary(current, DLL_OGG); * d.LoadLibrary(current, DLL_VORBIS); * d.LoadLibrary(current, DLL_VORBISFILE); * d.LoadLibrary(current, DLL_SMPEG); * } */ /// <summary> /// コンストラクタでは、Audioデバイスの初期化も行なう。 /// </summary> public Sound() { This = this; // mix-in用 // Audioデバイスの初期化。 // SoundConfig.Update(); // ↑これは、initがコンストラクタで行なう CacheSystem = UnmanagedResourceManager.Instance.SoundMemory; CacheSystem.Add(this); }