mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-02-24 20:46:52 +00:00
Updated T10_GLSL_Cube to explicitly create a render window.
Added input driver to W01_First_Window. Works perfectly! Added a debug message to GameWindow.cs, when accessing the opengl Context before creating a render window (this forces render window creation).
This commit is contained in:
parent
59b503b3c3
commit
f9ab9f5242
|
@ -50,6 +50,7 @@ namespace Examples.Tutorial
|
||||||
|
|
||||||
public T10_GLSL_Cube()
|
public T10_GLSL_Cube()
|
||||||
{
|
{
|
||||||
|
this.CreateWindow(new OpenTK.Platform.DisplayMode(800, 600));
|
||||||
Context.MakeCurrent();
|
Context.MakeCurrent();
|
||||||
|
|
||||||
//Text =
|
//Text =
|
||||||
|
|
|
@ -23,6 +23,7 @@ namespace Examples.WinForms
|
||||||
{
|
{
|
||||||
public partial class W01_First_Window : Form, IExample
|
public partial class W01_First_Window : Form, IExample
|
||||||
{
|
{
|
||||||
|
OpenTK.InputDevices input;
|
||||||
public W01_First_Window()
|
public W01_First_Window()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
@ -30,6 +31,13 @@ namespace Examples.WinForms
|
||||||
this.ShowDialog();
|
this.ShowDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void OnHandleCreated(EventArgs e)
|
||||||
|
{
|
||||||
|
base.OnHandleCreated(e);
|
||||||
|
|
||||||
|
input = new OpenTK.InputDevices(this.Handle);
|
||||||
|
}
|
||||||
|
|
||||||
private void redButton_Click(object sender, EventArgs e)
|
private void redButton_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
GL.ClearColor(0.7f, 0.0f, 0.0f, 0.0f);
|
GL.ClearColor(0.7f, 0.0f, 0.0f, 0.0f);
|
||||||
|
|
|
@ -175,6 +175,7 @@ namespace OpenTK
|
||||||
{
|
{
|
||||||
if (!glWindow.Created)
|
if (!glWindow.Created)
|
||||||
{
|
{
|
||||||
|
Debug.WriteLine("WARNING: OpenGL Context accessed before creating a render window. This may indicate a programming error. Force-creating a render window.");
|
||||||
mode = new DisplayMode(640, 480);
|
mode = new DisplayMode(640, 480);
|
||||||
this.CreateWindow(mode);
|
this.CreateWindow(mode);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue