little help with background needed
#1
i know that it isn't liked to ask dumb questions about coding c, if oneself has no clue about coding c (or in that case angelscript), but if someone has mercy on me:

how would i add a simple plain white background to this visualisation preset for vortex?

Code:
// SimpleSpectum.vtx
// Author : vanMiez

float[] vl(256);
float time = 0;
int x;


void Render()
{
    
    time += TIMEPASS;
    gfxSetAspect(0);
    gfxTranslate(-0.3, -1.5, 2.414);

    //gfxColour(0, 0, 0, 0);
       
/*
   // calculate spectrum
   for (x=0;x<256;x=x+1)
    vl[x] = 0;
   for (x=0;x<512;x=x+1)
    vl[x/2] = vl[x/2] + GetSpecLeft(x)+GetSpecRight(x);
*/
   // now draw spectrum
   gfxTranslate(-1,0,1);
   gfxBegin(PRIM_QUADLIST);
   gfxSetTexture(NULL);

  
   for (x = 0; x < 256; x++)
   {
   /*
      vl[x] = vl[x]/8;
      if (vl[x]>1.0) vl[x]=1.0;
*/
      
      float spec = GetSpec(x);
      float xPos = x / 100.0f;

      gfxColour(0.3,0.5,0.4,1);
      gfxVertex(xPos+(1/128.0f),0,0);
      gfxVertex(xPos,0,0);
      gfxColour(spec*MIDDLE,spec*TREBLE,spec*BASS,1);
      gfxVertex(xPos,spec*0.6,0);      
      gfxVertex(xPos+(1/128.0f),spec*0.6,0);
   }
   gfxEnd();


}
Reply
#2
Just add:

gfxClear(1,1,1);

before you draw anything and it will clear the whole render target to the specified colour. The 3 parameters are the R, G, B of the colour you want to clear to.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply
#3
(2012-10-13, 09:22)MrC Wrote: Just add:

gfxClear(1,1,1);

before you draw anything and it will clear the whole render target to the specified colour. The 3 parameters are the R, G, B of the colour you want to clear to.

Thank you. Works as expected

Will you have a look into the resizing problem of the vortex visualisatioin? Release Thread

Reply

Logout Mark Read Team Forum Stats Members Help
little help with background needed0