Beispiel #1
0
// Main routine
// Set up OpenGL, hook up callbacks, and start the main loop
int main( int argc, char** argv )
{
	// Need to double buffer for animation
	glutInit(&argc,argv);
    glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH );

	// Create and position the graphics window
    glutInitWindowPosition( 0, 0 );
    glutInitWindowSize( 1280, 1024 );
    glutCreateWindow( "Collision Detector" );

	// Initialize OpenGL.
    OpenGLInit();

	// Set up callback functions for key presses
	glutKeyboardFunc( KeyPressFunc );

	// Set up the callback function for resizing windows
    glutReshapeFunc( ResizeWindow );

	// Callback for graphics image redrawing
    glutDisplayFunc( Animate );
	
	// Start the main loop.  glutMainLoop never returns.
	glutMainLoop(  );

    return(0);			// Compiler requires this to be here. (Never reached)
}
Beispiel #2
0
    STARTDECL(gl_window) (Value &title, Value &xs, Value &ys)
    {
        if (graphics_initialized)
            g_vm->BuiltinError("cannot call gl_window() twice");

        screensize = int2(xs.ival, ys.ival);
        string err = SDLInit(title.sval->str(), screensize);
        title.DECRT();

        if (err.empty())
        {
            OpenGLInit();

            err = LoadMaterialFile("shaders/default.materials");
        }

        if (!err.empty())
        {
            DebugLog(1, err.c_str());
            return Value(g_vm->NewString(err));
        }

        colorshader = LookupShader("color");
        assert(colorshader);

        meshes   = new IntResourceManagerCompact<Mesh>();

        DebugLog(-1, "graphics fully initialized...");
        graphics_initialized = true;

        return Value(0, V_NIL);
    }
Beispiel #3
0
int main(int argc, char **argv)
{
    init();
    glutInit(&argc, argv);
    glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
    glutInitWindowPosition(300, 300);
    glutInitWindowSize(600, 600);
    glutCreateWindow("Cube");
    //glutFullScreen();

    OpenGLInit();
    glutMouseFunc(MouseFunc);
    glutKeyboardFunc(KeyPressFunc);
    glutDisplayFunc(render);
    glutIdleFunc(animation);
    glutMainLoop();
    return (0);
}
// Main routine
// Set up OpenGL, hook up callbacks, and start the main loop
int main(int argc, char** argv)
{
	// Need to double buffer for animation
	glutInit(&argc, argv);
	glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);

	// Create and position the graphics window

	glutInitWindowPosition(1500, 1000);
	glutInitWindowSize(0, 0);
	glutCreateWindow("Grafika 3segitiga");
	glutFullScreen();

	OpenGLInit();
	glutKeyboardFunc(KeyPressFunc);
	glutDisplayFunc(render);
	glutIdleFunc(render);
	glutMainLoop();
	return(0);          // Compiler requires this to be here. (Never reached)
}
Beispiel #5
0
void VIICanvas::Paintit(wxPaintEvent& event)
{
	//std::cout << "Draw" << std::endl;
	OpenGLInit();
	Render();
}