Beispiel #1
0
int main(int argc, char **argv)
{
    print_header();

    // throw exception to interupt the run-loop, preventing the x-bridge static destructor to be executed.
    AS3_GoAsync();
}
Beispiel #2
0
int main (int c, char **v)
{
	quakeparms_t parms;
	
	enableCrunLoop = c > 0;

//	signal(SIGFPE, floating_point_exception_handler);
	signal(SIGFPE, SIG_IGN);

	parms.memsize = 16*1024*1024;
	parms.membase = malloc (parms.memsize);
	parms.basedir = basedir;
	parms.cachedir = cachedir;

	COM_InitArgv(c, v);
	parms.argc = com_argc;
	parms.argv = com_argv;

	Sys_Init();

    Host_Init(&parms);

	Cvar_RegisterVariable (&sys_nostdout);

    oldtime = Sys_FloatTime () - 0.1;

    if(enableCrunLoop) {
    	while(true) {
    		engineTick();
    	}
    } else {
    	AS3_GoAsync();	
    }
}
Beispiel #3
0
int main()
{
	// We still need a main function for the SWC. this function must be called
	// so that all the static init code is executed before any library functions
	// are used.
	//
	// The main function for a library must throw an exception so that it does
	// not return normally. Returning normally would cause the static
	// destructors to be executed leaving the library in an unuseable state.

	AS3_GoAsync();
}
int main( int argc, char* args[] )
{
    //Initialize FreeGLUT
    glutInit( &argc, args );

    //Create OpenGL 2.1 context
    glutInitContextVersion( 2, 1 );

    //Create Double Buffered Window
    glutInitDisplayMode( GLUT_DOUBLE );
    glutInitWindowSize( SCREEN_WIDTH, SCREEN_HEIGHT );
    glutCreateWindow( "OpenGL" );

    //Do post window/context creation initialization
    if( !initGL() )
    {
        printf( "Unable to initialize graphics library!\n" );
        return 1;
    }

    //Load graphics programs
    if( !loadGP() )
    {
        printf( "Unable to load shader programs!\n" );
        return 1;
    }

    //Load media
    if( !loadMedia() )
    {
        printf( "Unable to load media!\n" );
        return 2;
    }

    //Set rendering function
    glutDisplayFunc( render );

    #ifdef __AVM2__
        AS3_GoAsync();
        return 0;
    #endif
    
    //Set main loop
    glutTimerFunc( 1000 / SCREEN_FPS, runMainLoop, 0 );

    //Start GLUT main loop
    glutMainLoop();

    return 0;
}
Beispiel #5
0
int main() {
  long mid;
  thr_self(&mid);
  printf("main_tid: %d\n",mid);
  main_tid = mid;

  inline_as3("this[\"abc\"]=8888;");
  inline_as3("var af:Function = function(){};");

  avm2_ui_thunk(assign, NULL);
  avm2_ui_thunk(print, NULL);

  for(int i = 0; i < sNumThreads; i++)
    pthread_create(sThreads + i, NULL, threadProc, (void *)i);
  for(int i = 0; i < sNumThreads; i++)
    pthread_join(sThreads[i], NULL);

  AS3_GoAsync();

  return 0;
}
Beispiel #6
0
int
main(int argc, char **argv)
{
   #if CMDLINE

   bool vertexShader = false, freename = false, optimize = false, gles = false;
   const char* source = 0;
   char* dest = 0;

   for( int i=1; i < argc; i++ )
   {
      if( argv[i][0] == '-' )
      {
         if( 0 == strcmp("-e", argv[i]) )
            gles = true;
         if( 0 == strcmp("-d", argv[i]) )
            glslOptimizerVerbose = true;
         if( 0 == strcmp("-v", argv[i]) )
            vertexShader = true;
         if( 0 == strcmp("-f", argv[i]) )
            vertexShader = false;
         if( 0 == strcmp("-optimize", argv[i]) )
            optimize = true;
      }
      else
      {
         if( source == 0 )
            source = argv[i];
         else if( dest == 0 )
            dest = argv[i];
      }
   }

   if( !source )
      abort();

   if ( !dest ) {
      dest = (char *) calloc(strlen(source)+5, sizeof(char));
      snprintf(dest, strlen(source)+5, "%s.out", source);
      freename = true;
   }

   const char* originalShader = loadFile(source);
   if( !originalShader )
      abort();

   AS3_DeclareVar(srcstr, String);
   AS3_CopyCStringToVar(srcstr, originalShader, strlen(originalShader));

   inline_as3(
      "srcstr = compileShader(srcstr, %0, %1, %2)\n"
      : : "r"(vertexShader ? 0 : 1), "r"(optimize), "r"(gles)
   );

   char *optimizedShader;
   AS3_MallocString(optimizedShader, srcstr);

   if( !saveFile(dest, optimizedShader) )
      abort();

   return 0;

   #endif

   AS3_GoAsync();
}
Beispiel #7
0
int main() {
	AS3_GoAsync();
}
int main(void)
{
	AS3_GoAsync();
	return(0);
}