当前位置: 首页>>代码示例>>C++>>正文


C++ OID::isLongLong方法代码示例

本文整理汇总了C++中OID::isLongLong方法的典型用法代码示例。如果您正苦于以下问题:C++ OID::isLongLong方法的具体用法?C++ OID::isLongLong怎么用?C++ OID::isLongLong使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OID的用法示例。


在下文中一共展示了OID::isLongLong方法的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();
//.........这里部分代码省略.........
开发者ID:knicos,项目名称:Cadence,代码行数:101,代码来源:material.cpp


注:本文中的OID::isLongLong方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。