Problem with opengl (es) in android ndk: viewport

The Partridge Family were neither partridges nor a family. Discuss.
Post Reply
Florian3321
Posts: 27
Joined: February 12th, 2017, 1:50 pm

Problem with opengl (es) in android ndk: viewport

Post by Florian3321 » September 14th, 2018, 5:37 pm

Hi there!
For weeks, I have a problem and I do not know how to fix it. Now I hope someone of you can help me. I try to have a "game world" which has a certain dimension and then scale that up to the android device size (while keeping the aspect ratio). The x Axis works fine, but the y Axis is false (its longer than it should be). I do not know what I am doing wrong. Its quite a large project. The files that (should) matter are RenderWindow, View and Sprite and maybe RenderTexture. I would really appreciate if someone has and takes the time to help me.
Here is the link to the github repo. To run it, you need vs 2017 and the "Mobile-Development with C++" which you can install under the visual studio installer.
https://github.com/florianPat/AndroidEngine
Thanks in advance!!

Florian3321
Posts: 27
Joined: February 12th, 2017, 1:50 pm

Re: Problem with opengl (es) in android ndk: viewport

Post by Florian3321 » September 14th, 2018, 5:39 pm

I think it has to do with the glViewport call in RenderWindow or RenderTexture or the orthographic projection matrix in View.
Thanks again for any replies!

Florian3321
Posts: 27
Joined: February 12th, 2017, 1:50 pm

Re: Problem with opengl (es) in android ndk: viewport

Post by Florian3321 » September 29th, 2018, 3:09 pm

Fixed the problem myself now ;)
If someone is interested: Typo. I wrote width instead of height :/

Post Reply