PDA

View Full Version : glColorPointer in linux



Janani
11-25-2009, 01:53 AM
I am using glcolorpointer to show the color fading

It is working fine in vc++. But i am getting some unexpected results when i port the same coding in Linux Os.

I am attaching the code .


CODING

float v3,v4,v5,v6;
float sweepvertexarray[5000];
float intensityarray[5000];
float myintensity=1.0;
float myalpha=1.0;
int k=0;
int indices1;
for(float cpi=(6.28);cpi>0;cpi=cpi-0.0157)
{
v3=0.0f;
v4=0.0f;
v5=8*0.252*sin(cpi);
v6=8*0.252*cos(cpi);
sweepvertexarray[(k*4)+0]=v3;
sweepvertexarray[(k*4)+1]=v4;
sweepvertexarray[(k*4)+2]=v5;
sweepvertexarray[(k*4)+3]=v6;
intensityarray[(k*4)+0]=0.0f;
intensityarray[(k*4)+1]=myintensity;
intensityarray[(k*4)+2]=0.0f;
intensityarray[(k*4)+3]=myalpha;
myalpha=myalpha-0.0025;
myintensity=myintensity-0.0025;
k++;
indices1=k*2;
}

//glColor4f(0.0f,1.0f,0.0f,1.0);


glEnableClientState(GL_COLOR_ARRAY);
glEnableClientState(GL_VERTEX_ARRAY);
glColorPointer(4, GL_FLOAT,8, intensityarray);
glVertexPointer(2, GL_FLOAT,0,sweepvertexarray);
glDrawArrays(GL_QUAD_STRIP,0,indices1);
glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_COLOR_ARRAY);

Janani

ZbuffeR
11-25-2009, 02:06 AM
Please : do not cross-post ! Choose one forum section, in this case either 'beginner' or 'linux' is ok, but post ONLY in one !

Thread redirect to continue the discussion (http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=267676)

Janani
11-25-2009, 02:15 AM
Ok, i am stuck in this i am not able to proceed .

Janani

ZbuffeR
11-25-2009, 02:27 AM
that is why it is a bad idea to cross post between forum sections, there is a nice solution out there :
http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=267676

:cool: