View Single Post
Old 9th July 2011, 10:31   #4  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,431
Thanks for the new version, Youka.

Looking through the source code, I've spotted a minor efficiency glitch in GLWindow.cpp:
Code:
	valid = wglChoosePixelFormatARB(hdc, iAttributes, fAttributes, 1, &pformat, &num);
	if(!(valid && num >= 1))
		//8x AA
		iAttributes[23] = 8;
		valid = wglChoosePixelFormatARB(hdc, iAttributes, fAttributes, 1, &pformat, &num);
		if(!(valid && num >= 1))
			//4x AA
			iAttributes[23] = 4;
			valid = wglChoosePixelFormatARB(hdc, iAttributes, fAttributes, 1, &pformat, &num);
			if(!(valid && num >= 1))
				//2x AA
				iAttributes[23] = 2;
				wglChoosePixelFormatARB(hdc, iAttributes, fAttributes, 1, &pformat, &num);
Even if the first call to wglChoosePixelFormatARB (for 16x AA) succeeds, it is still called a further three times, because of a lack of {} on the 'if' statements. The indentation doesn't match what the code actually does.
__________________
GScript and GRunT - complex Avisynth scripting made easier

Last edited by Gavino; 9th July 2011 at 11:21. Reason: use narrower code window
Gavino is offline   Reply With Quote