Dimension dim = new Dimension(1024, 768);
minWidth = (int) dim.getWidth();
minHeight = (int) dim.getHeight();
camera = new Camera(dim);
GraphicsConfiguration gc = gd.getDefaultConfiguration();
bi = gc.createCompatibleImage(minWidth, minHeight);
if(g2d == null)
g2d = bi.createGraphics();
drawFrame(g2d);
Graphics2D g = (Graphics2D) buffer.getDrawGraphics();
//later this will be used for scaling purposes
if(fill)
g.drawImage(bi, 0, 0, sWidth, sHeight, 0, 0, minWidth, minHeight, null);
else
g.drawImage(bi, 0, 0, sWidth, sHeight, 0, 0, minWidth, minHeight, null);
g.dispose();
if(!buffer.contentsLost())
buffer.show();
Toolkit.getDefaultToolkit().sync();
if(screenShot) {
snap.takeScreenShot(bi);
screenShot = false;
}
the above code is from my game that DOES NOT use lwjgl/slick2d.
what i am trying to do in slick2d is set the displayMode to the users screen size and make it full screen but have the graphics object that is drawn onto be 1024x768, then depending on a boolean, either draw the image to the users screen size, draw to the highest resolution with the aspect ratio of 4:3, or draw the image in the center of the screen at 1024x768. so basically i need access to when the image is actually displayed on the screen if that makes any sense, just like how i have done it in the above snippet. when the game starts it made it full screen but created a compatible image of 1024x768 and i draw everything in the game to that image then just draw the whole image to the size of my screen. (I really hope this made sense)
I guess a better way of asking this question is, is there a way to setDisplayMode() to fullscreen but have all the graphics be drawn onto an image that is 1024x768, then depending on an option either scale the image to fullscreen, scale it as big as a can keeping the aspect ratio, or centering the image and keeping the original size?
NOTE: I do not want to change the users screen resolution.