Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
pcy
fnaglsl
Commits
fce0e19d
Commit
fce0e19d
authored
Jun 11, 2020
by
pcy
Browse files
mabye time I add a readme I guess
parent
97564363
Changes
3
Hide whitespace changes
Inline
Side-by-side
LICENSE
0 → 100644
View file @
fce0e19d
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.
README.md
0 → 100644
View file @
fce0e19d
# 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.
```
src/GLSLEffect.cs
View file @
fce0e19d
...
...
@@ -106,7 +106,8 @@ namespace PoroCYon.FNAGLSL {
var
msg
=
new
sbyte
[
len
];
fixed
(
sbyte
*
buf
=
msg
)
{
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 {
var
msg
=
new
sbyte
[
len
];
fixed
(
sbyte
*
buf
=
msg
)
{
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
));
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment