Komodo Engine
C PROJECT_LOGO=
Komodo.Core.Engine.Graphics.GraphicsManager Class Reference

Manages all the underlying graphics resources and devices. More...

Public Member Functions

 GraphicsManager (Game game)
 
Parameters
gameReference to current Komodo.Core.Game instance.

 
void ApplyChanges ()
 Applies pending changes to the Microsoft.Xna.Framework.GraphicsDeviceManager. More...
 
void Clear (Color clearColor)
 Clears the screen with a given Microsoft.Xna.Framework.Color. More...
 
Texture CreateTexture (Color[] data, int width, int height)
 Creates a new Komodo.Core.Engine.Graphics.Texture from raw Microsoft.Xna.Framework.Color data and dimensions. More...
 
Texture CreateTexture (Color[,] data)
 Creates a new Komodo.Core.Engine.Graphics.Texture from raw Microsoft.Xna.Framework.Color data. More...
 
void Initialize ()
 Called after all framework resources have been initialized and allocated. More...
 
void SetFullscreen (bool isFullscreen, bool shouldApplyChanges=true)
 Sets the game window to render either in fullscreen or windowed mode. More...
 
void SetResolution (Resolution resolution, bool shouldApplyChanges=true)
 Sets the game window resolution. More...
 
void ToggleFullscreen (bool shouldApplyChanges=true)
 Toggles whether or not the game window renders in fullscreen or windowed mode More...
 

Public Attributes

Viewport ViewPort => GraphicsDeviceManager.GraphicsDevice.Viewport
 Current Microsoft.Xna.Framework.Graphics.Viewport for the Microsoft.Xna.Framework.Graphics.GraphicsDevice. More...
 

Properties

Game Game [get]
 Reference to current Komodo.Core.Game instance. More...
 
bool? IsMouseVisible [get, set]
 Whether or not to show the mouse in the game window. More...
 
List< Resolution >??? Resolutions [get]
 Supported resolutions for the current graphics device. More...
 
GraphicsDeviceManager GraphicsDeviceManager [get]
 Underlying Microsoft.Xna.Framework.GraphicsDeviceManager, providing access to the underlying Microsoft.Xna.Framework.Graphics.GraphicsDevice. More...
 
SpriteBatch SpriteBatch [get, set]
 Current Microsoft.Xna.Framework.Graphics.SpriteBatch for the underlying Microsoft.Xna.Framework.Graphics.GraphicsDevice. More...
 
bool VSync [get, set]
 Whether or not to render using vertical sync. More...
 

Detailed Description

Manages all the underlying graphics resources and devices.

Member Function Documentation

◆ ApplyChanges()

void Komodo.Core.Engine.Graphics.GraphicsManager.ApplyChanges ( )

Applies pending changes to the Microsoft.Xna.Framework.GraphicsDeviceManager.

◆ Clear()

void Komodo.Core.Engine.Graphics.GraphicsManager.Clear ( Color  clearColor)

Clears the screen with a given Microsoft.Xna.Framework.Color.

Parameters
clearColorMicrosoft.Xna.Framework.Color to clear the Microsoft.Xna.Framework.Graphics.GraphicsDevice with.

◆ CreateTexture() [1/2]

Texture Komodo.Core.Engine.Graphics.GraphicsManager.CreateTexture ( Color  data[,])

Creates a new Komodo.Core.Engine.Graphics.Texture from raw Microsoft.Xna.Framework.Color data.

Parameters
data2D array of Microsoft.Xna.Framework.Color.
Returns
Newly generated Texture.

◆ CreateTexture() [2/2]

Texture Komodo.Core.Engine.Graphics.GraphicsManager.CreateTexture ( Color[]  data,
int  width,
int  height 
)

Creates a new Komodo.Core.Engine.Graphics.Texture from raw Microsoft.Xna.Framework.Color data and dimensions.

Parameters
data1D array of Microsoft.Xna.Framework.Color.
widthWidth of the Komodo.Core.Engine.Graphics.Texture to generate.
heightHeight of the Komodo.Core.Engine.Graphics.Texture to generate.
Returns
Newly generated Texture. Will return null if dimensions do not match dimensions of Microsoft.Xna.Framework.Color data.

◆ Initialize()

void Komodo.Core.Engine.Graphics.GraphicsManager.Initialize ( )

Called after all framework resources have been initialized and allocated.

Before Initialize is called, MonoGame will not have set up the Microsoft.Xna.Framework.Graphics.GraphicsDevice yet, preventing Komodo.Core.Engine.Graphics.Texture or Komodo.Core.Engine.Graphics.Model from being generated.

◆ SetFullscreen()

void Komodo.Core.Engine.Graphics.GraphicsManager.SetFullscreen ( bool  isFullscreen,
bool  shouldApplyChanges = true 
)

Sets the game window to render either in fullscreen or windowed mode.

Parameters
isFullscreenWhether or not to render in fullscreen.
shouldApplyChangesWhether or not to apply the graphics changes immediately.

◆ SetResolution()

void Komodo.Core.Engine.Graphics.GraphicsManager.SetResolution ( Resolution  resolution,
bool  shouldApplyChanges = true 
)

Sets the game window resolution.

Parameters
resolutionNew resolution to display.
shouldApplyChangesWhether or not to apply the graphics changes immediately.

◆ ToggleFullscreen()

void Komodo.Core.Engine.Graphics.GraphicsManager.ToggleFullscreen ( bool  shouldApplyChanges = true)

Toggles whether or not the game window renders in fullscreen or windowed mode

Parameters
shouldApplyChangesWhether or not to apply the graphics changes immediately.

Member Data Documentation

◆ ViewPort

Viewport Komodo.Core.Engine.Graphics.GraphicsManager.ViewPort => GraphicsDeviceManager.GraphicsDevice.Viewport

Current Microsoft.Xna.Framework.Graphics.Viewport for the Microsoft.Xna.Framework.Graphics.GraphicsDevice.

Property Documentation

◆ Game

Game Komodo.Core.Engine.Graphics.GraphicsManager.Game
get

Reference to current Komodo.Core.Game instance.

◆ GraphicsDeviceManager

GraphicsDeviceManager Komodo.Core.Engine.Graphics.GraphicsManager.GraphicsDeviceManager
get

Underlying Microsoft.Xna.Framework.GraphicsDeviceManager, providing access to the underlying Microsoft.Xna.Framework.Graphics.GraphicsDevice.

◆ IsMouseVisible

bool? Komodo.Core.Engine.Graphics.GraphicsManager.IsMouseVisible
getset

Whether or not to show the mouse in the game window.

◆ Resolutions

List<Resolution>??? Komodo.Core.Engine.Graphics.GraphicsManager.Resolutions
get

Supported resolutions for the current graphics device.

◆ SpriteBatch

SpriteBatch Komodo.Core.Engine.Graphics.GraphicsManager.SpriteBatch
getset

Current Microsoft.Xna.Framework.Graphics.SpriteBatch for the underlying Microsoft.Xna.Framework.Graphics.GraphicsDevice.

◆ VSync

bool Komodo.Core.Engine.Graphics.GraphicsManager.VSync
getset

Whether or not to render using vertical sync.