Sorry for all the dumb Ofelia questions.
ofelia d;
M.img = ofImage();
M.img:allocate(10, 10, OF_IMAGE_COLOR);
for i = 0, 99, 1 do;
M.img:setColor(i*3, ofColor(i));
end;
M.img:update();
print("color at 99", M.img:getColor(99*3):getHex() & 255);
function M.bang();
M.img:bind();
ofDrawRectangle(-50, -50, 100, 100);
M.img:unbind();
end;
It prints "color at 99 99"... but the entire rectangle displays only the color at index 0. (If I change it to ofColor(i+100)
then it displays a rectangle with gray=100.) There is NO texture mapping
How does the ofImage contain valid pixel data but 'bind' then doesn't actually bind?
Edit: Attaching a patch that demos the problem without any abstractions. imgtest.zip
Edit: M.img:getTexture():bind()
doesn't help.
hjh