예제 #1
0
        private void CleanupDrawEngine2d()
        {
            DrawEngine2d.UnregisterTexture2dPlus(Key);

            Key = null;
            DrawEngine2d = null;
        }
예제 #2
0
        public static void CreateFont(DrawEngine2d drawEngine2d)
        {
            //These two should be in sync all the time.
            //They should be unified by combining the upper and lower data
            // into a single UInt and kept as a single dict.
            var upper = new Dictionary<Char, UInt32>();
            var lower = new Dictionary<Char, UInt32>();

            PopulateDicts(ref upper, ref lower);

            Int32 textureWidth = MaxTextureCharCapacity * FontWidth;
            Int32 textureHeight = FontHeight;

            Byte[] texturePixels = new Byte[textureWidth * textureHeight];

            //This loop references only one of the two glyph dicts but
            // that is just a convenience. The data from both will be
            // used during the loop.
            foreach(Char c in upper.Keys)
                DecodePixelData(ref upper, ref lower, ref texturePixels, c, textureWidth);

            Texture2dPlus texture = new Texture2dPlus(drawEngine2d,TextureCachePolicy.KeepAlways, TextureKey, textureWidth, textureHeight, PixelFormat.Luminance);
            texture.SetPixels(0, texturePixels, PixelFormat.Luminance);
            texture.SetFilter(TextureFilterMode.Nearest, TextureFilterMode.Nearest, TextureFilterMode.Nearest);

            TiledTexture tiledTexture = new TiledTexture(drawEngine2d,TextureCachePolicy.KeepAlways, DebugFont.TextureKey, texture);
            tiledTexture.CreateColumnIndex(MaxTextureCharCapacity);
        }
예제 #3
0
        private void InitializeDrawEngine2d(DrawEngine2d drawEngine2d, TextureCachePolicy cachePolicy, String key)
        {
            if (drawEngine2d == null)
                throw new ArgumentNullException();

            DrawEngine2d = drawEngine2d;
            Key = key;
            CachePolicy = cachePolicy;

            DrawEngine2d.RegisterTexture2dPlus(Key, this, cachePolicy);
        }
예제 #4
0
 public Texture2dPlus(DrawEngine2d drawEngine2d, TextureCachePolicy cachePolicy, String key, Int32 width, Int32 height, PixelFormat pixelFormat)
     : base(width, height, false, pixelFormat)
 {
     Initialize(drawEngine2d, cachePolicy, key);
 }
예제 #5
0
 internal DebugFont(DrawEngine2d drawEngine2d)
 {
     Initialize(drawEngine2d);
 }
예제 #6
0
 public static void RemoveFont(DrawEngine2d drawEngine2d)
 {
     //TODO: Do we really need to do anything?
 }
예제 #7
0
 private void Initialize(DrawEngine2d drawEngine2d)
 {
     InitializeDrawEngine2d(drawEngine2d);
     InitializeHardcodedFontInfo();
     InitializeCharacterData();
     InitializeTexture();
 }
예제 #8
0
 public TiledTexture(DrawEngine2d drawEngine2d, TextureCachePolicy cachePolicy, String path)
 {
     Initialize(drawEngine2d, cachePolicy, path);
 }
예제 #9
0
        internal static DebugLabel CreateDebugLabel(DrawEngine2d drawEngine2d, LayerType type, IDebuggable parent = null)
        {
            if (drawEngine2d == null || drawEngine2d.IsDisposed)
                throw new ArgumentNullException();

            LayerBase layer;

            switch (type)
            {
                case LayerType.Screen :
                    layer = drawEngine2d.Layers.GetOrCreateScreenDebugLayer();
                    break;
                case LayerType.World :
                    layer = drawEngine2d.Layers.GetOrCreateWorldDebugLayer();
                    break;
                default :
                    throw new ArgumentException();
            }

            return new DebugLabel(layer, parent);
        }
예제 #10
0
 internal LayerManager(DrawEngine2d drawEngine2d)
     : base(drawEngine2d)
 {
 }
