예제 #1
0
void new_cube_window( void )
{
	if (screen_info.cols==220) {
		photo = 1;
		if (!z_off) z_off = 400;
	} else if (screen_info.cols==138) {
		if (!z_off) z_off = 800;
	} else {
		if (!z_off) z_off = 600;
	}

	cube_gc = pz_get_gc(1);
	GrSetGCUseBackground(cube_gc, GR_FALSE);
	GrSetGCForeground(cube_gc, BLACK);

	cube_wid = pz_new_window(0, HEADER_TOPLINE + 1, 
	screen_info.cols, screen_info.rows - (HEADER_TOPLINE + 1), 
	cube_do_draw, cube_handle_event);

	GrSelectEvents( cube_wid, GR_EVENT_MASK_TIMER|
	GR_EVENT_MASK_EXPOSURE|GR_EVENT_MASK_KEY_UP|GR_EVENT_MASK_KEY_DOWN);

    cube_timer = GrCreateTimer( cube_wid, 100 );

	GrMapWindow( cube_wid );

	x_off = screen_info.cols/2;
	y_off = (screen_info.rows - (HEADER_TOPLINE + 1))/2;

	temp_pixmap = GrNewPixmap(screen_info.cols,
								(screen_info.rows - (HEADER_TOPLINE + 1)),
						 		NULL);
	
	cube_init();	
}
예제 #2
0
Cube* cube_create(float lower_bound[3],
        float upper_bound[3],
        uint32_t level)
{
    Cube* cube;

    cube = (Cube*)malloc(sizeof(Cube));
    if(cube){
        cube_init(cube, lower_bound, upper_bound, level);
    }

    return cube;
}
void *relative_runtime_strategy_create(int num_devices, unsigned int dims, const unsigned int *groups)
{
	int i;

	struct relative_runtime_strategy_t *info = (struct relative_runtime_strategy_t *)calloc(1, sizeof (struct relative_runtime_strategy_t));
	info->info = partition_info_create(num_devices, dims, groups);
	info->device_info = (struct per_device_info_t *)calloc(num_devices, sizeof (struct per_device_info_t));
	info->cube = cube_init(dims, groups);
	
	/* calculate the total number of groups */
	info->groups_left = 1;
	for (i = 0; i < (int)dims; i++)
		info->groups_left *= groups[i];
	return info;
}
예제 #4
0
파일: main.c 프로젝트: TexT12/LED-stuff
int main (int argc, char **argv)
{

	cube_init();

	pthread_t cube_thread;
	int iret, i, x;

	iret = pthread_create (&cube_thread, NULL, cube_updater, rs232_cube);


	while (1)
	{
		printf("Effect: sidewaves\n");
		sidewaves(2000,100);

		printf("Effect: ripples\n");
		ripples(2000,100);

		printf("Effect: linespin\n");
		linespin(2000,100);

		printf("Effect: sinelines\n");
		sinelines(2000,100);

		printf("Effect: spheremove\n");
		spheremove(1500,100);

		printf("Effect: fireworks\n");
		fireworks(7,50,1200);

        printf("Effect: gol_play\n");
        for (i=0; i<10; i++)
        {
            for (x=0; x<20; x++)
                setvoxel(rand()%4,rand()%4,rand()%4);

            gol_play(50,1000);
            
        }
	}

}
예제 #5
0
void intro_init( void )
{
	static const float projectionmatrix[16] = {
    1.0f, 0.00f,  0.0f,                    0.0f,
    0.0f, 1.25f,  0.0f,                    0.0f,
    0.0f, 0.00f, -(fzf+fzn)/(fzf-fzn),    -1.0f,
    0.0f, 0.00f, -2.0f*fzf*fzn/(fzf-fzn),  0.0f };

    glDisable(GL_DEPTH_TEST);
	glEnable( GL_BLEND );
	glMatrixMode( GL_PROJECTION );
	glLoadMatrixf( projectionmatrix );
    glMatrixMode( GL_MODELVIEW );
//	back_init();
	ACTOR_init(actor_pool);
	cube_init();
	
	BOARD_init();
	
	t0 =  timeGetTime();

	
}