44 lines
1.1 KiB
C#
44 lines
1.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Runtime.CompilerServices;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace StgSharp
|
|
{
|
|
public static unsafe partial class StgSharp
|
|
{
|
|
/// <summary>
|
|
/// Init an instance of OpenGL program,
|
|
/// This method should be called before any other StgSharp api.
|
|
/// </summary>
|
|
public static void InitGL(int majorVersion, int minorVersion)
|
|
{
|
|
if (API == default)
|
|
{
|
|
API = GraphicAPI.GL;
|
|
}
|
|
if (API != GraphicAPI.GL)
|
|
{
|
|
return;
|
|
}
|
|
InternalIO.InternalInitGL(majorVersion, minorVersion);
|
|
}
|
|
|
|
public static class GlobalSetting
|
|
{
|
|
private static bool vSyncActivated;
|
|
|
|
public static bool VSyncActivated
|
|
{
|
|
get { return vsyncActivated; }
|
|
set
|
|
{
|
|
InternalIO.glfwSwapInterval(value ? 1 : 0);
|
|
vsyncActivated = value;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |