Class RenderCanvasImp
This is a default render canvas implementation creating its own rendering window.
Inheritance
Implements
Inherited Members
Namespace: Fusee.Engine.Imp.Graphics.Blazor
Assembly: Fusee.Engine.Imp.Graphics.Blazor.dll
Syntax
public class RenderCanvasImp : IRenderCanvasImp
Constructors
RenderCanvasImp(IJSObjectReference, IJSRuntime, WebGL2RenderingContextBase, Int32, Int32)
Initializes a new instance of the RenderCanvasImp class.
Declaration
public RenderCanvasImp(IJSObjectReference canvas, IJSRuntime runtime, WebGL2RenderingContextBase gl, int width, int height)
Parameters
Type | Name | Description |
---|---|---|
IJSObjectReference | canvas | |
IJSRuntime | runtime | |
WebGL2RenderingContextBase | gl | |
System.Int32 | width | |
System.Int32 | height |
Properties
Caption
Gets and sets the caption (title of the rendering window).
Declaration
public string Caption { get; set; }
Property Value
Type | Description |
---|---|
System.String |
DeltaTime
Gets and sets the delta time. The delta time is the time that was required to render the last frame in milliseconds. This value can be used to determine the frames per second of the application.
Declaration
public float DeltaTime { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
DeltaTimeUpdate
Delta time increment, needed for update independent rendering
Declaration
public float DeltaTimeUpdate { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
Fullscreen
Gets and sets a value indicating whether fullscreen is enabled.
Declaration
public bool Fullscreen { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
Currently not implemented.
Exceptions
Type | Condition |
---|---|
System.NotImplementedException |
Height
Gets the height of the rendering window.
Declaration
public int Height { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
VerticalSync
Gets and sets a value indicating whether vertical synchronization is used.
Declaration
public bool VerticalSync { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
Currently not implemented.
Width
Gets he width of the rendering window.
Declaration
public int Width { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
WindowHandle
Window handle to native underlying window, not suitable for Blazor
Declaration
public IWindowHandle WindowHandle { get; }
Property Value
Type | Description |
---|---|
IWindowHandle |
Methods
CloseGameWindow()
Closes the game window.
Declaration
public void CloseGameWindow()
Remarks
Not needed in WebGL.
DoInit()
Does initialize this instance.
Declaration
public void DoInit()
DoRender()
Does the render of this instance.
Declaration
public void DoRender()
DoResize(Int32, Int32)
Does the resize on this instance.
Declaration
public void DoResize(int w, int h)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | w | The width. |
System.Int32 | h | The height. |
DoUnLoad()
Does the unload of this instance.
Declaration
public void DoUnLoad()
DoUpdate()
Does perform the update of this instance
Declaration
public void DoUpdate()
OpenLink(String)
Opens the given URL in the user's standard browser. The link MUST start with "http://".
Declaration
public void OpenLink(string link)
Parameters
Type | Name | Description |
---|---|---|
System.String | link | The URL to open. |
Remarks
Not needed in WebGL.
Present()
Not needed due to WebGL.
Declaration
public void Present()
Run()
Runs this application instance.
Declaration
public void Run()
SetCursor(CursorType)
Set the cursor to one of the predefined types.
Declaration
public void SetCursor(CursorType cursorType)
Parameters
Type | Name | Description |
---|---|---|
CursorType | cursorType | THe type of cursor to set. |
Remarks
Not needed in WebGL.
SetWindowSize(Int32, Int32, Int32, Int32, Boolean)
Sets the size of the output window for desktop development.
Declaration
public void SetWindowSize(int width, int height, int posx = -1, int posy = -1, bool borderHidden = false)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | width | The width of the window. |
System.Int32 | height | The height of the window. |
System.Int32 | posx | The x position of the window. |
System.Int32 | posy | The y position of the window. |
System.Boolean | borderHidden | Show the window border or not. |
Remarks
Currently not implemented.
Events
Init
Occurs during initialization.
Declaration
public event EventHandler<InitEventArgs> Init
Event Type
Type | Description |
---|---|
System.EventHandler<InitEventArgs> |
Render
Occurs when rendering.
Declaration
public event EventHandler<RenderEventArgs> Render
Event Type
Type | Description |
---|---|
System.EventHandler<RenderEventArgs> |
Resize
Occurs when resizing.
Declaration
public event EventHandler<ResizeEventArgs> Resize
Event Type
Type | Description |
---|---|
System.EventHandler<ResizeEventArgs> |
UnLoad
Occurs when unloading.
Declaration
public event EventHandler<InitEventArgs> UnLoad
Event Type
Type | Description |
---|---|
System.EventHandler<InitEventArgs> |
Update
Occurs when updating.
Declaration
public event EventHandler<RenderEventArgs> Update
Event Type
Type | Description |
---|---|
System.EventHandler<RenderEventArgs> |