hey,
right, the problem is that my bitmap isnt being mapped onto the square at all, its just white, ive tried using a different variety of bmps but to no avail, its a project that me and me friend are doing and the annoying thing is the mapping worked b4 hand on the old code here:
[b]
void movingRowAliens()
{
static float alienStart = 2.7f;
double xLeft = -4;
if (alienStart >= -2.7)
{
for (double d = xLeft; d < 0-xLeft; d++)
{
float xCoord = (float)d;
glBindTexture(GL_TEXTURE_2D,g_Texture[0]);
glColor3ub(255,255,255);
glBegin (GL_QUADS);
glTexCoord2f(0.0f, 1.0f);
glVertex3f(-.1+xCoord,alienStart,0);
glTexCoord2f(0.0f, 0.0f);
glVertex3f(-.1+xCoord,-.3+alienStart,0);
glTexCoord2f(1.0f, 0.0f);
glVertex3f(.3+xCoord,-.3+alienStart,0);
glTexCoord2f(1.0f, 1.0f);
glVertex3f(.3+xCoord,alienStart,0);
glEnd();
}
}
else alienStart = 2.7f;
alienStart -= .01f;
}
[/b]
and here is the new revised code
[b]
void alienAttack(VectorList alienList)
{
Vector vect = alienList->getCurrent();
glBindTexture(GL_TEXTURE_2D,g_Texture[0]);
glColor3ub(255,255,255);
glBegin (GL_QUADS);
glTexCoord2f(0.0f, 1.0f);
glVertex3f(-.1+vect->x,vect->y,0);
glTexCoord2f(0.0f, 0.0f);
glVertex3f(-.1+vect->x,-.3+vect->y,0);
glTexCoord2f(1.0f, 0.0f);
glVertex3f(.3+vect->x,-.3+vect->y,0);
glTexCoord2f(1.0f, 1.0f);
glVertex3f(.3+vect->x,vect->y,0);
glEnd();
//This moves the alien(s) accross the sceen as they move down
if (!xDirectionTest) // 0 = Moving Right, 1 = MovingLeft
{
if(alienXposition < 1)
{
alienXposition+=.01f;
}
else
{
xDirectionTest = 1;
}
}
else //xDirectionTest=1, => moveing left.
{
if (alienXposition > -1)
{
alienXposition-=.01f;
}
else
{
xDirectionTest = 0;
}
}
vect->y -= .01f;
vect->x = alienXposition;
}
[/b]
im using the sample code from gametutorials.com so i doubt theres anything wrong with my CreateTexture function etc
CreateTexture(g_Texture,“aliengood.bmp”, 0);
thats the declaration of it, any help would be greatly appreciated because ive been at this for days