private void CleanupDrawEngine2d() { DrawEngine2d.UnregisterTexture2dPlus(Key); Key = null; DrawEngine2d = null; }
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); }
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); }
public Texture2dPlus(DrawEngine2d drawEngine2d, TextureCachePolicy cachePolicy, String key, Int32 width, Int32 height, PixelFormat pixelFormat) : base(width, height, false, pixelFormat) { Initialize(drawEngine2d, cachePolicy, key); }
internal DebugFont(DrawEngine2d drawEngine2d) { Initialize(drawEngine2d); }
public static void RemoveFont(DrawEngine2d drawEngine2d) { //TODO: Do we really need to do anything? }
private void Initialize(DrawEngine2d drawEngine2d) { InitializeDrawEngine2d(drawEngine2d); InitializeHardcodedFontInfo(); InitializeCharacterData(); InitializeTexture(); }
public TiledTexture(DrawEngine2d drawEngine2d, TextureCachePolicy cachePolicy, String path) { Initialize(drawEngine2d, cachePolicy, path); }
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); }
internal LayerManager(DrawEngine2d drawEngine2d) : base(drawEngine2d) { }
internal WorldCamera(DrawEngine2d drawEngine2d) : base(drawEngine2d) { }
private void InitializeDrawEngine2d(DrawEngine2d drawEngine2d) { DrawEngine2d = drawEngine2d; DrawEngine2d.Layers.AddLayer(this); }
private void InitializeInternal(DrawEngine2d drawEngine2d, Int32 zIndex) { InitializeZIndex(zIndex); InitializeDrawEngine2d(drawEngine2d); InitializeDrawables(); }
private void CleanupDrawEngine2d() { DrawEngine2d.Layers.RemoveLayer(this); DrawEngine2d = null; }
internal FontShader(DrawEngine2d drawEngine2d) : base(drawEngine2d) { }
public SpriteShader(DrawEngine2d drawEngine2d) : base(drawEngine2d) { }
private void Initialize(DrawEngine2d drawEngine2d, TextureCachePolicy cachePolicy, String key) { InitializeDrawEngine2d(drawEngine2d, cachePolicy, key); }
private void Initialize(DrawEngine2d drawEngine2d, TextureCachePolicy cachePolicy, String path) { InitializeDrawEngine2d(drawEngine2d, cachePolicy, path); InitializeTexture2d(path); InitializeColumnIndex(); InitializeGridIndex(); InitializeNamedIndex(); }
internal LayerBase(DrawEngine2d drawEngine2d, Int32 zIndex) { InitializeInternal(drawEngine2d, zIndex); Initialize(); }
internal SpriteShader(DrawEngine2d drawEngine2d) : base(drawEngine2d) { }
internal ScreenLayer(DrawEngine2d drawEngine2d, Int32 zIndex) : base(drawEngine2d, zIndex) { }
private void CleanupDrawEngine2d() { DrawEngine2d = null; }
private void Initialize(DrawEngine2d drawEngine2d, TextureCachePolicy cachePolicy, String key, Texture2dPlus texture) { InitializeDrawEngine2d(drawEngine2d, cachePolicy, key); InitializeTexture2d(texture); InitializeColumnIndex(); InitializeGridIndex(); InitializeNamedIndex(); }
internal CameraBase(DrawEngine2d drawEngine2d) { InitializeInternal(drawEngine2d); Initialize(); }
public TiledTexture(DrawEngine2d drawEngine2d, TextureCachePolicy cachePolicy, String key, Texture2dPlus texture) { Initialize(drawEngine2d, cachePolicy, key, texture); }
private void InitializeDrawEngine2d(DrawEngine2d drawEngine2d) { DrawEngine2d = drawEngine2d; }
private void InitializeInternal(DrawEngine2d drawEngine2d) { InitializeDrawEngine2d(drawEngine2d); InitializeRecalcRequired(); InitializeProjectionMatrix(); InitializeBounds(); InitializeCenter(); InitializeDimensions(); }
public Texture2dPlus(DrawEngine2d drawEngine2d, TextureCachePolicy cachePolicy, String path) : base(path, false) { Initialize(drawEngine2d, cachePolicy, path); }
public FontShader(DrawEngine2d drawEngine2d) : base(drawEngine2d) { }
internal TiledTextureManager(DrawEngine2d drawEngine2d) : base(drawEngine2d) { }