Occlusion Query - INVALIDENUM

What could be wrong with this? Passing a value of GL_SAMPLES_PASSED as target to the glBeginQuery results in invalid enum error, and the program crashes.

I’m using ATI Radeon 9250 OpenGL 1.3.x wit the latest drivers.

Thanks.

Was GL_SAMPLES_PASSED defined as 0x8914 ? Based on the spec, your code should work.

Yes it is. But it does not work. Is it possible a driver bug?

Could it be the way is it used? or the driver is buggy?

Show the whole thing.

EDIT: Didn’t see it the time I wrote: you have only GL 1.3. Did you ensure that extension is really supported ? OQ should be available on GL 1.5 only if I’m not wrong:

Dependencies

Written based on the wording of the OpenGL 1.4 specification.

Yes I have checked the extnsions. It’s supported and I could get all the ARB functions required.

Then how come it reports an OpenGL error if it were not exist?

Anyway I’m suspecting the driver it does not work well on old Radeon 9250.

Would it be possible to run the _FullDebug profile of GLIntercept http://glintercept.nutty.org/ on this and post the gliLog.txt and the function call log somewhere?

The log file of no use! It only lists the loged gl funcs.

I tried the glDebuger but the program still crashes and could not detect the reason why glBeginQuery is not working.

Show your whole code

I tried the NV occlusion query extention instead, and it worked very well. It seems that the ARB ext does not work/not implemented accurately under OGL 1.3.x

Thus I can rely on NV extension instead. Yeeeheee!