예제 #1
0
 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;
 }
예제 #2
0
            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;
            }
예제 #3
0
 public void Use()
 {
     if ( !Active )
     {
         stCurProgram = this;
         GL.UseProgram( Program );
     }
 }