(01-17-2010 05:35 PM)Esenthel Wrote: It is suggested to use Material::methods and import images from non GFX images
however you can use just pointer assigning:
Image image;
Material material;
...
material.diffuse=ℑ
...
Thanks, sadly, I am still unable to figure this out..
Exporting and then loading doesn't seem to work (even when I save directly as GFX):
Code:
Image LandTex;
LandTex.create2D(128,128,IMAGE_A8R8G8B8,1);
LandTex.lock();
REPD(y,LandTex.y()){
REPD(x,LandTex.x()){
LandTex.color(x,y,Color(255,Random(255),Random(255),Random(255)));}}
LandTex.unlock();
LandTex.ExportJPG("LandTex.jpg");
Material Land;
Land.reset();
Land.importDetail("LandTex.jpg","LandTex.jpg","LandTex.jpg","");
Land.validate();
mesh.setMaterial(Land);
Pointing to the image creates a completely black landscape:
Code:
Image LandTex;
LandTex.create2D(128,128,IMAGE_A8R8G8B8,1);
LandTex.lock();
REPD(y,LandTex.y()){
REPD(x,LandTex.x()){
LandTex.color(x,y,Color(255,Random(255),Random(255),Random(255)));}}
LandTex.unlock();
Material Land;
Land.reset();
Land.diffuse = &LandTex;
Land.validate();
mesh.setMaterial(Land);
What am I missing?
Thanks for the help
Bah! How stupid, I forgot to make the Image global. That fixed the problem, using pointers now works flawlessly. That's all I needed.
Thanks for your help, and congratulations on a simply outstanding engine.
I look forward to purchasing a license in the near future