コード例 #1
0
ファイル: Events.c プロジェクト: gibyfred/Starbird
/*---------------------------------------------------------------------------
---------------------------------------------------------------------------*/
void settings(int on)
{
	int set1[DR_NUM_BUT] =
    {
        UPARROWKEY, DOWNARROWKEY, LEFTARROWKEY, RIGHTARROWKEY,
        PAD2, PAD3, PAD0, PADPERIOD, PADENTER, PAD7, PAD8,
        PAD4, PAD5
    };
	int set2[DR_NUM_BUT] =
    {
       	DOWNARROWKEY, UPARROWKEY, LEFTARROWKEY, RIGHTARROWKEY,
       	PAD0, PADPERIOD, PAD2, PAD3, PADENTER, PAD7, PAD8, 
		PAD4, PAD5
   	};
	int set3[DR_NUM_BUT] =
    {
       	DOWNARROWKEY, UPARROWKEY, LEFTARROWKEY, RIGHTARROWKEY,
       	AKEY, SKEY, ZKEY, XKEY, DKEY, PAD7, PAD8, 
		PAD4, PAD5
   	};
	short last_actions[DR_NUM_BUT] =
    {
        FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,
        FALSE, FALSE, FALSE
    };

	int i, size = DR_NUM_BUT;

	if ( on == 1 )
	{
		for (i=0;i<size;i++)
			Devs[i] = set1[i];
	}
	else if ( on == 2 )
	{
		for (i=0;i<size;i++)
			Devs[i] = set2[i];
	}
	else if ( on == 3 )
	{
		for (i=0;i<size;i++)
			Devs[i] = set3[i];
	}
	else if ( on == 4 )
	{
		vOpenWindow("Help Page", 650, 400, 1);
		init_gl();
		vDrawHelpScene();
	}
	for (i=0;i<size;i++)
		Last_Actions[i] = last_actions[i];
}
コード例 #2
0
ファイル: intdemo.c プロジェクト: PedroRestrepo/CSPS453
/*
 * Name      : void main()
 *
 * Parameters: None.
 *
 * Returns   : void
 *
 * Purpose   : The mainline of the interaction demo.
 */
int main() 
{
    /*
     * Open the main viewing window.
     */
    vOpenWindow();

    /*
     * Perform main event loop.
     */
    vEventLoop();
    return 1;
}