Update on the fullscreen issue:
I was having problems even with 640x480 originally (as in not drawing the entire screen, I'm not sure why). I reinstalled my video drivers and now it's working with 640x480. I tried again with 256x240 and got the same issue of not using the entire screen. So Mikhail9 was correct, thanks for the help.
Hendu, I'm assuming you mean something like this?
I have 2 cubes active in my scene right now (I don't have a 3D modeling tool so I'm using addCubeSceneNode and scaling them to the size I want.) But I'm a bit confused about the specific details.
My first cube is the background image:
Code: Select all
ISceneNode * mapN = scene->addCubeSceneNode( 1.0F );
mapN->setScale( vector3df( 640.0F, 480.0F, 1.0F ) );
mapN->setPosition( vector3d<f32>(0,0,1) );
I've created a cube, scaled it to a window resolution (640x480) and pushed it 1 unit back to compenstate for the Z sticking out 1 unit so that the node face is aligned at Z = 0.
Next I have a cube created for the 'hero' running around the map scaled at 32x32
Code: Select all
ISceneNode * heroN = scene->addCubeSceneNode( 1.0F );
heroN->setScale( vector3d<f32>( 32.0f, 32.0f, 1.0f ) );
heroN->setPosition( vector3d<f32>(0,0,1) );
The binlinear filtering is disabled on both meshes to keep the sharp pixels.
As it is now 1 image pixel = 1 irrlicht pixel ( the images I used were 16x16 that I scaled up myself to 32x32 ). However I'm not entirely sure how to align the camera to always match this. At first I positioned the camera at -640 units on the Z axis, and I get something like this:
Code: Select all
camera->setPosition( vector3d<f32>(0,0,-640.0F) );
camera->setTarget( vector3d<f32>(0,0,0) );
So I figured if I divided it in half I'd get the correct pixel ratio, but it's still not fine:
Code: Select all
camera->setPosition( vector3d<f32>(0,0,-320.0F) );
camera->setTarget( vector3d<f32>(0,0,0) );
Confused I just randomly pushed the camera back 10 units and this gives me a result in the first screenshots.
I'm guessing this may have something to do with the perspective of the camera? Or I'm not sure about the mathematics behind the positioning.