Ejemplo n.º 1
0
        public void InitTexture(int Width, int Height)
        {
            if (!Enabled)
            {
                return;
            }

            if (Texture == null && !External)
            {
                Texture = new Texture($"tex_{Slot:00}", Width, Height, TextureTarget.Texture2D, TextureParam.InternalFormat, TextureParam.Format, TextureParam.Type);
            }

            if (!External)
            {
                TextureParam.ApplyParametersTo(Texture);
                Texture.Load();
                Texture.UploadEmpty();
                if (TextureParam.MipMaps)
                {
                    GL.GenerateMipmap(GenerateMipmapTarget.Texture2D);
                }
            }
        }