PDA

View Full Version : Help with Textures RGBA4



MChis
08-16-2000, 02:01 AM
Hello!
I have a problem when I create a texture RGBA4. When I select the texure with glBindTexture, my program 'explodes' :b. My question is: The texture mode RGB4 is a standard? Is a problem of my card? Or is a problem of my OpenGL driver?
Thank you in advance.
King regards

MChiz

jc
08-16-2000, 02:15 AM
Could you send the code where you call the glbindtexture and tell us you'r PC config ?

I ask you that because there could be many reasons http://www.opengl.org/discussion_boards/ubb/smile.gif

MChis
08-16-2000, 12:49 PM
void _PROCESO::silDraw(){
GLuint w, h, wa, ha;

if(GRAPH < 0 &#0124; &#0124; GRAPH > 10000)
return;

w = Sprites[0][GRAPH] -> wide;
h = Sprites[0][GRAPH] -> height;

X1 = Sprites[FILE][GRAPH] -> x1;
Y1 = Sprites[FILE][GRAPH] -> y1;

glPushMatrix();

glTranslatef(X,Y,Z);

if(ANGLEX)
glRotatef(ANGLEX,1,0,0);

if(ANGLEY)
glRotatef(ANGLEY,0,1,0);

if(ANGLEZ)
glRotatef(ANGLEZ,0,0,1);

glScalef(SIZE,SIZE,1);

glColor4ub(RED, GREEN, BLUE, ALPHA);

glBlendFunc(GL_ONE, GL_ONE);
switch(FX){
case BLEND:
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
break;

case FLARE:
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
break;
}

if(X < WIDE && X + w > 0){
glBindTexture(GL_TEXTURE_2D, Sprites[0][GRAPH] -> TexName);
glBegin(GL_QUADS);
glTexCoord2f(RIGHT, TOP);
glVertex3i(X1+w,Y1,Z);

glTexCoord2f(RIGHT, BOTTOM);
glVertex3i(X1+w,Y1+h,Z);

glTexCoord2f(LEFT,BOTTOM);
glVertex3i(X1,Y1+h,Z);

glTexCoord2f(LEFT, TOP);
glVertex3i(X1,Y1,Z);
glEnd();
}

glPopMatrix();
}

If you can help me, I will be you very grateful. (grateful? is correct? :b) Sorry for my english and THANX!!! http://www.opengl.org/discussion_boards/ubb/smile.gif
Byez!

<MChiz>