Commit fce0e19d authored by pcy's avatar pcy
Browse files

mabye time I add a readme I guess

parent 97564363
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.
# FNAGLSL
Trying to hackily shoehorn GLSL shaders into FNA, trying to comply with the
`Effect` API as much as possible. (Which isn't always working.)
## Does it work?
Kinda. Static shaders work. Passing vertex data is very hacky and brittle.
Uniforms, samples/textures, ... don't work at all yet. Using regular shaders
interleaved w/ GLSL shader draw calls seems to work ok.
## How does this work?
No. Don't.
## How can I use it?
```cs
var glsl = new GLSLEffect(GraphicsDevice, new Dictionary<GLSLPurpose, string>()
{
{ GLSLPurpose. VertexShader, "vertex shader here" },
{ GLSLPurpose.FragmentShader, "fragment shader here" },
});
// ...
using (var bound = glsl.Bind())
{
GraphicsDevice.DrawPrimitives(/*...*/);
}
```
## License
```
Copyright (C) 2020 PoroCYon <porocyon@titandemo.org>
This work is free. You can redistribute it and/or modify it under the
terms of the Do What The Fuck You Want To Public License, Version 2,
as published by Sam Hocevar. See the LICENSE file for more details.
```
...@@ -106,7 +106,8 @@ namespace PoroCYon.FNAGLSL { ...@@ -106,7 +106,8 @@ namespace PoroCYon.FNAGLSL {
var msg = new sbyte[len]; var msg = new sbyte[len];
fixed (sbyte* buf = msg) { fixed (sbyte* buf = msg) {
GL.GetShaderInfoLog(sh, len, null, buf); GL.GetShaderInfoLog(sh, len, null, buf);
throw new GLSLCompileException(new String(buf, 0, len-1)); throw new GLSLCompileException("Failed to compile "
+ kvp.Key + ": " + new String(buf, 0, len-1));
} }
} }
...@@ -122,7 +123,8 @@ namespace PoroCYon.FNAGLSL { ...@@ -122,7 +123,8 @@ namespace PoroCYon.FNAGLSL {
var msg = new sbyte[len]; var msg = new sbyte[len];
fixed (sbyte* buf = msg) { fixed (sbyte* buf = msg) {
GL.GetProgramInfoLog(prgm, len, null, buf); GL.GetProgramInfoLog(prgm, len, null, buf);
throw new GLSLLinkException(new String(buf, 0, len-1)); throw new GLSLLinkException("Failed to link shader: "
+ new String(buf, 0, len-1));
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment