Files
stgsharp/源代码/StgSharp/Graphics/GLFunc.cs
T

59 lines
1.9 KiB
C#

using StgSharp.Control;
using System;
using System.Collections.Generic;
using System.Text;
namespace StgSharp
{
public static unsafe partial class Graphic
{
/// <summary>
/// Creates a window and its associated context.
/// </summary>
/// <param name="width">Required width</param>
/// <param name="height">Required width</param>
/// <param name="tittle">Tittle of the window </param>
/// <param name="monitor"></param>
/// <param name="share"></param>
/// <returns>The handle of created window</returns>
/// <exception cref="Exception"></exception>
public static unsafe IntPtr GLcreateWindow(int width, int height, char[] tittle, IntPtr monitor, IntPtr share)
{
IntPtr windowPtr = glIO.InternalGLcreateWindow(width, height, tittle, monitor, share);
if ((int)windowPtr == -1 || (int)windowPtr == -2)
{
throw new Exception("Cannot create window instance!");
}
return windowPtr;
}
/// <summary>
/// Creates a window and its associated context.
/// </summary>
/// <param name="width">Required width</param>
/// <param name="height">Required width</param>
/// <param name="tittle">Tittle of the window </param>
/// <param name="monitor"></param>
/// <param name="share"></param>
/// <returns>The handle of created window</returns>
/// <exception cref="Exception"></exception>
public static unsafe IntPtr GLcreateWindow(int width, int height, string tittle, IntPtr monitor, IntPtr share)
{
IntPtr windowPtr = glIO.InternalGLcreateWindow(width, height, null, monitor, share);
if ((int)windowPtr == -1 || (int)windowPtr == -2)
{
throw new Exception("Cannot create window instance!");
}
return windowPtr;
}
}
}