Persistant rendering hints?

Hey,

How can I set my rendering hints to be persistent? As in, I want to set them once when I call buffer.getDrawGraphics() and then for all subsequent calls to getDrawGraphics() I want the rendering hints to persist.

Or will I have to make a function that takes a Graphics2D object and then sets the rendering hints on it? Or some third way? I’ve tried with just passing the same Graphics2D object around, but that somehow broke my fullscreen. :confused:

Here’s how my rendering loop looks:


do {
	do {
		Graphics2D g = (Graphics2D) this.gameWindow.buffer.getDrawGraphics();
		ScreenManager.render(g);
		g.dispose();
	} while (strategy.contentsRestored());
	strategy.show();
} while (strategy.contentsLost());

I just had it so in my begin() method which sets up stuff so I can render, I would set all current rendering hints.

There is this

http://docs.oracle.com/javase/6/docs/technotes/guides/2d/flags.html#aaFonts

But that is only for text I think.

You might be able to set it in the creation of a window/canvas but I have not tried.

You can’t. Replace


		Graphics2D g = (Graphics2D) this.gameWindow.buffer.getDrawGraphics();

with a call to a method which gets the graphics and sets the hints on it.

… Wow… That was a bloody simple fix. Why on earth didn’t I think of that? -.-

Well, thanks for the help, both of you. :slight_smile: