Multisampling?

Started by elias4444, January 28, 2005, 18:55:47

Previous topic - Next topic

elias4444

I brought this up in the OpenGL group, but haven't found an answer yet. How does one enable multisampling using lwjgl? I can't find any tutorials or information on it anywhere.
=-=-=-=-=-======-=-=-=-=-=-
http://www.tommytwisters.com

Matzon

set a value (>0) in the samples parameter in the Display.create method

Fool Running

Multisampling needs to be done at the Display creation by setting the samples parameter in PixelFormat to more than zero.  (you need to then give that PixelFormat to the Display.create() method, of course)

I think that's right, at any rate  :lol:

EDIT: Dah! how did you beat me!?!?!?!   :shock:
Programmers will, one day, rule the world... and the world won't notice until its too late.Just testing the marquee option ;D

elias4444

Please forgive my "n00bness" but after trying this for a while, I'm not seeing how to fit this into my autodetect-supported-formats loop:

DisplayMode modes[] = Display.getAvailableDisplayModes();
boolean modeFound = false;
for (int i = 0; i < modes.length; i++) {
	if (modes[i].getWidth() == WIDTH && 
			modes[i].getHeight() == HEIGHT && 
			modes[i].getBitsPerPixel() == displayBPP) {
		modeFound = true;
		Display.setDisplayMode(modes[i]);
		break;
	}
}


Is there a way to detect supported PixelFormats on a machine? I've tried passing different numbers into the PixelFormat() constructor, but nothing seems to work. I've tried PixelFormat(0,8,0,1), PixelFormat(8,24,0,1), PixelFormat(0,8,0,8 ), etc.. All of them come back with a "Could not find a suitable ARB pixel format."
=-=-=-=-=-======-=-=-=-=-=-
http://www.tommytwisters.com