Beispiel #1
0
/* draw a box (used by cursor and border, etc) (at 1.0f z coord) */
static void draw_box(float x, float y, float w, float h, float a, float r, float g, float b) {
	pvr_poly_cxt_t	cxt;
	pvr_poly_hdr_t	poly;
	pvr_vertex_t	vert;

	pvr_poly_cxt_col(&cxt, PVR_LIST_TR_POLY);
	pvr_poly_compile(&poly, &cxt);
	pvr_prim(&poly, sizeof(poly));

	vert.flags = PVR_CMD_VERTEX;
	vert.x = x;
	vert.y = y + h;
	vert.z = 1.0f;
	vert.u = vert.v = 0.0f;
	vert.argb = PVR_PACK_COLOR(a, r, g, b);
	vert.oargb = 0;
	pvr_prim(&vert, sizeof(vert));

	vert.y -= h;
	pvr_prim(&vert, sizeof(vert));

	vert.y += h;
	vert.x += w;
	pvr_prim(&vert, sizeof(vert));

	vert.flags = PVR_CMD_VERTEX_EOL;
	vert.y -= h;
	pvr_prim(&vert, sizeof(vert));
}
Beispiel #2
0
void q3dFillerWireframeInit(q3dTypeFillerWireframe *type) {
	pvr_poly_cxt_col(&type->defaultCxt, PVR_LIST_OP_POLY);
	pvr_poly_compile(&type->defaultHeader, &type->defaultCxt);

	type->update = &q3dFillerWireframeUpdate;
	type->draw = &q3dFillerWireframeDraw;


}
Beispiel #3
0
void setup() {
    pvr_poly_cxt_t cxt;

    pvr_init(&pvr_params);
    pvr_set_bg_color(0,0,0);

    pvr_poly_cxt_col(&cxt, PVR_LIST_OP_POLY);
    cxt.gen.shading = PVR_SHADE_FLAT;
    pvr_poly_compile(&hdr, &cxt);
}
Beispiel #4
0
void stars_init() {
	int i;
	pvr_poly_cxt_t tmp;

	if (star_x == NULL) {
		star_x = malloc(NS*sizeof(int));
		star_y = malloc(NS*sizeof(int));
		star_z = malloc(NS*sizeof(int));
	}

	for (i=0; i<NS; i++) {
		star_x[i]=randnum(MAXX)-(MAXX/2);
		star_y[i]=randnum(MAXY)-(MAXY/2);
		star_z[i]=randnum(640);
	}

	pvr_poly_cxt_col(&tmp, PVR_LIST_OP_POLY);
	pvr_poly_compile(&stars_header, &tmp);
}
Beispiel #5
0
void plx_cxt_init() {
	pvr_poly_cxt_col(&cxt_working, PVR_LIST_TR_POLY);
	cxt_working.gen.culling = PVR_CULLING_NONE;
}