I’m seeing what I consider an odd difference when it comes to coordinates on android vs my pc. I’m mostly an SDL noob, so I’m hoping this is something simple. I’m doing some very basic collision detection in the Y direction. I have two rect’s falling (dillo1 & dillo2), and I stop updating their position when they ‘collide’ with the static rect (ground1). Here’s the basic code:
When I compile and run this on my PC, it works fine (the moving rect’s stop when the bottom of them hit the top of the static rect). I’d show you, but I only can embed one media item in my post since I’m a new user. I’ll embed the android one that isn’t working as I’d expect.
So when I run the same code on my Samsung Galaxy S9, this happens:
As you can see, there’s 2 ‘dillo’ lengths between the bottom of them and the top of the ground. When I change the code to this (just switching + to -):
It works as I’d expect on Android, but not on PC. Other than the cpp code, I’m using the out of the box android project that comes with the SDL source code. I’m sure I’m missing something simple here, but can’t seem to figure it out when googling around. Any thoughts or pointers would be appreciated.
Sounds like the coordinate system origin is different on your Android device vs PC.
It should be the top left on both, but seems like it’s at the bottom left on your device when rotated that way. What happens when you rotate it to landscape the opposite direction?
so the app would startup in the different orientations. This did not help either. Is there a different way I could/should specify landscape mode? And for what reasons could software rendering vs accelerated rendering throw off the coordinate system?