Konstantin Koch c61b7a077e Migrated WindowsFormsEditor and WindowsGame and did basic implementation of OpenTK InputDevices
Made it possible to separate the InputDevices by their provider and set
a preffered provider. Otherwise you are restricted to only having one
input Device provider.
Improved the error message if the WindowHandle on the InputDeviceFactory
is invalid.
Improved AssemblyLoader which was skipping the InputDevices.OpenTK
assembly because the OpenTK assembly was blocked. Added ANX.Framework
and SharpDX.Direct3D11.Effects to the ignore list.
The AssemblyLoader is not static anymore (Only used in
AddinSystemFactory) and it doesn't add the same assembly multiple times
anymore. Additionally, if a type of an assembly couldn't be loaded, it
throws now a TypeLoadException with the hint that a dependency might
have been loaded in the wrong version.
Refactored RenderSystem.GL3 with the latest changes on the effect system
that have been done in the ANX.Framework.
2015-10-18 13:37:39 +02:00

98 lines
2.4 KiB
C#

using System;
using System.Collections.Generic;
using ANX.Framework.Graphics;
using ANX.Framework.NonXNA;
using OpenTK.Graphics.OpenGL;
// This file is part of the ANX.Framework created by the
// "ANX.Framework developer group" and released under the Ms-PL license.
// For details see: http://anxframework.codeplex.com/license
namespace ANX.RenderSystem.GL3
{
/// <summary>
/// Native OpenGL implementation of an effect technique.
/// </summary>
public class EffectTechniqueGL3 : INativeEffectTechnique
{
#region Private
/// <summary>
/// The native shader handle.
/// </summary>
internal int programHandle;
/// <summary>
/// The active attributes of this technique.
/// </summary>
internal ShaderAttributeGL3[] activeAttributes;
/// <summary>
/// We currently have only one pass per technique.
/// </summary>
private EffectPass pass;
private EffectGL3 parentEffect;
#endregion
#region Public
/// <summary>
/// The name of the effect technique.
/// </summary>
public string Name { get; private set; }
/// <summary>
/// The passes of the technique.
/// </summary>
public IEnumerable<EffectPass> Passes
{
get { yield return pass; }
}
public EffectAnnotationCollection Annotations
{
get { throw new NotImplementedException(); }
}
public EffectGL3 Parent
{
get { return parentEffect; }
}
#endregion
#region Constructor
/// <summary>
/// Create a ne effect technique object.
/// </summary>
internal EffectTechniqueGL3(EffectGL3 setParentEffect, string setName, int setProgramHandle)
{
parentEffect = setParentEffect;
Name = setName;
programHandle = setProgramHandle;
GetAttributes();
pass = new EffectPass(new EffectPassGL3(this));
}
#endregion
#region GetAttributes
private void GetAttributes()
{
int attributeCount;
GL.GetProgram(programHandle, GetProgramParameterName.ActiveAttributes,
out attributeCount);
activeAttributes = new ShaderAttributeGL3[attributeCount];
for (int index = 0; index < attributeCount; index++)
{
activeAttributes[index] = new ShaderAttributeGL3(programHandle, index);
}
}
#endregion
public void Dispose()
{
}
}
}