mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-07-08 07:10:34 +00:00
Manually check for OpenGL version. Removed TextPrinter references.
This commit is contained in:
parent
33e90d1b97
commit
af7175ea0a
|
@ -54,10 +54,6 @@ namespace Examples.Tutorial
|
||||||
float UniformOffsetX = 1.8f; // fractal horizontal offset
|
float UniformOffsetX = 1.8f; // fractal horizontal offset
|
||||||
float UniformOffsetY = 1.8f; // fractal vertical offset
|
float UniformOffsetY = 1.8f; // fractal vertical offset
|
||||||
|
|
||||||
// Text drawing (for fps)
|
|
||||||
TextPrinter printer = new TextPrinter();
|
|
||||||
Font font = new Font(FontFamily.GenericSansSerif, 16.0f);
|
|
||||||
|
|
||||||
#endregion private Fields
|
#endregion private Fields
|
||||||
|
|
||||||
#region OnLoad
|
#region OnLoad
|
||||||
|
@ -69,7 +65,10 @@ namespace Examples.Tutorial
|
||||||
public override void OnLoad(EventArgs e)
|
public override void OnLoad(EventArgs e)
|
||||||
{
|
{
|
||||||
// Check for necessary capabilities:
|
// Check for necessary capabilities:
|
||||||
if (!GL.SupportsExtension("VERSION_2_0"))
|
string version = GL.GetString(StringName.Version);
|
||||||
|
int major = (int)version[0];
|
||||||
|
int minor = (int)version[2];
|
||||||
|
if (major < 2)
|
||||||
{
|
{
|
||||||
MessageBox.Show("You need at least OpenGL 2.0 to run this example. Aborting.",
|
MessageBox.Show("You need at least OpenGL 2.0 to run this example. Aborting.",
|
||||||
"GLSL not supported", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
"GLSL not supported", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||||
|
@ -290,12 +289,6 @@ namespace Examples.Tutorial
|
||||||
}
|
}
|
||||||
GL.End();
|
GL.End();
|
||||||
|
|
||||||
// Then, render the fps:
|
|
||||||
GL.UseProgram(0);
|
|
||||||
printer.Begin();
|
|
||||||
printer.Print((1 / e.Time).ToString("F2"), font, Color.PaleGoldenrod, RectangleF.Empty, TextPrinterOptions.NoCache);
|
|
||||||
printer.End();
|
|
||||||
|
|
||||||
SwapBuffers();
|
SwapBuffers();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,10 @@ namespace Examples.Tutorial
|
||||||
public override void OnLoad(EventArgs e)
|
public override void OnLoad(EventArgs e)
|
||||||
{
|
{
|
||||||
// Check for necessary capabilities:
|
// Check for necessary capabilities:
|
||||||
if (!GL.SupportsExtension("VERSION_2_0"))
|
string version = GL.GetString(StringName.Version);
|
||||||
|
int major = (int)version[0];
|
||||||
|
int minor = (int)version[2];
|
||||||
|
if (major < 2)
|
||||||
{
|
{
|
||||||
MessageBox.Show("You need at least OpenGL 2.0 to run this example. Aborting.", "GLSL not supported",
|
MessageBox.Show("You need at least OpenGL 2.0 to run this example. Aborting.", "GLSL not supported",
|
||||||
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||||
|
|
Loading…
Reference in a new issue