need help with glTexImage2D
hello
i work with opengl(jogl) in java.
i added cubemapping to my project, but
my problem is the glTexImage2D.
i load my textures and now i look for a way
to add/bind the textures to the cubemap textures
...
gl.glTexImage2D(GL.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, GL.GL_RGBA,
imageSize, imageSize, 0, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE,
texture[nr]<-error!!!! );
...
how do i bind my textures (texture[nr]) into the glTextImage2d
to use them with cubemapping?
much thanks
I can't spot anything wrong about the code. The question is what type of variable texture is?
It should be
It would be helpful if you could post what kind of error you get...
It should be
GLubyte** texture
It would be helpful if you could post what kind of error you get...
...
import com.sun.opengl.util.*;
import javax.media.opengl.*;
import javax.media.opengl.glu.*;
...
Texture[] texture= new Texture[200];
...
//Texture Loader
texture[nr] = TextureIO.newTexture(new File("gfx/d00"+nr+".JPG"), true);
texture[nr].bind();
gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_LINEAR);
gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, GL.GL_LINEAR_MIPMAP_NEAREST);
gl.glPixelStorei(GL.GL_UNPACK_ALIGNMENT, 2);
gl.glTexEnvf(GL.GL_TEXTURE_ENV, GL.GL_TEXTURE_ENV_MODE, GL.GL_MODULATE);
....
here some code parts of my texture loader
with gl.glTexImage2D it seems i need
to convert my textures to this GLubyte** texture
but i dont know how
(at moment i want to test the textures , later i wanto to put
6 fbo frames into the cubemap,but first i need to get this
textures to work)
import com.sun.opengl.util.*;
import javax.media.opengl.*;
import javax.media.opengl.glu.*;
...
Texture[] texture= new Texture[200];
...
//Texture Loader
texture[nr] = TextureIO.newTexture(new File("gfx/d00"+nr+".JPG"), true);
texture[nr].bind();
gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_LINEAR);
gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, GL.GL_LINEAR_MIPMAP_NEAREST);
gl.glPixelStorei(GL.GL_UNPACK_ALIGNMENT, 2);
gl.glTexEnvf(GL.GL_TEXTURE_ENV, GL.GL_TEXTURE_ENV_MODE, GL.GL_MODULATE);
....
here some code parts of my texture loader
with gl.glTexImage2D it seems i need
to convert my textures to this GLubyte** texture
but i dont know how
(at moment i want to test the textures , later i wanto to put
6 fbo frames into the cubemap,but first i need to get this
textures to work)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement