Files
stgsharp/源代码/StgSharp/Graphics/View/ViewPort.cs
T

47 lines
1.2 KiB
C#

using StgSharp.Math;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.Threading;
namespace StgSharp.Graphics
{
public class ViewPort
{
public int Width { get; set; }
public int Height { get; set; }
public string Name { get; set; }
public IntPtr Monitor { get; internal set; }
public IntPtr ViewPortID { get; private set; }
public IntPtr GraphicHandle { get; internal set; }
internal ViewPort()
{
Height = 800;
Width = 600;
Name = new StackFrame(1, false).
GetMethod()!.DeclaringType!.Name;
Monitor = IntPtr.Zero;
ViewPortID = InternalIO.glfwCreateWindow(Width,Height,
Encoding.UTF8.GetBytes(Name), Monitor, IntPtr.Zero
);
}
public ViewPort(vec2d size,string name, IntPtr monitor)
{
Height = (int) size.Y;
Width = (int) size.X;
Name = name;
Monitor = monitor;
ViewPortID = InternalIO.glfwCreateWindow(Width, Height,
Encoding.UTF8.GetBytes(Name), Monitor, IntPtr.Zero
);
}
}
}