示例#1
0
int main()
{
    CGL *gl = new CGL(SCREEN_WIDTH, SCREEN_HEIGHT);
    gl->initGL();

	int flags= SDL_OPENGL|SDL_RESIZABLE;
    CSDL *sdl = new CSDL(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_BPP,flags, gl);
    sdl->setCaption("Basic Shading");

    while(true)
    {
        sdl->handleEvent(gl);
        gl->renderGL();
    }
    return 0;
}
示例#2
0
文件: main.cpp 项目: qioixiy/notes
int main()
{
    CGL *gl = new CGL(SCREEN_WIDTH, SCREEN_HEIGHT);
    gl->initGL();

	int flags= SDL_OPENGL|SDL_RESIZABLE;
    CSDL *sdl = new CSDL(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_BPP,flags, gl);
    sdl->setCaption("GLSL-Texturing");
    //if(glewInit() != GLEW_OK) exit(EXIT_FAILURE);
    gl->compileShader();
    gl->loadTexture();
    gl->setUniform();

    while(true)
    {
        sdl->handleEvent(gl);
        gl->renderGL();
    }
    gl->clean();
    //cout << "Hello world!" << endl;
    return 0;
}