I am trying to get my game to scroll as a player along the y axis and the x axis.
Currently the coordinate systems of the window is out. 🙁
I am using the following line in openGl to scroll:
float tempX=px1;
float tempY=py1;
double left = tempX-screenWidth/2;
double right = screenWidth/2+tempX;
double bottom = tempY - screenWidth/2 + 300;
double top = screenHeight/2+tempY+ 300;
//gluOrtho2D(0,screenWidth,0,screenHeight); (before scroll screen)
gluOrtho2D( left, right, bottom , top);
px1 and py1 relate to my player and are updated as the player moves.
Currently if you get the window and resize it while the game is running you can see the images resize and my code is wrong as a square is displayed as a rectangle.
Something like this?