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.Parse( TextureUnit.ToString().Substring( "Texture".Length ) ); GL.Uniform1( UniformLocation, val ); CurrentTexture = null; }
public void Use() { if ( !Active ) { stCurProgram = this; GL.UseProgram( Program ); } }