This is something of a follow-up to the thread on E2DSurfaces. I'm using OpenGL ES instead of Edgelib's internal renderer and I find that my texture loading code does not work correctly anymore.
For instance, the code below shades only some faces of the cube and even then, only partially.
However, when I use the code to directly load a texture from a file, the textures are mapped perfectly. I'm using an N95 and the Symbian OpenGL ES examples work perfectly. What could be the difference between the edge renderer texture format and that of OpenGL ES?
Another thing that I noticed was that while using the Edgelib renderer, I was able to lock the texture, change its contents and the cube would show those chanegs. When I switched to OpenGL ES however, I'm not able to change the texture after the 1st binding.
Any help would be greatly appreciated
Cheers!
For instance, the code below shades only some faces of the cube and even then, only partially.
- Code:
E2DSURFACEINFO lockinfo;
unsigned char *bufptr;
bufptr = texture.Lock(&lockinfo);
if (bufptr)
{
int x, y;
bufptr += lockinfo.bufferoffset;
for (y = 0; y < height; y++)
{
for (x = 0; x < width; x++)
{
if (lockinfo.pixelformat == EDSP_INDEXED8)
*bufptr = 255;
else if (lockinfo.pixelformat == EDSP_TRUE12 || lockinfo.pixelformat == EDSP_TRUE16)
*((unsigned short *)(bufptr)) = 255;
else if (lockinfo.pixelformat == EDSP_TRUE32)
*((unsigned long *)(bufptr)) = 255;
bufptr += lockinfo.xpitch;
}
bufptr += lockinfo.ypitch - texture.GetWidth() * lockinfo.xpitch;
}
texture.Unlock();
}
However, when I use the code to directly load a texture from a file, the textures are mapped perfectly. I'm using an N95 and the Symbian OpenGL ES examples work perfectly. What could be the difference between the edge renderer texture format and that of OpenGL ES?
Another thing that I noticed was that while using the Edgelib renderer, I was able to lock the texture, change its contents and the cube would show those chanegs. When I switched to OpenGL ES however, I'm not able to change the texture after the 1st binding.
Any help would be greatly appreciated
Cheers!