struct Gloop::UniformLocation

Overview

Reference to an active uniform in the current program.

NOTE If the active program is changed, existing references to uniforms will change to the new program, which may not exist.

Included Modules

Defined in:

gloop/uniform_location.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(context : Context, location : Int32) #

Creates a reference to an active uniform.


[View source]

Instance Method Detail

def location : Int32 #

Location of the uniform.


[View source]
def value=(value : Float32) #

Sets the value of the uniform.

Assumes the uniform is a 32-bit, floating-point number.

  • OpenGL function: glUniform1f
  • OpenGL version: 2.0

[View source]
def value=(value : Float64) #

Sets the value of the uniform.

Assumes the uniform is a 64-bit, floating-point number.

  • OpenGL function: glUniform1d
  • OpenGL version: 4.0

[View source]
def value=(value : Int32) #

Sets the value of the uniform.

Assumes the uniform is a 32-bit, signed integer.

  • OpenGL function: glUniform1i
  • OpenGL version: 2.0

[View source]
def value=(value : UInt32) #

Sets the value of the uniform.

Assumes the uniform is a 32-bit, unsigned integer.

  • OpenGL function: glUniform1ui
  • OpenGL version: 3.0

[View source]