Jump to content
  • Advertisement
Sign in to follow this  
DerTherion

OpenGL need help with glTexImage2D

This topic is 3515 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
I can't spot anything wrong about the code. The question is what type of variable texture is?
It should be

GLubyte** texture



It would be helpful if you could post what kind of error you get...

Share this post


Link to post
Share on other sites
...
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)



Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!