2006-10-03, 19:36
This one is inspired by the Vista-Taskswitch (i dont know how the topmost window gets to the back, so i created my own way)
In this one there is still a bug (the textures tear when the splitted window is shifted away), but i dont know why, so i cant fix it. Maybe someone else finds the bug.
Cya
PHP Code:
// Taskswitch.tra
// Author - morte0815
float time;
Texture background;
void Init()
{
time = 0;
background.LoadTexture("Plasma_edge.jpg");
}
void DrawFrame()
{
gfxSetTexture(background);
gfxTexRect(-1.1f, 1.1f, 1.1f, -1.1f);
}
void TexRect(float top, float bottom, float left, float right,
float ttop, float tbottom, float tleft, float tright)
{
gfxBegin(PRIM_QUADLIST);
gfxTexCoord(tleft,ttop);
gfxVertex(left,top,0);
gfxTexCoord(tright,ttop);
gfxVertex(right,top,0);
gfxTexCoord(tright,tbottom);
gfxVertex(right,bottom,0);
gfxTexCoord(tleft,tbottom);
gfxVertex(left,bottom,0);
gfxEnd();
}
void Render()
{
gfxSetAspect(0);
time += TIMEPASS;
// gfxSetBlendMode(BLEND_ADD);
// float angle = time - 1.5f;
// if (angle < 0){ angle = -angle;}
// angle = 1.5f - angle;
// gfxRotate(Pow(360,angle*2),0,0,1);
if (time < 1.0f){
gfxTranslate(0, 0, 2.414+time*2);
gfxRotate(-65*time,0,1,0);
gfxTranslate(0, 0, -time/2.0f);
gfxPushMatrix();
gfxTranslate(0, 0, 1);
DrawFrame();
gfxSetTexture(TEXTURE_NEXTPRESET);
gfxTexRect(-1, 1, 1, -1);
gfxPopMatrix();
DrawFrame();
gfxSetTexture(TEXTURE_CURRPRESET);
gfxTexRect(-1, 1, 1, -1);
}
if (time > 1.0f && time < 2.0f)
{
gfxTranslate(0, 0, 4.414);
gfxRotate(-65,0,1,0);
gfxTranslate(0, 0, -0.5f);
gfxPushMatrix();
gfxTranslate(0, 0, 1-(time-1));
DrawFrame();
gfxSetTexture(TEXTURE_NEXTPRESET);
gfxTexRect(-1, 1, 1, -1);
gfxPopMatrix();
gfxPushMatrix();
gfxTranslate(0,(time-1)*2,0);
gfxSetTexture(background);
TexRect(1.1f,0.0f,-1.1f,1.1f,1.0f,0.5f,0.0f,1.0f);
gfxSetTexture(TEXTURE_CURRPRESET);
TexRect(1,0,-1,1,1.0f,0.5f,0.0f,1.0f);
gfxPopMatrix();
gfxTranslate(0,(1-time)*2,0);
gfxSetTexture(background);
TexRect(0.0f,-1.1f,-1.1f,1.1f,0.5f,0.0f,0.0f,1.0f);
gfxSetTexture(TEXTURE_CURRPRESET);
TexRect(0,-1,-1,1,0.5f,0.0f,0.0f,1.0f);
}
if (time > 2.0f)
{
gfxTranslate(0, 0, 4.414-(time-2)*2);
gfxRotate(-65+(time-2)*65,0,1,0);
gfxTranslate(0, 0, -0.5f);
gfxPushMatrix();
DrawFrame();
gfxSetTexture(TEXTURE_NEXTPRESET);
gfxTexRect(-1, 1, 1, -1);
}
if (time>=3){
FINISHED = true;
}
}
In this one there is still a bug (the textures tear when the splitted window is shifted away), but i dont know why, so i cant fix it. Maybe someone else finds the bug.
Cya