mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 13:01:52 +00:00
Added Effect constructor
This commit is contained in:
@@ -43,6 +43,17 @@ namespace GlitchyEngine.Renderer
|
|||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public this(GraphicsContext context, String filename, String vsEntry, String psEntry)
|
||||||
|
{
|
||||||
|
let vs = Shader.FromFile!<VertexShader>(context, filename, vsEntry);
|
||||||
|
VertexShader = vs;
|
||||||
|
vs.ReleaseRef();
|
||||||
|
|
||||||
|
let ps = Shader.FromFile!<PixelShader>(context, filename, psEntry);
|
||||||
|
PixelShader = ps;
|
||||||
|
ps.ReleaseRef();
|
||||||
|
}
|
||||||
|
|
||||||
public this(String vsPath, String vsEntry, String psPath, String psEntry)
|
public this(String vsPath, String vsEntry, String psPath, String psEntry)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -86,29 +86,9 @@ namespace Sandbox
|
|||||||
{
|
{
|
||||||
_context = Application.Get().Window.Context..AddRef();
|
_context = Application.Get().Window.Context..AddRef();
|
||||||
|
|
||||||
{
|
_effect = new Effect(_context, "content\\Shaders\\basicShader.hlsl", "VS", "PS");
|
||||||
_effect = new Effect();
|
|
||||||
|
_textureEffect = new Effect(_context, "content\\Shaders\\textureShader.hlsl", "VS", "PS");
|
||||||
let vs = Shader.FromFile!<VertexShader>(_context, "content\\basicShader.hlsl", "VS");
|
|
||||||
_effect.VertexShader = vs;
|
|
||||||
vs.ReleaseRef();
|
|
||||||
|
|
||||||
let ps = Shader.FromFile!<PixelShader>(_context, "content\\basicShader.hlsl", "PS");
|
|
||||||
_effect.PixelShader = ps;
|
|
||||||
ps.ReleaseRef();
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
_textureEffect = new Effect();
|
|
||||||
|
|
||||||
let vs = Shader.FromFile!<VertexShader>(_context, "content\\textureShader.hlsl", "VS");
|
|
||||||
_textureEffect.VertexShader = vs;
|
|
||||||
vs.ReleaseRef();
|
|
||||||
|
|
||||||
let ps = Shader.FromFile!<PixelShader>(_context, "content\\textureShader.hlsl", "PS");
|
|
||||||
_textureEffect.PixelShader = ps;
|
|
||||||
ps.ReleaseRef();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create Input Layout
|
// Create Input Layout
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user