Thanks Tom, I appreciate it
I downloaded the file you pointed me to and looked at the source (I couldn’t compile cause I was missing numerous files). I tried using GL_RGB8 and GL_RGBA8 and both fail. The texture is always white
What I am trying to do is take six “snapshots” of a scene to create a cube map for use in Cubic Environment Mapping. I have it working right now by saving the frame buffer with glReadPixels then generating a cubemap texture out of the six textures using gluBuild2DMipmaps.
The only drawback of this method is of course speed, its quite slow. I tried replacing gluBuild2DMipmaps with glTexImage2D but for some odd reason it doesn’t work at all. I made sure that the texture width/height were the same (512x512) and that all 6 textures were the exact same dimensions.
Doesn’t work , both glTexImage2d and glCopyTexImage2d both fail on me (no OpenGL error is reported though), I always get a white texture.
I’m at a loss…
Here is the chunk of code in question:
for I := 0 to 5 do begin
xRot := rot[I, 0];
yRot := rot[I, 1];
//glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB + i, 0, 3, screenBmp.Width, screenBmp.Height, 0, GL_RGB, GL_UNSIGNED_BYTE, screenBmp.Bits);
gluBuild2DMipmaps(GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB + I, 3, screenBmp.Width, screenBMP.Height, GL_RGB, GL_UNSIGNED_BYTE, screenBmp.Bits);
//glCopyTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB + I, 0, GL_RGB8, 0, 0, 512, 512, 0);
the xRot, yRot stuff just rotates the scene.
DelphiGL ( http://delphigl.cfxweb.net )