text problem => ive a blackskware

cutibipoulet
Unregistered
 
Post: #16
sorry, its juste a mistak.... but ive in reallity int[]

=>
tmp = new int[1];
gl.glGenTextures(1, tmp);

its dont work....
Quote this message in a reply
cutibipoulet
Unregistered
 
Post: #17
for more information, i cant load the text in the hard...
Indeed, if i try gl.glIsTexture(textureID) its return false (at the end of my text loading)......

this is the souce of the text loader :

==========================================================
public Texture getTexture(String name,
String resourceName,
int target,
int dstPixelFormat,
int minFilter,
int magFilter,
boolean wrap,
boolean mipmapped) throws IOException
{

int srcPixelFormat = 0;

// create the texture ID for this texture
int textureID = createTextureID();
System.out.println("Loading texture "+resourceName+" to ID: "+textureID);
Texture texture = new Texture(resourceName,target,textureID);

// bind this texture
gl.glBindTexture(target, textureID);

BufferedImage bufferedImage = loadImage(resourceName);
System.out.println("==> bufferedImage== "+bufferedImage.toString());
// Getting the real Width/Height of the Texture in the Memory
int realWidth = get2Fold(bufferedImage.getWidth());
int realHeight = get2Fold(bufferedImage.getHeight());


// don't need it?
texture.setBufferedImage(bufferedImage);
texture.setWidth(realWidth);
texture.setHeight(realHeight);

if (bufferedImage.getColorModel().hasAlpha()) {
srcPixelFormat = GL.GL_RGBA;
} else {
srcPixelFormat = GL.GL_RGB;
}

// convert that image into a byte buffer of texture data
ByteBuffer textureBuffer = convertImageData(bufferedImage,texture);
int wrapMode = wrap ? GL.GL_REPEAT : GL.GL_CLAMP;

if (target == GL.GL_TEXTURE_2D)
{
gl.glTexParameteri(target, GL.GL_TEXTURE_WRAP_S, wrapMode);
gl.glTexParameteri(target, GL.GL_TEXTURE_WRAP_T, wrapMode);
gl.glTexParameteri(target, GL.GL_TEXTURE_MIN_FILTER, minFilter);
gl.glTexParameteri(target, GL.GL_TEXTURE_MAG_FILTER, magFilter);
}

// create either a series of mipmaps of a single texture image based on what's loaded
if (mipmapped)
{
glu.gluBuild2DMipmaps(target,
dstPixelFormat,
realWidth,
realHeight,
srcPixelFormat,
GL.GL_UNSIGNED_BYTE,
textureBuffer);
}
else
{
gl.glTexImage2D(target, // GL.GL_TEXTURE_2D
0,
dstPixelFormat, //GL.GL_RGBA
realWidth,
realHeight,
0,
srcPixelFormat,
GL.GL_UNSIGNED_BYTE,
textureBuffer ); //bytebuffer
}
System.out.println("==> texture ?? ==> "+gl.glIsTexture(textureID));
return texture;
}


tankyou....
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Text rendering problem with VBOs on myfeng 9 5,949 Feb 29, 2008 04:54 PM
Last Post: OneSadCookie