struct Gloop::Program::UniformLocation

Overview

Reference to an active uniform from a program.

Included Modules

Defined in:

gloop/program/uniform_location.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(context : Context, name : Name, 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: glProgramUniform1f
  • OpenGL version: 4.1

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

Sets the value of the uniform.

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

  • OpenGL function: glProgramUniform1d
  • OpenGL version: 4.1

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

Sets the value of the uniform.

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

  • OpenGL function: glProgramUniform1i
  • OpenGL version: 4.1

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

Sets the value of the uniform.

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

  • OpenGL function: glProgramUniform1ui
  • OpenGL version: 4.1

[View source]
def value_as(type : Float32.class) : Float32 #

Retrieves the value of a uniform.

  • OpenGL function: glGetUniformfv
  • OpenGL version: 2.0

[View source]
def value_as(type : Float64.class) : Float64 #

Retrieves the value of a uniform.

  • OpenGL function: glGetUniformdv
  • OpenGL version: 4.0

[View source]
def value_as(type : Int32.class) : Int32 #

Retrieves the value of a uniform.

  • OpenGL function: glGetUniformiv
  • OpenGL version: 2.0

[View source]
def value_as(type : UInt32.class) : UInt32 #

Retrieves the value of a uniform.

  • OpenGL function: glGetUniformuiv
  • OpenGL version: 3.0

[View source]