Irrlicht 2D drawing (bug?)
Irrlicht 2D drawing (bug?)
I've been using irrlicht version1.3.1, then 1.4b for my game, and both showed the following problem:
Any image that isn't 512x256 doesn't show up right (be it OpenGL or DirectX9...)
In this case I programmed a new game / load game / quit state, and used a random image to test it with.
Click here to see a proof
Has anyone experienced the same problem or knows how to fix this?
Thanks in advance.
Any image that isn't 512x256 doesn't show up right (be it OpenGL or DirectX9...)
In this case I programmed a new game / load game / quit state, and used a random image to test it with.
Click here to see a proof
Has anyone experienced the same problem or knows how to fix this?
Thanks in advance.
Code: Select all
ITexture *image = game->gDriver()->getTexture("this.jpg");
game->gDriver()->draw2DImage(image, position2d<s32>(0,0));
Code: Select all
IGUIImage *image;
image = game->gGuiEnv()->addImage(rect<s32>(0,0,800,600));
image->setImage(game->gDriver()->getTexture("this.jpg"));
One tip:
put your "draw" functions in loop so it renders every frame.
something like:
put your "draw" functions in loop so it renders every frame.
something like:
Code: Select all
while(device->run())
{
driver->beginScene(...);
driver->draw...();
driver->endScene(...);
}
It depends of gfx card. Does your card support "not power of two" texture?
Try to clear buffer with other color then black:
because i think irrlicht fills rest of the pixels black to accomodate texture
to be "power of two".
Try to clear buffer with other color then black:
Code: Select all
...driver->beginScene(true, true, RedColor);
to be "power of two".
You say it works only with 512x256, but what other resolutions you tried ???
I also think it's because of the 2^n thing...
I also think it's because of the 2^n thing...
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
I'm not surprised. Not a single one of these are a power-of-two in both directions. Plus, 513x257 and 299x116 are very strange sizes from a texture point of view.lawck wrote:800x600, 1024x768, 513x257, 299x116...
And I just tried 800x400.
The problem persists.
The one exception I've seen in an nvidia 8800 card which doesn't seem to care and will happily even mip weird sizes.
Irrlicht Demos: http://irrlicht.sourceforge.net/forum/viewtopic.php?f=6&t=45781
Right...
But even if your gfx card supports non-2^n textures you should always use dimensions in 2^n, because you can not assume that every user has such a gfx card, too !!!
But even if your gfx card supports non-2^n textures you should always use dimensions in 2^n, because you can not assume that every user has such a gfx card, too !!!
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Honestly, I'm having trouble reproducing this with the 1.4beta distribution. The following code correctly renders the given texture with its top-left corner placed at (0, 0).
I found that it doesn't work with the Apfelbaum [EDT_BURNINGSVIDEO] driver type, but it seems to work just fine with all of the others. You can see screenshots here.
Travis
Code: Select all
// image is 512x385
video::ITexture* t = driver->getTexture("../../media/dotnetback.jpg");
while(device->run())
if (device->isWindowActive())
{
if (driver->beginScene(true, true, video::SColor(0,200,200,200)))
{
smgr->drawAll();
driver->draw2DImage(t, core::position2di(0, 0));
driver->endScene();
}
}
Travis