public override RenderWindow CreateRenderWindow( string name, int width, int height, bool isFullscreen, Collections.NamedParameterList miscParams )
{
if ( renderTargets.ContainsKey( name ) )
{
throw new Exception( String.Format( "Window with the name '{0}' already exists.", name ) );
}
// Log a message
StringBuilder msg = new StringBuilder();
msg.AppendFormat( "GLESRenderSystem.CreateRenderWindow \"{0}\", {1}x{2} {3} ", name, width, height, isFullscreen ? "fullscreen" : "windowed" );
if ( miscParams != null )
{
msg.Append( "miscParams: " );
foreach ( KeyValuePair<string, object> param in miscParams )
{
msg.AppendFormat( " {0} = {1} ", param.Key, param.Value.ToString() );
}
LogManager.Instance.Write( msg.ToString() );
}
msg = null;
// create the window
RenderWindow window = _glSupport.NewWindow( name, width, height, isFullscreen, miscParams );
// add the new render target
AttachRenderTarget( window );
if ( !this._glInitialized )
{
InitializeContext( window );
// set the number of texture units
_fixedFunctionTextureUnits = this._rsCapabilities.TextureUnitCount;
// in GL there can be less fixed function texture units than general
// texture units. use the smaller of the two.
if ( HardwareCapabilities.HasCapability( Capabilities.FragmentPrograms ) )
{
int maxTexUnits = 0;
//Gl.glGetIntegerv( Gl.GL_MAX_TEXTURE_UNITS, out maxTexUnits );
if ( _fixedFunctionTextureUnits > maxTexUnits )
{
_fixedFunctionTextureUnits = maxTexUnits;
}
}
// Initialise the main context
_oneTimeContextInitialization();
if ( _currentContext != null )
_currentContext.IsInitialized = true;
}
return window;
}