Load() 공개 정적인 메소드

public static Load ( string name ) : Texture2D
name string
리턴 Texture2D
예제 #1
0
        private static void Run(object context)
        {
            bool looping = true;

            Main.instance.add_Exiting((EventHandler <EventArgs>)((obj, args) =>
            {
                looping = false;
                if (!Monitor.TryEnter(TextureManager._loadThreadLock))
                {
                    return;
                }
                Monitor.Pulse(TextureManager._loadThreadLock);
                Monitor.Exit(TextureManager._loadThreadLock);
            }));
            Monitor.Enter(TextureManager._loadThreadLock);
            while (looping)
            {
                if (TextureManager._loadQueue.Count != 0)
                {
                    TextureManager.LoadPair result;
                    if (TextureManager._loadQueue.TryDequeue(out result))
                    {
                        result.TextureRef.Value = TextureManager.Load(result.Path);
                    }
                }
                else
                {
                    Monitor.Wait(TextureManager._loadThreadLock);
                }
            }
            Monitor.Exit(TextureManager._loadThreadLock);
        }
예제 #2
0
 public static Ref <Texture2D> AsyncLoad(string name)
 {
     return(new Ref <Texture2D>(TextureManager.Load(name)));
 }