本文整理汇总了C++中OID::isDouble方法的典型用法代码示例。如果您正苦于以下问题:C++ OID::isDouble方法的具体用法?C++ OID::isDouble怎么用?C++ OID::isDouble使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OID
的用法示例。
在下文中一共展示了OID::isDouble方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: specular
void wgd::Material::bind() {
if (s_current != this) {
GLfloat mat[4];
colour c = specular();
c.toArray(mat);
glMaterialfv(GL_FRONT, GL_SPECULAR, mat);
c = diffuse();
//if diffuse is null, use white (rather than transparent)
if(get(ix::diffuse)==Null) { c.r=1.0; c.g=1.0; c.b=1.0; c.a=1.0; }
//if (Lighting::enabled() == false) {
// glColor4f(c.r,c.g,c.b,c.a);
//}
//std::cout << "Colours: " << c.r << " " << c.g << " " << c.b << " " << c.a << "\n";
c.toArray(mat);
glMaterialfv(GL_FRONT, GL_DIFFUSE, mat);
c = ambient();
c.toArray(mat);
glMaterialfv(GL_FRONT, GL_AMBIENT, mat);
mat[0] = shininess();
glMaterialfv(GL_FRONT, GL_SHININESS, mat);
c = emission();
c.toArray(mat);
glMaterialfv(GL_FRONT, GL_EMISSION, mat);
s_current = this;
Texture *tex;
//if (get(ix::textures) != Null) {
for (int i=0; i<Texture::maxTextureUnits(); i++) {
tex = texture(i);
if (tex == 0) continue;
tex->bind(i);
}
//} else {
// if (get(ix::texture) != Null) {
// tex = texture();
// if(tex!=NULL)
// tex->bind();
// }
//}
if (get(ix::shader) != Null) {
Shader *shade = shader();
shade->bind();
if (Shader::current() == shade) {
//Set shader variables.
OID vars = get(ix::variables);
OID val;
char sbuf[50];
if (vars != Null) {
for (OID::iterator i=vars.begin(); i!=vars.end(); i++) {
(*i).toString(sbuf, 50);
val = vars[*i];
if (val.isDouble()) shade->setVariable(sbuf, (float)val);
if (val.isLongLong()) shade->setVariable(sbuf, (int)val);
//also need arrays
/*if (val.isObject()) {
//val is an array of n values
//either need to send them individually, or
//create an array and send them all at once
strcat(sbuf, "[0]");
//get number of values
int n=0;
for(n=0; val[n]!=Null; n++);
//floats or ints?
if (val[0].IsFloat()){
float *array = new float[n];
for(int i=0; i<n; i++) array[i] = (float)val[i];
shade->setVariable(sbuf, n, array);
delete [] array;
//cout << "Array " << sbuf << " = ";
//for(int i=0; i<n; i++) cout << array[i] << ", ";
//cout << " (" << n << " values)\n";
}
if (val.IsInt()){
int *array = new int[n];
for(int i=0; i<n; i++) array[i] = (int)val[i];
shade->setVariable(sbuf, n, array);
delete [] array;
}
}*/
}
}
}
}
OID blnd = blending();
//.........这里部分代码省略.........