本文整理汇总了C++中Sphere::load方法的典型用法代码示例。如果您正苦于以下问题:C++ Sphere::load方法的具体用法?C++ Sphere::load怎么用?C++ Sphere::load使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sphere
的用法示例。
在下文中一共展示了Sphere::load方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createPlanet
Sphere* MeshFactory::createPlanet(float radius,std::string const& texture)
{
if(!m_shaderTexture2D)
{
m_shaderTexture2D = new Shader(VERTEX_SHADER_3D, FRAGMENT_SHADER_3D_TEXTURE_2D);
m_shaderTexture2D->load();
}
Sphere* s = new Sphere(radius,radius*2, radius,m_shaderTexture2D,getTexture(texture));
s->load();
return s;
}
示例2: initialize
void GLApplication::initialize() {
if (!windowManager
|| !windowManager->initialize(800, 700, "Window GLFW", false)) {
this->destroy();
exit(-1);
}
glViewport(0, 0, WindowManager::screenWidth, WindowManager::screenHeight);
glClearColor(0.2f, 0.2f, 0.2f, 0.0f);
glEnable(GL_CULL_FACE);
glEnable(GL_DEPTH_TEST);
shader.initialize("Shaders/lightingSpecularMap.vs",
"Shaders/lightingSpecularMap.fs");
sphere.init();
sphere.load();
textureDifuse.load();
textureSpecular.load();
alutInit(0, NULL);
alListenerfv(AL_POSITION, listenerPos);
alListenerfv(AL_VELOCITY, listenerVel);
alListenerfv(AL_ORIENTATION, listenerOri);
alGetError(); // clear any error messages
if (alGetError() != AL_NO_ERROR) {
printf("- Error creating buffers !!\n");
exit(1);
} else {
printf("init() - No errors yet.");
}
// Generate buffers, or else no sound will happen!
alGenBuffers(NUM_BUFFERS, buffer);
buffer[0] = alutCreateBufferFromFile("sounds/lawyer1.wav");
//buffer[0] = alutCreateBufferHelloWorld();
alGetError(); /* clear error */
alGenSources(NUM_SOURCES, source);
if (alGetError() != AL_NO_ERROR) {
printf("- Error creating sources !!\n");
exit(2);
} else {
printf("init - no errors after alGenSources\n");
}
alSourcef(source[0], AL_PITCH, 1.0f);
alSourcef(source[0], AL_GAIN, 1.0f);
alSourcefv(source[0], AL_POSITION, source0Pos);
alSourcefv(source[0], AL_VELOCITY, source0Vel);
alSourcei(source[0], AL_BUFFER, buffer[0]);
alSourcei(source[0], AL_LOOPING, AL_TRUE);
alSourcef(source[0], AL_MAX_DISTANCE, 1200);
objModel.loadModel("objects/nanosuit/nanosuit.obj");
/*alSourcef(source[1], AL_PITCH, 1.0f);
alSourcef(source[1], AL_GAIN, 1.0f);
alSourcefv(source[1], AL_POSITION, source1Pos);
alSourcefv(source[1], AL_VELOCITY, source1Vel);
alSourcei(source[1], AL_BUFFER, buffer[1]);
alSourcei(source[1], AL_LOOPING, AL_TRUE);
alSourcef(source[2], AL_PITCH, 1.0f);
alSourcef(source[2], AL_GAIN, 1.0f);
alSourcefv(source[2], AL_POSITION, source2Pos);
alSourcefv(source[2], AL_VELOCITY, source2Vel);
alSourcei(source[2], AL_BUFFER, buffer[2]);
alSourcei(source[2], AL_LOOPING, AL_TRUE);*/
}