Пример #1
0
int main(int argc, char** argv)
{
	InitWin7();
	InitDevIL();
	InitRun(argc,argv);
	InitGlut(argc, argv);
	if (bFreshRun)
		InitNx();
	else
		ReInitNx();
	glutMainLoop();
	ReleaseNx();
	return 0;
}
Пример #2
0
int main(int argc, char** argv)
{
#ifdef _DEBUG
	cout << "***DEBUG BUILD***" << endl;
#endif
	ncc::whoami();

	InitRun(argc,argv);
	InitGlut(argc,argv);
	InitHUD();
	InitDevIL();
	InitPhysX();
	InitCUDA();
	InitExperiment();
	glutMainLoop(); // enter event processing

	return 0; // never actually reached.
}
Пример #3
0
    void GLRenderer::Initialise()
    {
        RenderState rs;
        rs.state = RenderState::None;
        rs.matrixMode = -1;
        rs.target = 0;
        this->_PushState(rs);

        GLenum error = glewInit();
        if (error != GLEW_OK)
            throw std::runtime_error(ToString("glewInit() failed: ") + ToString(glewGetErrorString(error)));
        if (!(GLEW_ARB_vertex_shader && GLEW_ARB_fragment_shader))
            throw std::runtime_error("ARB_vertex_shader and ARB_fragment_shader are required");

        Tools::log << "Glew version: " << (char const*)glewGetString(GLEW_VERSION) << "\n";
        Tools::log << "OpenGL version: " << (char const*)glGetString(GL_VERSION) << "\n";

        GLCHECK(glEnable(GL_BLEND));
        //GLCHECK(glEnable(GL_ALPHA_TEST));
        GLCHECK(glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA));
        //GLCHECK(glBlendFunc(GL_DST_ALPHA, GL_ONE_MINUS_SRC_ALPHA));

        if (_cgGlobalContext == 0)
            _cgGlobalContext = cgCreateContext();
        this->_cgContext = _cgGlobalContext;
        ++_cgGlobalNbReferences;
        cgSetErrorCallback(&ErrCallback);
        cgGLSetDebugMode(CG_FALSE);
        cgSetParameterSettingMode(this->_cgContext, CG_DEFERRED_PARAMETER_SETTING);
        cgGLRegisterStates(this->_cgContext);
        cgGLSetManageTextureParameters(this->_cgContext, CG_TRUE);

        InitDevIL();

        GLCHECK(glCullFace(GL_FRONT));
    }