partial void PlatformInitialize(PresentationParameters presentationParameters) { var surfaceFormat = PreferredBackBufferFormat.GetColorFormat(); var depthStencilFormat = PreferredDepthStencilFormat; // TODO: Need to get this data from the Presentation Parameters SDL.GL.SetAttribute(SDL.GL.Attribute.RedSize, surfaceFormat.R); SDL.GL.SetAttribute(SDL.GL.Attribute.GreenSize, surfaceFormat.G); SDL.GL.SetAttribute(SDL.GL.Attribute.BlueSize, surfaceFormat.B); SDL.GL.SetAttribute(SDL.GL.Attribute.AlphaSize, surfaceFormat.A); switch (depthStencilFormat) { case DepthFormat.None: SDL.GL.SetAttribute(SDL.GL.Attribute.DepthSize, 0); SDL.GL.SetAttribute(SDL.GL.Attribute.StencilSize, 0); break; case DepthFormat.Depth16: SDL.GL.SetAttribute(SDL.GL.Attribute.DepthSize, 16); SDL.GL.SetAttribute(SDL.GL.Attribute.StencilSize, 0); break; case DepthFormat.Depth24: SDL.GL.SetAttribute(SDL.GL.Attribute.DepthSize, 24); SDL.GL.SetAttribute(SDL.GL.Attribute.StencilSize, 0); break; case DepthFormat.Depth24Stencil8: SDL.GL.SetAttribute(SDL.GL.Attribute.DepthSize, 24); SDL.GL.SetAttribute(SDL.GL.Attribute.StencilSize, 8); break; } SDL.GL.SetAttribute(SDL.GL.Attribute.DoubleBuffer, 1); SDL.GL.SetAttribute(SDL.GL.Attribute.ContextMajorVersion, 2); SDL.GL.SetAttribute(SDL.GL.Attribute.ContextMinorVersion, 1); ((SDLGameWindow)_game.Window).CreateWindow(); }
public void PlatformInitialize(PresentationParameters presentationParameters) { var surfaceFormat = PreferredBackBufferFormat.GetColorFormat(); var depthStencilFormat = PreferredDepthStencilFormat; Sdl.GL.SetAttribute(Sdl.GL.Attribute.RedSize, surfaceFormat.R); Sdl.GL.SetAttribute(Sdl.GL.Attribute.GreenSize, surfaceFormat.G); Sdl.GL.SetAttribute(Sdl.GL.Attribute.BlueSize, surfaceFormat.B); Sdl.GL.SetAttribute(Sdl.GL.Attribute.AlphaSize, surfaceFormat.A); switch (depthStencilFormat) { case DepthFormat.None: Sdl.GL.SetAttribute(Sdl.GL.Attribute.DepthSize, 0); Sdl.GL.SetAttribute(Sdl.GL.Attribute.StencilSize, 0); break; case DepthFormat.Depth16: Sdl.GL.SetAttribute(Sdl.GL.Attribute.DepthSize, 16); Sdl.GL.SetAttribute(Sdl.GL.Attribute.StencilSize, 0); break; case DepthFormat.Depth24: Sdl.GL.SetAttribute(Sdl.GL.Attribute.DepthSize, 24); Sdl.GL.SetAttribute(Sdl.GL.Attribute.StencilSize, 0); break; case DepthFormat.Depth24Stencil8: Sdl.GL.SetAttribute(Sdl.GL.Attribute.DepthSize, 24); Sdl.GL.SetAttribute(Sdl.GL.Attribute.StencilSize, 8); break; } Sdl.GL.SetAttribute(Sdl.GL.Attribute.DoubleBuffer, 1); Sdl.GL.SetAttribute(Sdl.GL.Attribute.ContextMajorVersion, 2); Sdl.GL.SetAttribute(Sdl.GL.Attribute.ContextMinorVersion, 1); ((SdlGameWindow)SdlGameWindow.Instance).CreateWindow(); }