I setup my OpenGL viewport via

    ViewPort( 0,0,WindowW, WindowH )
    MatrixMode( Projection )
    MaxY = ClipNear * Tan(FieldOfView * 0.00872664626)
    MaxX = MaxY * Ratio
    Frustrum(-MaxX ,MaxX ,-MaxY ,MaxY ,ClipNear ,ClipFar)

Then I add rotation and move the Camera accordingly


However the center of the frustrum is not the middle of the Window. It is slightly right and up in the window.

I'm sure there is a bug in my code but I can't seem to find it. I have checked every place I could think of.

The bug could be caused by setting a wrong viewport however that doesn't seem to be the case as a similar Project (however not using modular code) works fine with the same viewport settings.

The bug could also be caused by setting a wrong Frustrum. However that also works in the other project.

Aside from that I do not know of anything that could cause this.

As my Code is written in a rather weird language posting it here wouldn't do any good.

So my question is what kind of mistake/bug can cause a behaviour like that.


It turns out that my Window had the wrong size. Background: I use a full screen Window that simply has no border. I set the size of that Window to the Screen Resolution. Now the problematic part: While the size of the Window is respecting DPI the resolution returned doesn't which lead to a window thats too large.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .