1
0
mirror of synced 2024-12-11 07:16:05 +01:00
Switch-Toolbox/File_Format_Library/GL/LM2_Render.cs

44 lines
1.2 KiB
C#
Raw Normal View History

2019-07-22 22:44:03 +02: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;
2019-07-28 03:05:12 +02:00
using Toolbox.Library;
2019-07-22 22:44:03 +02:00
namespace FirstPlugin.LuigisMansion.DarkMoon
{
public class LM2_Renderer : GenericModelRenderer
{
2019-07-28 03:05:12 +02:00
public List<TexturePOWE> TextureList = new List<TexturePOWE>();
2019-07-22 22:44:03 +02:00
public override void OnRender(GLControl control)
{
}
2019-07-28 03:05:12 +02:00
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)
{
if (texture.ID2.ToString("x") == tex.Name)
{
BindGLTexture(tex, shader, texture);
return tex.textureUnit + 1;
}
}
return tex.textureUnit + 1;
}
2019-07-22 22:44:03 +02:00
}
}