int main() { int i, j; struct point p1; struct point p2; struct point p3; p1 = define_point(1, 2); p2 = define_point(5, 4); p3 = define_point(-2, 3); printf("p1 = "); put_point(p1); printf("\n"); printf("p2 = "); put_point(p2); printf("\n"); printf("p3 = "); put_point(p3); printf("\n"); return 0; }
int main() { struct point p1,p2,p3; p1 = define_point(1,2); p2 = define_point(5,4); p3 = define_point(-2,3); printf("p1 = "); put_point(p1); printf("p2 = "); put_point(p2); printf("p3 = "); put_point(p3); return 0; }
/* Plot a particle on the screen. */ static INLINE void put_particle (int i, Pixel color) { double x = particles[i].rx; double y = particles[i].ry; unsigned gx = (unsigned) (grid_width * (scale * x + 0.5)) % grid_width; unsigned gy = (unsigned) (grid_height * (0.5 - scale * y)) % grid_height; put_point (gx, gy, color, i); }
void produce() { bool ret; int next; #pragma omp critical ret = buffer_full() || consumer_count + (w_index - r_index)%FIFO_SIZE > N; if(ret) return; #pragma omp critical next = (w_index + 1) % FIFO_SIZE; double x = (double) rand() / RAND_MAX; double y = (double) rand() / RAND_MAX; if(!put_point(x, y, next)) return; #pragma omp critical w_index = next; }
void rm380z_state::init_graphic_chars() { for (int c=0;c<0x3f;c++) { if (c&0x01) put_point(c,0,0,1); else put_point(c,0,0,0); if (c&0x02) put_point(c,3,0,1); else put_point(c,3,0,0); if (c&0x04) put_point(c,0,3,1); else put_point(c,0,3,0); if (c&0x08) put_point(c,3,3,1); else put_point(c,3,3,0); if (c&0x10) put_point(c,0,6,1); else put_point(c,0,6,0); if (c&0x20) put_point(c,3,6,1); else put_point(c,3,6,0); } }