little help with background needed

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
vanMiez Offline
Senior Member
Posts: 175
Joined: Apr 2010
Reputation: 0
Location: Berlin, Germany
Post: #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();


}
find quote
MrC Offline
Team-XBMC Developer
Posts: 82
Joined: Jan 2004
Reputation: 0
Location: England
Post: #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.
find quote
vanMiez Offline
Senior Member
Posts: 175
Joined: Apr 2010
Reputation: 0
Location: Berlin, Germany
Post: #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
find quote