Пример #1
0
void LightSource::init(const std::string& vertexPath, const std::string& fragmentPath) {
	shadowShader.compileShaders(vertexPath, fragmentPath, " ");
	shadowShader.addAttribute("vertexPosition");
	shadowShader.linkShaders();
	initTex();
	initFrameBuffer();
}
Пример #2
0
int main(int argc, char* argv[])
{
    glutInit(&argc, argv);
    glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
    glutInitWindowSize(800,800);
    glutInitWindowPosition(0,0);
    glutCreateWindow("Solar system with texture");
    glutSpecialFunc(KeyControl);
    glutReshapeFunc(ChangeSize);
    glutDisplayFunc(RenderScene);
    initTex();
    //이동하는 것을 보려면 glutTimerFunc에 걸린 주석을 풀면 된다. 화살표 키로도 움직이는 것을 볼 수있다.
    glutTimerFunc(33,TimerFunc,1);
    SetupRC();
    glutMainLoop();
    return 0;
}