net.betabears.the2dlibrary.graphics.shader.Uniform3f.java Source code

Java tutorial

Introduction

Here is the source code for net.betabears.the2dlibrary.graphics.shader.Uniform3f.java

Source

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package net.betabears.the2dlibrary.graphics.shader;

import org.lwjgl.opengl.GL20;

public class Uniform3f implements Uniform {

    private float f0, f1, f2;

    private Uniform3f() {
    }

    public Uniform3f(float f0, float f1, float f2) {
        this.f0 = f0;
        this.f1 = f1;
        this.f2 = f2;
    }

    public float getF0() {
        return f0;
    }

    public void setF0(float f0) {
        this.f0 = f0;
    }

    public float getF1() {
        return f1;
    }

    public void setF1(float f1) {
        this.f1 = f1;
    }

    public float getF2() {
        return f2;
    }

    public void setF2(float f2) {
        this.f2 = f2;
    }

    @Override
    public void apply(int location) {
        GL20.glUniform3f(location, f0, f1, f2);
    }

    @Override
    public Class getType() {
        return Float.class;
    }

    @Override
    public int getElementCount() {
        return 3;
    }
}