public AttributeInfo(ShaderProgram shader, String identifier, int size, int offset, int divisor, int inputOffset, VertexAttribPointerType pointerType = VertexAttribPointerType.Float, bool normalize = false) { Shader = shader; Identifier = identifier; Location = GL.GetAttribLocation(shader.Program, Identifier); Size = size; Offset = offset; Divisor = divisor; InputOffset = inputOffset; PointerType = pointerType; Normalize = normalize; }
public TextureInfo(ShaderProgram shader, String identifier, TextureUnit textureUnit = TextureUnit.Texture0) { Shader = shader; Identifier = identifier; UniformLocation = GL.GetUniformLocation(Shader.Program, Identifier); TextureUnit = textureUnit; Shader.Use(); int val = (int) TextureUnit - (int) TextureUnit.Texture0; GL.Uniform1(UniformLocation, val); CurrentTexture = null; }
public void Use() { if (!Active) { _sCurProgram = this; GL.UseProgram(Program); } }