Hello everyone, I really want know how do you have to get luck making fullscreen and unfullscreen?
I am really unhappy because I tried to resolve if I use parameter -windowed it looks like center window with width and height -> No problem but I have problem with center of Window and fullscreen mode can not resize if I see mouse cursor is bigger if resolution was resized like fullscreen mode of games.
I am sorry because I have always problem with stupid fullscreen mode with current rectangle of I switch to fullscreen than my monitor is 27 zoll big. and I want test if rectangle resized and makes sketch into monitor's resolution ( native )
PS: I am very happy because I have already compiled mono runtime for x86 and I have to pack mono game into mono bundled application.
.Here is my example code:
class MonoHL : GameWindow
// false means fullscreen mode
private bool isWindowed = false;
private bool isFullscreen = false;
private static Rectangle win = new Rectangle();
public MonoHL() : base(640, 480, GraphicsMode.Default, "Mono Half-Life")
isFullscreen = true;
public int ParseWithArgument(string args)
int argIndex = args.Length;
for (int i = 0; i < argIndex; i++)
isWindowed = true;
isFullscreen = false;
win.Width = int.Parse(args[++i]);
Width = win.Width;
win.Height = int.Parse(args[++i]);
Height = win.Height;
protected override void OnResize(EventArgs e)
int screenX = (DisplayDevice.GetDisplay(DisplayIndex.Default).Width - ClientSize.Width) / 2;
int screenY = (DisplayDevice.GetDisplay(DisplayIndex.Default).Height - ClientSize.Height) / 2;
GL.Viewport(screenX, screenY, ClientSize.Width, ClientSize.Height);
GL.Ortho(-1.0, 1.0, -1.0, 1.0, 0.0, 4.0);
if (ClientSize.Width == Width && ClientSize.Height == Height)
DisplayDevice.GetDisplay(DisplayIndex.Default).ChangeResolution(ClientSize.Width, ClientSize.Height, 0, 75);
protected override void OnLoad(EventArgs e)
CursorVisible = true;
protected override void OnUpdateFrame(FrameEventArgs e)
WindowState = WindowState.Normal;
WindowBorder = WindowBorder.Fixed;
WindowState = WindowState.Fullscreen;
protected override void OnRenderFrame(FrameEventArgs e)
backColor.A = 1.0f;
backColor.R = 0.1f;
backColor.G = 0.1f;
backColor.B = 0.3f;
GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
static int Main(string args)
MonoHL HL_Main = new MonoHL();
Sorry for my arguing and my bad English.
I appreciate your great help. I saw Github because they use OpenTK, right?
That is why I want know about how do I resizing rectangle into fullscreen mode of monitor's resolution.