void ProgramUniformGLSL::Get(float &fX, float &fY)
{
	float fElements[2];
	glGetUniformfvARB(m_nOpenGLProgram, m_nOpenGLUniformLocation, fElements);
	fX = fElements[0];
	fY = fElements[1];
}
/*
 * getUniformfv
 *
 * parameter name - char*
 * parameter values - GLfloat*
 */
void ShaderObject::getUniformfv(const char * name, GLfloat* values) {
    GLint location;
    location = glGetUniformLocationARB(shaderObject, name);
    if (location == -1) {
        std::cout << "Error: can't find uniform variable \"" << name << "\"" << std::endl;
    }
    glGetUniformfvARB(shaderObject, location, values);

} // end getUniformfv()
Beispiel #3
0
Vector4D    GlslProgram :: getUniformVector ( const char * name )
{
    float   values [4];

    int loc = glGetUniformLocationARB ( program, name );

    if ( loc < 0 )
        return Vector4D ( 0, 0, 0, 0 );

    glGetUniformfvARB ( program, loc, values );

    return Vector4D ( values [0], values [1], values [2], values [3] );
}
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBShaderObjects_nglGetUniformfvARB(JNIEnv *env, jclass clazz, jint programObj, jint location, jobject params, jint params_position, jlong function_pointer) {
	GLfloat *params_address = ((GLfloat *)(*env)->GetDirectBufferAddress(env, params)) + params_position;
	glGetUniformfvARBPROC glGetUniformfvARB = (glGetUniformfvARBPROC)((intptr_t)function_pointer);
	glGetUniformfvARB(programObj, location, params_address);
}
void ProgramUniformGLSL::Get(Matrix4x4 &mMatrix)
{
	glGetUniformfvARB(m_nOpenGLProgram, m_nOpenGLUniformLocation, mMatrix.fM);
}
void ProgramUniformGLSL::Get4(float *pfComponents)
{
	glGetUniformfvARB(m_nOpenGLProgram, m_nOpenGLUniformLocation, pfComponents);
}
void ProgramUniformGLSL::Get(Quaternion &qQuaternion)
{
	glGetUniformfvARB(m_nOpenGLProgram, m_nOpenGLUniformLocation, qQuaternion.fQ);
}
void ProgramUniformGLSL::Get(Color4 &cColor)
{
	glGetUniformfvARB(m_nOpenGLProgram, m_nOpenGLUniformLocation, cColor.fColor);
}
void ProgramUniformGLSL::Get(Vector4 &vVector)
{
	glGetUniformfvARB(m_nOpenGLProgram, m_nOpenGLUniformLocation, vVector.fV);
}
void ProgramUniformGLSL::Get(float &fX)
{
	glGetUniformfvARB(m_nOpenGLProgram, m_nOpenGLUniformLocation, &fX);
}
void WShaderProgram::getValue1f( const char *name, float &v1 )
{
	GLint loc = glGetUniformLocationARB( programId(), name );
	glGetUniformfvARB( programId(), loc, &v1 );
}