Strange behavior when running irrlicht at lo-res
Posted: Sat Jul 09, 2016 11:06 am
TL;Didn't read
I can't create a window that is small like 80x80 or anything in that range or smaller apparently does set the y axis as I ask it to but it doesn't set the x axis smaller than some value. Why is that? Can I still do it in some other way?
TL;Don't read
When I set resolution dimensions of device below some point, 80x80 for example
then take screenshots in the game like this
Where
and then recover image in Matlab
I can't recover the image since it has more pixels on the x axis than what I set it to be, 80.

I can't create a window that is small like 80x80 or anything in that range or smaller apparently does set the y axis as I ask it to but it doesn't set the x axis smaller than some value. Why is that? Can I still do it in some other way?
TL;Don't read
When I set resolution dimensions of device below some point, 80x80 for example
Code: Select all
const int X = 80;
IrrlichtDevice *device =
createDevice(driverType, core::dimension2d<u32>(X,X), 32, false);
Code: Select all
video::IImage *screenShot = driver->createScreenShot();
const uint8_t *source = (uint8_t*)screenShot->lock();
saveSource(source, X);
screenShot->drop();
Code: Select all
void saveSource(const uint8_t *source, const int X)
{
int xx;
int yy;
std::ofstream myfile(".../Source.txt");
for (int c = 0; c < X * X; c++)
{
yy = c / X;
xx = c - (c / X) * X;
myfile << (float) source[4*(X*xx + yy)] << std::endl; // [4*(128*xx + yy)]
}
myfile.close();
print("saved!")
}
Code: Select all
load('Source.txt')
V = reshape(Source,[80,80]);
imagesc(V)
