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


C++ ObjModel::genList方法代码示例

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


在下文中一共展示了ObjModel::genList方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: init

void init(int argc, char** argv)
{
	/**
	* This function initializes the graphics properties of the whole game
	*/
	glutInit(&argc, argv);
	glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH | GLUT_MULTISAMPLE);		//Double Buffering - RGBAlpha - 3D - Ani-Aliasing
	glutInitWindowSize(winsizex, winsizey); 											//Window size
	glutCreateWindow("PAC-MINION"); 														//Create a window
	glutFullScreen();																	//Start with full screen mode
	glutIgnoreKeyRepeat(1);																//Ignoring key repaeat, Since we have key states
	glClearDepth(1);			
	glClearColor(0.0f, 0.0f, 0.0f, 1.0f);												//Initial color flush
	glEnable(GL_DEPTH_TEST); 															//Make sure 3D drawing works when one object is in front of another
	glEnable(GL_LIGHTING);																//Enable Lighting
	glEnable(GL_LIGHT0);																//Light 0 is enabled
	glShadeModel (GL_SMOOTH);	
	glEnable(GL_COLOR_MATERIAL);														//Enabling coloring in 3d materials
	glEnable(GL_BLEND); 																//Enable the OpenGL Blending functionality  
	glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);									//Function to be used for blending the graphical objects 
	GLfloat light_position[] = { 0.0, 0.0, 1.0, 0.0 };
	glLightfv(GL_LIGHT0, GL_POSITION, light_position);									//Setting the light position
	GLfloat light_ambient[] = { 0.2, 0.2, 0.2, 1.0 };
	glLightfv(GL_LIGHT0, GL_AMBIENT, light_ambient);									//Setting the ambient light intensity
	minion.genList();																	//Generating the drawing list of thw minion
	
}
开发者ID:aravindsagar,项目名称:pac-minion,代码行数:27,代码来源:pac_1_cpp.cpp


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