#104273 - knight0fdragon - Wed Sep 27, 2006 5:30 pm
I am trying to use a texture that is not 128x128,but there seems to be a problem with this,
here is an example of a 128x128 and a 64x64
http://hyperclubbingfriends.yourfreewebspace.com/Knight0fDragon/image007.GIF
and here is snippets of my code
_________________
http://www.myspace.com/knight0fdragonds
MK DS FC: Dragon 330772 075464
AC WW FC: Anthony SamsClub 1933-3433-9458
MPFH: Dragon 0215 4231 1206
here is an example of a 128x128 and a 64x64
http://hyperclubbingfriends.yourfreewebspace.com/Knight0fDragon/image007.GIF
and here is snippets of my code
Code: |
uint16 buf[64*64]; int LoadGLTextures() // Load PCX files And Convert To Textures { for(int i = 0; i < 64*64; i+=3) { buf[i] = RGB15(31,0,0) | BIT(15); buf[i+1] = RGB15(0,31,0) | BIT(15); buf[i+2] = RGB15(0,0,31) | BIT(15); } glGenTextures(1, &texture[0]); glBindTexture(0, texture[0]); glTexImage2D(0, 0, GL_RGBA, TEXTURE_SIZE_64 , TEXTURE_SIZE_64, 0, TEXGEN_TEXCOORD, (uint8*)buf); return TRUE; } int DrawGLScene(void) { //we are going to use floating point for the tutorial...keep in mind the DS has no //floating point hardware. For real life use the built in fixed point types. //this is where the magic happens glPushMatrix(); glLoadIdentity(); // Reset The Current Modelview Matrix glTranslate3f32(-(1<<8),-1<<8,-(450)); // Move Left 1.5 Units And Into The Screen 6.0 for(v16 z = 0 << 12; z < (1 << 9); z+=(1 << 9)) { for(v16 x = 0 << 12; x < (1 << 9); x+=(1 << 9)) { glBindTexture(GL_TEXTURE_2D, texture[0]); glBegin(GL_QUADS); // Draw A Quad glTexCoord2f(0.0f, 1.0f); //glTexCoord2t16((0<<4), (0<<4)); glVertex3v16(x , z, 0); // Top Left glTexCoord2f(1.0f, 1.0f); //glTexCoord2t16((0<<4), (1<<11)); glVertex3v16(x , z + (1 << 9)+1, 0); // Top Right glTexCoord2f(1.0f, 0.0f); //glTexCoord2t16((1<<11), (1<<11)); glVertex3v16(x + (1 << 9)+1, z + (1 << 9)+1, 0); // Bottom Right glTexCoord2f(0.0f, 0.0f); //glTexCoord2t16((1<<11), (0<<4)); glVertex3v16(x + (1 << 9)+1, z, 0); // Bottom Left glEnd(); } } glPopMatrix(1); swiWaitForVBlank(); // flush to screen glFlush(); return TRUE; } |
_________________
http://www.myspace.com/knight0fdragonds
MK DS FC: Dragon 330772 075464
AC WW FC: Anthony SamsClub 1933-3433-9458
MPFH: Dragon 0215 4231 1206