PDA

View Full Version : glIsQuery bug?



Henry Holmes
06-02-2008, 04:21 PM
The following code always throws the assert on my machine:

glGenQueries(1,&queryId);
assert(glIsQuery(queryId));

If I remove the assert and go ahead and use queryId for occlusion queries, it works fine.
Am I misunderstanding glIsQuery, or is there a bug in my implementation of OpenGL / the occlusion query extensions?

Komat
06-03-2008, 01:44 AM
The glGenQueries allocates object identifiers for the queries. The identifiers are marked as allocated for purpose of glGenQueries() however real object is not associated with any identifier until glBeginQuery is called with that identifier. This is why the glIsQuery reported that there is no such object.

Zengar
06-03-2008, 01:59 AM
And don't use that glIs* functions, they are pointless (your app should know what is what). To be honest, all that Gen* functions are pointless too (never understood why one needs them if you can just use arbitrary numbers as object IDs).

Henry Holmes
06-03-2008, 03:49 PM
Is there a way of checking if you are out of queries?

arekkusu
06-03-2008, 11:04 PM
And don't use that glIs* functions, they are pointless (your app should know what is what). To be honest, all that Gen* functions are pointless too (never understood why one needs them if you can just use arbitrary numbers as object IDs).

Your app knows what it Gen'd. But the middleware that your app uses doesn't know.
And the System library that needs to look into your context doesn't know.

Zengar
06-04-2008, 12:45 AM
What is "System" library? And true, Gen* "may" be useful when you are working with plugin architecture/independent libraries and have to share list space with different independent modules (but who does it, anyway?)

V-man
06-04-2008, 05:53 PM
And don't use that glIs* functions, they are pointless (your app should know what is what). To be honest, all that Gen* functions are pointless too (never understood why one needs them if you can just use arbitrary numbers as object IDs).

I wouldn`t say Gen functions are not pointless. The driver would do a better job if Gen functions were inforced.
Also, if you want portability between OpenGL and OpenGL ES, you must use Gen functions.