Nez: free, open source 2D framework

It seems to be a bug or incompatibility with FNA (17.05). Somewhere a value is off by one, I’ve printed the usual suspects from FNA but the values are consistent, at least with the window and framebuffer dimensions. Anyway, I managed to workaround that with a quick hack:

On ECS/Camera.cs, add the following lines before the inverse transform matrix calculation (around L330):

float offX = Core.graphicsDevice.Viewport.Width / (Core.graphicsDevice.Viewport.Width-1f);
float offY = Core.graphicsDevice.Viewport.Height / (Core.graphicsDevice.Viewport.Height-1f);
_transformMatrix *= Matrix2D.createScale(offX, offY);

On ECS/Scene.cs modify the following lines to read as follows (around L557):

var renderTargetWidth = screenSize.X-1;
var renderTargetHeight = screenSize.Y-1;

That’s it!

On a related note, I’m really enjoying Nez, really well-made gamedev library! The other questions are still valid though :slight_smile:

EDIT: Also, this question may sound ridiculous… but how do I enable vsync? =/