Texture engine problem....

I’ developing my own 3d engine, all work well, but i have a probem.
In this engine, i vae a layer named textureEngine.
This part of framework manage the thexture.
When one object is loaded i create a texture from a file, and whe i have loaded texfile in ram i generate the texture.
Every call in textureengine call the api texGen(1,short).
the only texture i can see whell is the last i generate.
It will work well if i load al texture at once with textGen(N° text,short[])

Thanks in advanced

I think you allready solved your own question…