I'm having an odd issue with my animation that is happening only on OSX, and not on windows. On my windows computer, the animation occurs full screen in a JFrame, as it is supposed to - however on my mac the animations are only drawn in the lower left corner:
Windows:
OSX:
Here is the code that I use to create the window, and draw the frame (Same on both computers):
public class AnimationMain extends JFrame implements Runnable{
BufferStrategy bs;
/**
* Initializes the properties of the JFrame that we are drawing on
*/
public void init(){
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setTitle("Final Project V2");
this.setSize(7*128, 5*128);
this.setResizable(false);
this.setVisible(true);
createBufferStrategy(3);
bs = getBufferStrategy();
}
/**
* Calls out to a drawing method, which simply draws everything on the screen
* @param g
*/
public void draw(Graphics2D g){
if (GMI.gameState.equals(GameState.PLAYING) && GMI.gameReady){
AnimationManagement.MainGameDisplay.drawMainGame(this, g);
}
}
/**
* Calls the init method, and then repaints the frame
*/
public void run() {
init();
while (true){
Graphics2D g = (Graphics2D) bs.getDrawGraphics();
draw(g);
g.dispose();
bs.show();
try{Thread.sleep(AppInfo.frameTime);}catch(Exception e){e.printStackTrace();} //Sleep for 10ms between redraws
}
}
Any help would be greatly appreciated, thanks!