예제 #1
0
	BarDisplay(void)
	 : gl()
	 , side(128)
	 , shadow_size(512)
	 , cube(
		List("Position")("Normal").Get(),
		shapes::Cube(0.95, 1.0, 0.95, 0.0, 0.5, 0.0)
	), display_vao(cube.VAOForProgram(display_prog))
	 , shadow_vao(cube.VAOForProgram(shadow_prog))
	{
		init_shadows();
		init_heights();
		init_offsets();

		auto light_proj = CamMatrixf::PerspectiveX(
			Degrees(74),
			1.0,
			1, 3*side
		);
		display_prog.light_proj_matrix.Set(light_proj);
		shadow_prog.projection_matrix.Set(light_proj);
		gl.PolygonOffset(4.0, 4.0);
	}
예제 #2
0
파일: show.c 프로젝트: rforge/muste
static int laji()
{
    int i;
    char rivi[ELE];
    char *sana[5];
    char nimi[LNAME];
    char *p;

    if (*tfile=='*') {
        ted1=ed1;
        ted2=ed2;
        return(2);
    }
    /********************************  20.3.2007
            if (!muste_is_path(tfile) && !netd(tfile))
                                        // 23.2.2006
                {
                if (*tfile=='.') strcpy(nimi,esysd); else strcpy(nimi,edisk);
                strcat(nimi,tfile);
                strcpy(tfile,nimi);
                }
    *********************************/
    strcpy(nimi,tfile);
    muste_append_path(nimi,".EDT"); // RS CHA

    text=muste_fopen(nimi,"rb");
    if (text==NULL)
    {
        text=muste_fopen(tfile,"rb");
        if (text==NULL)
        {
            sprintf(sbuf,"\nText file %s not found!",tfile);
            sur_print(sbuf);
            WAIT;
            return(-1);
        }
        return(0);
    }

    for (i=0; i<ELE; ++i) rivi[i]=(char)getc(text);
    rivi[ELE-1]=EOS;

    if (strncmp(rivi,"SURVO 98",8)==0)
    {
        s98_file=1;
        p=strchr(rivi,':');
        if (p==NULL) {
            rewind(text);
            return(0);
        }
        i=split(p+1,sana,3);
        ted1=atoi(sana[0]);
        ted2=atoi(sana[1]);
        tedshad=atoi(sana[2]);
        rewind(text);
        lue_rivi(rivi);
        i=edit32_alut();
        if (i<0) return(-1);
        return(3);
    }
    i=split(rivi,sana,5);
    if (i<3) {
        rewind(text);
        return(0);
    }
    if (strcmp(sana[0],"SURVO84ED")!=0) {
        rewind(text);
        return(0);
    }
    ted1=atoi(sana[1]);
    ted2=atoi(sana[2]);
    if (i>4 && *sana[4]=='S') tedshad=atoi(sana[4]+1);

    muste_fclose(text);
    text=muste_fopen(nimi,"rb");
    init_shadows();
    rewind(text);
    return(1);
}