本文整理汇总了C++中LightSource::load方法的典型用法代码示例。如果您正苦于以下问题:C++ LightSource::load方法的具体用法?C++ LightSource::load怎么用?C++ LightSource::load使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LightSource
的用法示例。
在下文中一共展示了LightSource::load方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init
void init() {
camera.position[2] = 15;
libpng_version();
light0.slot = GL_LIGHT0;
light0.setDiffuse(1.0, 1.0, 1.0, 1.0);
light0.setPosition(0.0, 0.0, 1.0, 0.0);
light0.load();
light0.enable();
glewInit();
loadObj((char*) "models/350z.obj", &mesh);
VBOfromMesh(vbo, mesh);
vbo.generate();
int w, h;
test_texture = texture_bank.findOrReg((char*) "textures/350z/vinyls.png");
//test_texture = PNG_load((const char*) "textures/vinyls.png", &w, &h);
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, test_texture);
programID = loadShaders("shaders/vertex.glsl", "shaders/fragment.glsl");
glUseProgram(programID);
uTex = glGetUniformLocation(programID, "texDiff");
glUniform1i(uTex, 0);
uProjection = glGetUniformLocation(programID, "projection");
uView = glGetUniformLocation(programID, "view");
uModel = glGetUniformLocation(programID, "model");
uLightPos = glGetUniformLocation(programID, "lightPos");
uLightDiff = glGetUniformLocation(programID, "lightDiff");
uLightSpec = glGetUniformLocation(programID, "lightSpec");
uCameraPosition = glGetUniformLocation(programID, "cameraPosition");
glEnable(GL_LIGHTING);
glEnable(GL_COLOR_MATERIAL);
glEnable(GL_ALPHA_TEST);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glColorMaterial(GL_FRONT, GL_AMBIENT_AND_DIFFUSE);
glEnable(GL_DEPTH_TEST);
}