/// <summary> /// /// </summary> /// <param name="drawOrder"></param> /// <param name="sortMode"></param> /// <param name="depthMode"></param> /// <returns></returns> public bool Begin(gxtBatchDrawOrder drawOrder, gxtBatchSortMode sortMode, gxtBatchDepthMode depthMode) { gxtDebug.Assert(IsInitialized() || begun); Matrix centeredIdentity = Matrix.Identity; centeredIdentity.M41 = resolutionWidth * 0.5f; centeredIdentity.M42 = resolutionHeight * 0.5f; return Begin(drawOrder, sortMode, depthMode, centeredIdentity); }
/// <summary> /// /// </summary> /// <param name="drawOrder"></param> /// <param name="sortMode"></param> /// <param name="depthMode"></param> /// <param name="viewMatrix"></param> /// <returns></returns> public bool Begin(gxtBatchDrawOrder drawOrder, gxtBatchSortMode sortMode, gxtBatchDepthMode depthMode, Matrix viewMatrix) { gxtDebug.Assert(IsInitialized() || begun); if (!begun) { this.viewMatrix = viewMatrix; Matrix effectView; GetEffectMatrix(ref viewMatrix, out effectView); effect.View = effectView; this.drawOrder = drawOrder; this.sortMode = sortMode; this.depthMode = depthMode; // it appears the spritebatch should always draw in immediate mode SpriteSortMode spriteFontSortMode; if (sortMode == gxtBatchSortMode.IMMEDIATE) spriteFontSortMode = SpriteSortMode.Immediate; else if (depthMode == gxtBatchDepthMode.FRONT_TO_BACK) spriteFontSortMode = SpriteSortMode.FrontToBack; else spriteFontSortMode = SpriteSortMode.BackToFront; spriteBatch.Begin(spriteFontSortMode, BlendState.NonPremultiplied, SamplerState.AnisotropicWrap, DepthStencilState.None, RasterizerState.CullNone, null, viewMatrix); vertexData.Clear(); spriteFontData.Clear(); generalData.Clear(); begun = true; return true; } return false; }
public void Begin(gxtBatchDrawOrder drawOrder, gxtBatchSortMode sortMode, gxtBatchDepthMode depthMode, Matrix[] viewMatrices, Viewport[] viewports) { gxtDebug.Assert(false, "This begin method has not been implemented yet!"); }