本文整理汇总了C#中IRenderer.Render方法的典型用法代码示例。如果您正苦于以下问题:C# IRenderer.Render方法的具体用法?C# IRenderer.Render怎么用?C# IRenderer.Render使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IRenderer
的用法示例。
在下文中一共展示了IRenderer.Render方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Render
public void Render(IRenderer renderer)
{
foreach (var position in this.elements)
{
renderer.Render(position.x, position.y, 'o');
}
}
示例2: LetsPlay
private static void LetsPlay(IRenderer _renderer, Game _game)
{
_renderer.Render();
var turnMode = true;
foreach (var gamePhase in _game.Turns())
{
switch (gamePhase)
{
case Game.EGamePhase.BOARD_PREPARE:
continue;
case Game.EGamePhase.JUST_REDRAW:
_renderer.Render();
break;
case Game.EGamePhase.TURN_DONE:
_renderer.Render();
break;
default:
throw new ArgumentOutOfRangeException();
}
}
Console.WriteLine(_game.Player + " gives up.");
}
示例3: LoadFrontEnd
private void LoadFrontEnd()
{
try //try to load a GUI as front-end
{
UimlDocument feUimlDoc = new UimlDocument(m_frontendFile);
renderer = (new BackendFactory()).CreateRenderer(feUimlDoc.Vocabulary);
IRenderedInstance instance = renderer.Render(feUimlDoc);
ExternalLibraries.Instance.Add(m_frontendLib);
feUimlDoc.Connect(this);
// add to the list
renderedUIs.Add(m_frontendFile, instance);
instance.ShowIt();
}
catch(Exception e)
{
//no interface available, use command-line options!
throw new NoGuiAvailableException(e);
}
}
示例4: CheckAllGeneratedTriplets
private static void CheckAllGeneratedTriplets(IRenderer _renderer, Board _board)
{
foreach (var triplet in _board.Triplets)
{
foreach (var cell in _board.Cells)
{
cell.Clear();
}
triplet.Cells[0].Value = 3;
triplet.Cells[1].Value = 1;
triplet.Cells[2].Value = 1;
_renderer.Render();
Console.WriteLine("Triplet: " + triplet);
Console.ReadKey(true);
}
}
示例5: Init
public static void Init(GlobalState state)
{
if (state != null) {
_state = state;
BaseRenderer.UpdateState((BaseRenderer)BackgroundRenderer, state);
BaseRenderer.UpdateState((BaseRenderer)MagicRenderer, state);
}
if (IsInitialized) return;
_deviceManager1 = new CommonDX.DeviceManager();
_deviceManager2 = new CommonDX.DeviceManager();
_renderer1 = new DxRenderer.BackgroundComposer() { State = _state };
_renderer2 = new DxRenderer.MagicComposer() { State = _state };
BackgroundSIS = new SumoNinjaMonkey.Framework.Controls.DrawingSurfaceSIS(
(gt) => { _renderer1.Update(gt); },
(tb) => { _renderer1.Render(tb); },
(dm) => { _renderer1.Initialize(dm); },
(e1, e2) => { _renderer1.InitializeUI(e1, e2); },
(uri) => { _renderer1.LoadLocalAsset(uri); },
() => { _renderer1.Unload(); },
_deviceManager1);
//_renderer1, _deviceManager1);
MagicSIS = new SumoNinjaMonkey.Framework.Controls.DrawingSurfaceSIS(
(gt) => { _renderer2.Update(gt); },
(tb) => { _renderer2.Render(tb); },
(dm) => { _renderer2.Initialize(dm); },
(e1, e2) => { _renderer2.InitializeUI(e1, e2); },
(uri) => { _renderer2.LoadLocalAsset(uri); },
() => { _renderer2.Unload(); },
_deviceManager2);
//_renderer2, _deviceManager2);
IsInitialized = true;
}
示例6: RenderRelease
private string RenderRelease(string key, string renderTo, IRenderer renderer)
{
if (!bundleCache.ContainsKey(key))
{
lock (bundleCache)
{
if (!bundleCache.ContainsKey(key))
{
string compressedJavaScript;
string hash = null;
bool hashInFileName = false;
List<string> files = GetFiles(GetFilePaths(javaScriptFiles));
files.AddRange(GetFiles(GetEmbeddedResourcePaths(embeddedResourceJavaScriptFiles)));
if (renderTo.Contains("#"))
{
hashInFileName = true;
compressedJavaScript = MinifyJavaScript(files, javaScriptMinifier);
hash = hasher.GetHash(compressedJavaScript);
renderTo = renderTo.Replace("#", hash);
}
var outputFile = ResolveAppRelativePathToFileSystem(renderTo);
string minifiedJavaScript;
if (renderOnlyIfOutputFileMissing && FileExists(outputFile))
{
minifiedJavaScript = ReadFile(outputFile);
}
else
{
minifiedJavaScript = MinifyJavaScript(files, javaScriptMinifier);
renderer.Render(minifiedJavaScript, outputFile);
}
if (hash == null)
{
hash = hasher.GetHash(minifiedJavaScript);
}
string renderedScriptTag;
if (hashInFileName)
{
renderedScriptTag = FillTemplate(ExpandAppRelativePath(renderTo));
}
else
{
string path = ExpandAppRelativePath(renderTo);
if (path.Contains("?"))
{
renderedScriptTag = FillTemplate(ExpandAppRelativePath(renderTo) + "&r=" + hash);
}
else
{
renderedScriptTag = FillTemplate(ExpandAppRelativePath(renderTo) + "?r=" + hash);
}
}
renderedScriptTag = String.Concat(GetFilesForRemote(), renderedScriptTag);
bundleCache.AddToCache(key, renderedScriptTag, files);
}
}
}
return bundleCache.GetContent(key);
}
示例7: Clear
public void Clear(IRenderer renderer)
{
renderer.Render(this.elements.First().x, this.elements.First().y, ' ');
}
示例8: RenderVideoUsingSplicer
private static void RenderVideoUsingSplicer(IRenderer renderer)
{
try
{
Console.WriteLine("Beginning render");
renderer.Render();
}
finally
{
var disposable = renderer as IDisposable;
if (disposable != null) disposable.Dispose();
}
}
示例9: RenderMapper
private static bool RenderMapper(ReceiverList<IRenderer, int> list, IRenderer receiver, int parameter)
{
return receiver.Render(parameter);
}
示例10: Write
/// <summary> </summary>
private void Write(ClassMapping classMapping, IDictionary class2classmap, IRenderer renderer,bool checkIfNewer)
{
string saveToPackage = renderer.GetSaveToPackage(classMapping);
string saveToClassName = renderer.GetSaveToClassName(classMapping);
FileInfo dir = this.GetDir(saveToPackage);
StreamWriter writer = null;
// a render implementing this interface can
// decide a stream for output, so a directive in the
// generation code can drive the output naming...
ICanProvideStream streamProvider = renderer as ICanProvideStream;
string fileName=null;
bool performGeneration = true;
try
{
if (null == streamProvider)
{
fileName = Path.Combine(dir.FullName, this.GetFileName(saveToClassName));
FileInfo file = new FileInfo(fileName);
if (checkIfNewer)
{
FileInfo sourceFileinfo = SourceFileInfoMap.Instance.LookupByMapping(classMapping);
performGeneration = sourceFileinfo.LastWriteTimeUtc >= file.LastWriteTimeUtc;
if (false == performGeneration)
LogFileSkipped(sourceFileinfo, file);
}
if (performGeneration)
{
log.Debug("Writing " + file);
writer = new StreamWriter(new FileStream(file.FullName, FileMode.Create));
}
}
else
{
if (performGeneration)
{
if (checkIfNewer)
{
FileInfo sourceFileinfo = SourceFileInfoMap.Instance.LookupByMapping(classMapping);
FileInfo target;
performGeneration = streamProvider.CheckIfSourceIsNewer(sourceFileinfo.LastWriteTimeUtc, dir.FullName, classMapping, out target);
if (false == performGeneration)
LogFileSkipped(sourceFileinfo, target);
}
if (performGeneration)
writer = new StreamWriter(streamProvider.GetStream(classMapping, dir.FullName, out fileName));
log.Debug("Renderer:" + renderer.GetType().Name + " provided a stream for output.");
}
}
if (performGeneration)
{
renderer.Render(GetPackageName(saveToPackage), GetName(saveToClassName), classMapping, class2classmap, writer);
writer.Close();
if (null != fileObserver)
{
fileObserver.FileCreated(fileName);
}
}
}
catch (Exception e)
{
log.Error("Error writing file:", e);
}
}
示例11: Render
protected void Render(IRenderer renderer, ITexture2D texture, AxisAlignedBoundingBox2D boundingBox)
{
if (!IsVisible) return;
renderer.Render(texture, Transformation, boundingBox);
}
示例12: Render
public virtual void Render(IRenderer renderer)
{
renderer.Render(this);
}
示例13: Render
public void Render(IRenderer renderer)
{
rasterizer.ClearImage((byte)' ', (byte)((Kernel32Console.DefaultColors.Foreground.BLACK << 4) | Kernel32Console.DefaultColors.Foreground.WHITE));
rasterizer.DrawMeshFilled(transformation, meshes);//, Kernel32Console.DefaultColors.FOREGROUND_CYAN, Rasterizer.ShadePixelChar1);
//rasterizer.DrawMeshVertices(transformation, meshes, Kernel32Console.DefaultColors.FOREGROUND_CYAN, (byte)'X');
//rasterizer.DrawMeshWired(transformation, meshes, Kernel32Console.DefaultColors.Foreground.CYAN);
//rasterizer.DrawMeshCenters(transformation, meshes, Kernel32Console.DefaultColors.Foreground.RED);
//rasterizer.DrawMeshBoundingBox(transformation, meshes, Kernel32Console.DefaultColors.FOREGROUND_MAGENTA);
//rasterizer.DrawAxes(Transformation.None, Kernel32Console.DefaultColors.Foreground.YELLOW);
rasterizer.DrawStringHorizontal(Transformation.None, new Vector2(-Width / 2 + 1, Height / 2 - 2), string.Format("MODEL: '{0}'", currentWavefrontObjectFilePath));
rasterizer.DrawStringHorizontal(Transformation.None, new Vector2(-Width / 2 + 1, Height / 2 - 3), string.Format("# POLYGONS: {0}", meshes.Sum(mesh => mesh.Faces.Count())));
rasterizer.DrawStringHorizontal(Transformation.None, new Vector2(-Width / 2 + 1, 10), string.Format("TRANSLATION: {0}", transformation.Translation));
rasterizer.DrawStringHorizontal(Transformation.None, new Vector2(-Width / 2 + 1, 9), string.Format("SCALE: {0}", transformation.Scale));
rasterizer.DrawStringHorizontal(Transformation.None, new Vector2(-Width / 2 + 1, 8), string.Format("ROTATION: {0}", transformation.Rotation));
rasterizer.DrawStringHorizontal(Transformation.None, new Vector2(-Width / 2 + 1, 6), string.Format("MODEL CENTER: {0}", transformation.Transform(meshes.First().Centers.Value)));
var rasterizedFrameBuffer = rasterizer.Rasterize();
renderer.Render(rasterizedFrameBuffer);
}
示例14: Render
protected virtual void Render(IRenderer renderer)
{
renderer.Render(this);
}
示例15: Draw
public void Draw(IRenderer render, IDrawingContext context)
{
render.Render(context, this);
}