예제 #11
0
 internal WorldCamera(DrawEngine2d drawEngine2d)
     : base(drawEngine2d)
 {
 }
예제 #12
0
 private void InitializeDrawEngine2d(DrawEngine2d drawEngine2d)
 {
     DrawEngine2d = drawEngine2d;
     DrawEngine2d.Layers.AddLayer(this);
 }
예제 #13
0
 private void InitializeInternal(DrawEngine2d drawEngine2d, Int32 zIndex)
 {
     InitializeZIndex(zIndex);
     InitializeDrawEngine2d(drawEngine2d);
     InitializeDrawables();
 }
예제 #14
0
 private void CleanupDrawEngine2d()
 {
     DrawEngine2d.Layers.RemoveLayer(this);
     DrawEngine2d = null;
 }
예제 #15
0
 internal FontShader(DrawEngine2d drawEngine2d)
     : base(drawEngine2d)
 {
 }
예제 #16
0
 public SpriteShader(DrawEngine2d drawEngine2d)
     : base(drawEngine2d)
 {
 }
예제 #17
0
 private void Initialize(DrawEngine2d drawEngine2d, TextureCachePolicy cachePolicy, String key)
 {
     InitializeDrawEngine2d(drawEngine2d, cachePolicy, key);
 }
예제 #18
0
        private void Initialize(DrawEngine2d drawEngine2d, TextureCachePolicy cachePolicy, String path)
        {
            InitializeDrawEngine2d(drawEngine2d, cachePolicy, path);
            InitializeTexture2d(path);

            InitializeColumnIndex();
            InitializeGridIndex();
            InitializeNamedIndex();
        }
예제 #19
0
 internal LayerBase(DrawEngine2d drawEngine2d, Int32 zIndex)
 {
     InitializeInternal(drawEngine2d, zIndex);
     Initialize();
 }
예제 #20
0
 internal SpriteShader(DrawEngine2d drawEngine2d)
     : base(drawEngine2d)
 {
 }
예제 #21
0
 internal ScreenLayer(DrawEngine2d drawEngine2d, Int32 zIndex)
     : base(drawEngine2d, zIndex)
 {
 }
예제 #22
0
 private void CleanupDrawEngine2d()
 {
     DrawEngine2d = null;
 }
예제 #23
0
        private void Initialize(DrawEngine2d drawEngine2d, TextureCachePolicy cachePolicy, String key, Texture2dPlus texture)
        {
            InitializeDrawEngine2d(drawEngine2d, cachePolicy, key);
            InitializeTexture2d(texture);

            InitializeColumnIndex();
            InitializeGridIndex();
            InitializeNamedIndex();
        }
예제 #24
0
 internal CameraBase(DrawEngine2d drawEngine2d)
 {
     InitializeInternal(drawEngine2d);
     Initialize();
 }
예제 #25
0
 public TiledTexture(DrawEngine2d drawEngine2d, TextureCachePolicy cachePolicy, String key, Texture2dPlus texture)
 {
     Initialize(drawEngine2d, cachePolicy, key, texture);
 }
예제 #26
0
 private void InitializeDrawEngine2d(DrawEngine2d drawEngine2d)
 {
     DrawEngine2d = drawEngine2d;
 }
예제 #27
0
        private void InitializeInternal(DrawEngine2d drawEngine2d)
        {
            InitializeDrawEngine2d(drawEngine2d);

            InitializeRecalcRequired();
            InitializeProjectionMatrix();
            InitializeBounds();

            InitializeCenter();
            InitializeDimensions();
        }
예제 #28
0
 public Texture2dPlus(DrawEngine2d drawEngine2d, TextureCachePolicy cachePolicy, String path)
     : base(path, false)
 {
     Initialize(drawEngine2d, cachePolicy, path);
 }
예제 #29
0
 public FontShader(DrawEngine2d drawEngine2d)
     : base(drawEngine2d)
 {
 }
예제 #30
0
 internal TiledTextureManager(DrawEngine2d drawEngine2d)
     : base(drawEngine2d)
 {
 }