本文整理汇总了C#中IRenderer类的典型用法代码示例。如果您正苦于以下问题:C# IRenderer类的具体用法?C# IRenderer怎么用?C# IRenderer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IRenderer类属于命名空间,在下文中一共展示了IRenderer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ViewContext
/// <summary>
/// Initialize a new instance of the ViewContext class.
/// </summary>
/// <param name="control">Control associated with rendering.</param>
/// <param name="alignControl">Control used for aligning elements.</param>
/// <param name="graphics">Graphics instance for drawing.</param>
/// <param name="renderer">Rendering provider.</param>
public ViewContext(Control control,
Control alignControl,
Graphics graphics,
IRenderer renderer)
: this(null, control, alignControl, graphics, renderer)
{
}
示例2: HandleCollision
private void HandleCollision(IHungryCreature creature, IRenderer renderer)
{
List<GameFieldCoords> creatureElements = new List<GameFieldCoords>();
foreach (GameFieldCoords element in creature.GetPosition())
{
creatureElements.Add(element);
}
foreach (GameFieldCoords element in creatureElements)
{
if (element.Row >= renderer.GameFieldSize.Row || element.Row < 0
|| element.Col >= renderer.GameFieldSize.Col || element.Col < 0)
{
creature.IsDestroyed = true;
}
}
for (int element = 0; element < creatureElements.Count - 1; element++)
{
if (creatureElements.Last().Row == creatureElements[element].Row
&& creatureElements.Last().Col == creatureElements[element].Col)
{
creature.IsDestroyed = true;
}
}
}
示例3: RegisterFactory
public void RegisterFactory(string[] blocks, IRenderer renderer)
{
foreach (var block in blocks)
{
RegisterFactory(block, renderer);
}
}
示例4: GameController
public GameController(IGameEngine gameEngine, IInputHandler inputReader, IRenderer renderer)
{
this.gameEngine = gameEngine;
this.inputReader = inputReader;
this.renderer = renderer;
this.currentCmd = null;
}
示例5: Engine
public Engine(IRenderer renderer, int screenWidth, int screenHeight)
{
this.Renderer = renderer;
this.ScreenWidth = screenWidth;
this.ScreenHeight = screenHeight;
this.Initialize();
}
示例6: Configure
public void Configure(IRenderer renderer)
{
foreach (var resource in _resources)
{
resource.Configure(renderer);
}
}
示例7: render
public int FrameCountPerRender { get; set; } //number of frames per render (default = 1);
public DrawingSurfaceSCBP(IRenderer renderer)
{
this.FrameCountPerRender = 1;
//this.InitializeComponent();
//if (!hasInitializedSurface)
//{
// //effectRenderer = new EffectRenderer();
// var fpsRenderer = new FpsRenderer();
// d2dTarget = new SwapChainBackgroundPanelTarget(root);
// d2dTarget.OnRender += effectRenderer.Render;
// d2dTarget.OnRender += fpsRenderer.Render;
// deviceManager = new DeviceManager();
// deviceManager.OnInitialize += d2dTarget.Initialize;
// deviceManager.OnInitialize += effectRenderer.Initialize;
// deviceManager.OnInitialize += fpsRenderer.Initialize;
// deviceManager.Initialize(DisplayProperties.LogicalDpi);
// effectRenderer.InitializeUI(root, root);
// // Setup rendering callback
// CompositionTarget.Rendering += CompositionTarget_Rendering;
// if (_assetUri != string.Empty) effectRenderer.LoadLocalAsset(_assetUri);
//}
}
示例8: Configure
public virtual void Configure(IRenderer renderer)
{
foreach (var textureParameter in _textureParameters)
{
_shader.SetTextureParameter(textureParameter.Key, textureParameter.Value);
}
}
示例9: FeatureElement
public FeatureElement(Feature f, IRenderer renderer)
{
this.ClipBox = Rectangle2D.Empty;
this.pathIsInvalid = true;
if (f == null)
{
throw new ArgumentNullException("f");
}
this.feature = new WeakReference(f);
if (renderer != null && (f.GetValue(Clusterer.ClusterProperty) == null))
{
this.GeoStyle = renderer.GetStyle(f) ?? generateDefaultSyle(f);
}//renderer的优先级高于Feature自我的
else
{
this.GeoStyle = f.Style ?? generateDefaultSyle(f);
}
f.SetBoundedStyle(this.GeoStyle);
if (this.GeoStyle != null)
{
base.Template = this.GeoStyle.ControlTemplate;
}
this.Geometry = f.Geometry;
}
示例10: VisualPopupGroup
/// <summary>
/// Initialize a new instance of the VisualPopupGroup class.
/// </summary>
/// <param name="ribbon">Reference to owning ribbon control.</param>
/// <param name="ribbonGroup">Reference to ribbon group for display.</param>
/// <param name="renderer">Drawing renderer.</param>
public VisualPopupGroup(KryptonRibbon ribbon,
KryptonRibbonGroup ribbonGroup,
IRenderer renderer)
: base(renderer, true)
{
Debug.Assert(ribbon != null);
Debug.Assert(ribbonGroup != null);
// Remember references needed later
_ribbon = ribbon;
_ribbonGroup = ribbonGroup;
// Create a view element for drawing the group
_viewGroup = new ViewDrawRibbonGroup(ribbon, ribbonGroup, NeedPaintDelegate);
_viewGroup.Collapsed = false;
// Create the background that will contain the actual group instance
_viewBackground = new ViewDrawRibbonGroupsBorder(ribbon, true, NeedPaintDelegate);
_viewBackground.Add(_viewGroup);
// Attach the root to the view manager instance
ViewManager = new ViewRibbonPopupGroupManager(this, ribbon, _viewBackground, _viewGroup, NeedPaintDelegate);
// Create and add a hidden button to act as the focus target
_hiddenFocusTarget = new Button();
_hiddenFocusTarget.TabStop = false;
_hiddenFocusTarget.Location = new Point(-_hiddenFocusTarget.Width, -_hiddenFocusTarget.Height);
CommonHelper.AddControlToParent(this, _hiddenFocusTarget);
}
示例11: CompositeWindow
public CompositeWindow(IController controller, IRenderer renderer, double frameRate)
{
if (controller == null) throw new ArgumentNullException("controller");
if (renderer == null) throw new ArgumentNullException("renderer");
_controller = controller;
_renderer = renderer;
_frameRate = frameRate;
Width = controller.Width;
Height = controller.Height;
if (_controller.IsFullScreen)
WindowState = WindowState.Maximized;
Title = controller.Name;
InitializeComponent();
if (_controller.HasUserInterface)
{
if(_controller.CentralView != null)
MainGrid.Children.Add((UIElement)_controller.CentralView);
if (_controller.LeftView != null)
LeftGrid.Children.Add((UIElement)_controller.LeftView);
if (_controller.RightView != null)
RightGrid.Children.Add((UIElement)_controller.RightView);
if (_controller.TopView != null)
TopGrid.Children.Add((UIElement)_controller.TopView);
if (_controller.BottomView != null)
BottomGrid.Children.Add((UIElement)_controller.BottomView);
}
Loaded += OnLoaded;
SizeChanged += OnSizeChanged;
}
示例12: GameEngine
/// <summary>
/// Initializes a new instance of the <see cref="GameEngine" /> class.
/// </summary>
/// <param name="renderer">The game renderer.</param>
/// <param name="inputMethod">The user input method.</param>
public GameEngine(IRenderer renderer, IInputMethod inputMethod)
{
this.gameRenderer = renderer;
this.inputMethod = inputMethod;
this.scores = new HighScores(MaxTopPlayers);
this.cmdExecutor = new DefaultGameCommandExecutor(this.gameRenderer, this.inputMethod, this.scores);
}
示例13: Engine
/// <summary>
/// Constructor
/// </summary>
/// <param name="player">Player instance</param>
/// <param name="renderer">IRender instance</param>
/// <param name="controller">IControler instance</param>
/// <param name="scoreBoard">Scoreboard instance</param>
public Engine(Player player, IRenderer renderer, IController controller, ScoreBoard scoreBoard)
{
this.Player = player;
this.Renderer = renderer;
this.Controller = controller;
this.ScoreBoard = scoreBoard;
}
示例14: Tube
public Tube( IRenderer renderer )
{
ReferenceVertices = new GLVector3d[ 4 ];
ReferenceVertices[0] = new GLVector3d( 0.5, -0.5, 0 );
ReferenceVertices[1] = new GLVector3d( 0.5, 0.5, 0 );
ReferenceVertices[2] = new GLVector3d( -0.5, 0.5, 0 );
ReferenceVertices[3] = new GLVector3d( -0.5, -0.5, 0 );
iFirstOuterFace = 0;
iLastOuterFace = 3;
iNumberFaces = 4;
bShowCut = false;
bShowHollow = false;
iCutStart = 0;
iCutEnd = MaxCut;
this.renderer = renderer;
SendRendererCallbacksToCrossSections();
rotationalextrusionpath.UpdatePath();
BuildFaces();
}
示例15: MatchRunner
public MatchRunner(IMatch match, string playerOneFolder, string playerTwoFolder, IRenderer renderer, bool consoleLoggingDisabled, bool consoleLoggingMustScroll, string replayFolder)
{
Match = match;
Renderer = renderer;
string runFilename = Environment.OSVersion.Platform == PlatformID.Unix ? Settings.Default.BotRunFilenameLinux : Settings.Default.BotRunFilename;
_players = new BotRunner[2];
_players[0] = new BotRunner(
1,
playerOneFolder,
runFilename
);
_players[1] = new BotRunner(
2,
playerTwoFolder,
runFilename
);
match.SetPlayerName(1, _players[0].PlayerName);
match.SetPlayerName(2, _players[1].PlayerName);
_replayLogger = new ReplayLogger(replayFolder);
SetupLogging(consoleLoggingDisabled, consoleLoggingMustScroll);
}