Exemplo n.º 1
0
        internal static ProgramUniform Create(Program program, ProgramUniformInfo info, uint textureUnit)
        {
            switch (info.Type)
            {
            case GL.FLOAT: return(new ProgramUniformFloat1(program, info));

            case GL.FLOAT_VEC2: return(new ProgramUniformFloat2(program, info));

            case GL.FLOAT_VEC3: return(new ProgramUniformFloat3(program, info));

            case GL.FLOAT_VEC4: return(new ProgramUniformFloat4(program, info));

            case GL.INT: return(new ProgramUniformInt1(program, info));

            case GL.INT_VEC2: return(new ProgramUniformInt2(program, info));

            case GL.INT_VEC3: return(new ProgramUniformInt3(program, info));

            case GL.INT_VEC4: return(new ProgramUniformInt4(program, info));

            case GL.UNSIGNED_INT: return(new ProgramUniformUInt1(program, info));

            //case GL.UNSIGNED_INT_VEC2:
            //case GL.UNSIGNED_INT_VEC3:
            //case GL.UNSIGNED_INT_VEC4:

            case GL.BOOL: return(new ProgramUniformBool1(program, info));

            //case GL.BOOL_VEC2:
            //case GL.BOOL_VEC3:
            //case GL.BOOL_VEC4:

            case GL.FLOAT_MAT2: return(new ProgramUniformFloatMatrix2(program, info));

            case GL.FLOAT_MAT3: return(new ProgramUniformFloatMatrix3(program, info));

            case GL.FLOAT_MAT4: return(new ProgramUniformFloatMatrix4(program, info));

            //case GL.FLOAT_MAT2x3:
            //case GL.FLOAT_MAT2x4:
            //case GL.FLOAT_MAT3x2:
            //case GL.FLOAT_MAT3x4:
            //case GL.FLOAT_MAT4x2:
            //case GL.FLOAT_MAT4x3:

            //case GL.SAMPLER_1D:
            case GL.SAMPLER_2D: return(new ProgramUniformSampler2D(program, info, textureUnit));

            //case GL.SAMPLER_3D:
            //case GL.SAMPLER_CUBE:
            //case GL.SAMPLER_1D_SHADOW:
            //case GL.SAMPLER_2D_SHADOW:
            //case GL.SAMPLER_1D_ARRAY:
            //case GL.SAMPLER_2D_ARRAY:
            //case GL.SAMPLER_1D_ARRAY_SHADOW:
            //case GL.SAMPLER_2D_ARRAY_SHADOW:
            //case GL.SAMPLER_2D_MULTISAMPLE:
            //case GL.SAMPLER_2D_MULTISAMPLE_ARRAY:
            //case GL.SAMPLER_CUBE_SHADOW:
            //case GL.SAMPLER_BUFFER:
            //case GL.SAMPLER_2D_RECT:
            //case GL.SAMPLER_2D_RECT_SHADOW:
            //case GL.INT_SAMPLER_1D:
            //case GL.INT_SAMPLER_2D:
            //case GL.INT_SAMPLER_3D:
            //case GL.INT_SAMPLER_CUBE:
            //case GL.INT_SAMPLER_1D_ARRAY:
            //case GL.INT_SAMPLER_2D_ARRAY:
            //case GL.INT_SAMPLER_2D_MULTISAMPLE:
            //case GL.INT_SAMPLER_2D_MULTISAMPLE_ARRAY:
            //case GL.INT_SAMPLER_BUFFER:
            //case GL.INT_SAMPLER_2D_RECT:
            //case GL.UNSIGNED_INT_SAMPLER_1D:
            //case GL.UNSIGNED_INT_SAMPLER_2D:
            //case GL.UNSIGNED_INT_SAMPLER_3D:
            //case GL.UNSIGNED_INT_SAMPLER_CUBE:
            //case GL.UNSIGNED_INT_SAMPLER_1D_ARRAY:
            //case GL.UNSIGNED_INT_SAMPLER_2D_ARRAY:
            //case GL.UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE:
            //case GL.UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY:
            //case GL.UNSIGNED_INT_SAMPLER_BUFFER:
            //case GL.UNSIGNED_INT_SAMPLER_2D_RECT:

            default:
                throw new Exception();
            }
        }
Exemplo n.º 2
0
 internal ProgramUniform(Program program, ProgramUniformInfo info)
 {
     Program = program;
     Info    = info;
 }
Exemplo n.º 3
0
 internal ProgramUniformFloatMatrix4(Program program, ProgramUniformInfo info)
     : base(program, info)
 {
 }
Exemplo n.º 4
0
 internal ProgramUniformSampler2D(Program program, ProgramUniformInfo info, uint textureUnit)
     : base(program, info)
 {
     m_textureUnit = textureUnit;
 }
Exemplo n.º 5
0
 internal ProgramUniformBool1(Program program, ProgramUniformInfo info)
     : base(program, info)
 {
 }