本文整理汇总了C++中SpriteManager::AddSprite方法的典型用法代码示例。如果您正苦于以下问题:C++ SpriteManager::AddSprite方法的具体用法?C++ SpriteManager::AddSprite怎么用?C++ SpriteManager::AddSprite使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SpriteManager
的用法示例。
在下文中一共展示了SpriteManager::AddSprite方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetupRC
void SetupRC()
{
SpriteManager *sprites = SpriteManager::instance();
Vector p(0.0f,0.0f,-1.0f);
player = new Player("resources/Models/cube.ogl", p);
sprites->AddSprite( player);
std::string filename="resources/Models/cube.ogl";
test = new Model(filename);
/*
Vector v((GLfloat)(0), (GLfloat)(0), (GLfloat) (5) );
sprites->AddSprite( new Sprite("resources/Models/cube.ogl", v) );
*/
for (int i=0; i<30; i++) {
Vector v((GLfloat)(0), (GLfloat)(i *3 ), (GLfloat) (10) );
sprites->AddSprite( new Sprite("resources/Models/cube.ogl", v, i*8, i*2, i*5) );
}
glEnable(GL_DEPTH_TEST);
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
glClearColor(0.0f, 0.0f, 0.0f, 1.0f );
shader.vertexShader = makeShader( GL_VERTEX_SHADER, "resources/Shaders/identity.vs");
if(shader.vertexShader == 0){
printf("failed to make vertex shader");
exit(0);
}
shader.fragmentShader = makeShader(GL_FRAGMENT_SHADER, "resources/Shaders/identity.fs");
if(shader.fragmentShader == 0){
printf("failed to make fragment shader");
exit(0);
}
shader.program = makeProgram(shader.vertexShader, shader.fragmentShader);
if(shader.program == 0){
printf("failed to make program");
exit(0);
}
shader.uniforms.colour = glGetUniformLocation( shader.program, "colour");
if( shader.uniforms.colour == -1){
printf( "failed to locate uniform colour location");
exit(0);
}
shader.uniforms.modelViewProjectionMatrix = glGetUniformLocation(shader.program, "modelViewProjectionMatrix");
if( shader.uniforms.modelViewProjectionMatrix == -1){
printf("failed to locate uniform modelViewProjectionMatrix");
exit(0);
}
shader.attributes.pos = glGetAttribLocation( shader.program, "position");
}