2019-10-27 15:48:16 +01:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using Toolbox.Library.Rendering;
|
|
|
|
|
using GL_EditorFramework.GL_Core;
|
|
|
|
|
using GL_EditorFramework.Interfaces;
|
|
|
|
|
using OpenTK;
|
|
|
|
|
using OpenTK.Graphics.OpenGL;
|
|
|
|
|
using Toolbox.Library;
|
|
|
|
|
|
|
|
|
|
namespace FirstPlugin.LuigisMansion3
|
|
|
|
|
{
|
|
|
|
|
public class LM3_Renderer : GenericModelRenderer
|
|
|
|
|
{
|
2019-11-03 00:35:08 +01:00
|
|
|
|
public Dictionary<string, TexturePOWE> TextureList = new Dictionary<string, TexturePOWE>();
|
2019-10-27 15:48:16 +01:00
|
|
|
|
|
|
|
|
|
public override void OnRender(GLControl control)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override int BindTexture(STGenericMatTexture tex, ShaderProgram shader)
|
|
|
|
|
{
|
|
|
|
|
GL.ActiveTexture(TextureUnit.Texture0 + tex.textureUnit + 1);
|
|
|
|
|
GL.BindTexture(TextureTarget.Texture2D, RenderTools.defaultTex.RenderableTex.TexID);
|
|
|
|
|
|
|
|
|
|
string activeTex = tex.Name;
|
|
|
|
|
foreach (var texture in TextureList)
|
|
|
|
|
{
|
2019-11-03 00:35:08 +01:00
|
|
|
|
if (TextureList.ContainsKey(tex.Name))
|
2019-10-27 15:48:16 +01:00
|
|
|
|
{
|
2019-11-03 00:35:08 +01:00
|
|
|
|
BindGLTexture(tex, shader, TextureList[tex.Name]);
|
2019-10-27 15:48:16 +01:00
|
|
|
|
return tex.textureUnit + 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return tex.textureUnit + 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|