-
-
Notifications
You must be signed in to change notification settings - Fork 444
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Summary
I'm porting C++ code to Silk and found that my custom Shader class, when I do Shader.Use(), was reporting InvalidOperation error.
After debugging original code of the lesson I found that the error starts after _gl.Uniform1(location, 0); is set for texture, way before _gl.UseProgram(_program); is executed.
Original code doesn't check for error, so that's why it works.
Steps to reproduce
- Platform: Desktop Windows 10 v.22H2
- Framework Version: .NET 8
- API: OpenGL
- API Version: OpenGL 4.5+ Core
- Open
OpenGL Tutorials/Tutorial 1.3 - Texturesexample. - Add this code before
_gl.Uniform1(location, 0);which is currently at line 275:
var errCode = _gl.GetError();
if (errCode != GLEnum.NoError)
{
Console.WriteLine($"Before Uniform1(): {errCode}");
_window.IsClosing = true;
return;
}- Add this code after
_gl.Uniform1(location, 0);which is currently at line 275:
errCode = _gl.GetError();
if (errCode != GLEnum.NoError)
{
Console.WriteLine($"After Uniform1(): {errCode}");
_window.IsClosing = true;
return;
}Comments
I'm not sure what causes the problem.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Type
Projects
Status
Done