本文整理汇总了C#中GameWindowFlags.HasFlag方法的典型用法代码示例。如果您正苦于以下问题:C# GameWindowFlags.HasFlag方法的具体用法?C# GameWindowFlags.HasFlag怎么用?C# GameWindowFlags.HasFlag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GameWindowFlags
的用法示例。
在下文中一共展示了GameWindowFlags.HasFlag方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SDL2GLNative
public SDL2GLNative(int x, int y, int width, int height, string title,
GraphicsMode mode,GameWindowFlags options, DisplayDevice device)
: this()
{
if (width <= 0)
throw new ArgumentOutOfRangeException("width", "Must be higher than zero.");
if (height <= 0)
throw new ArgumentOutOfRangeException("height", "Must be higher than zero.");
Debug.Indent();
IntPtr windowId;
desiredSizeX = width;
desiredSizeY = height;
isFullscreen = options.HasFlag(GameWindowFlags.Fullscreen);
if (isFullscreen)
{
FixupFullscreenRes(width,height,out width, out height);
}
lock (API.sdl_api_lock) {
API.Init (API.INIT_VIDEO);
API.VideoInit("",0);
// NOTE: Seriously, letting the user set x and y coords is a _bad_ idea. We'll let the WM take care of it.
windowId = API.CreateWindow(title, 0x1FFF0000, 0x1FFF0000, width, height, API.WindowFlags.OpenGL | ((isFullscreen)?API.WindowFlags.Fullscreen:0));
}
window = new SDL2WindowInfo(windowId);
inputDriver = new SDL2Input(window);
Debug.Unindent();
}