Skip to main content
gamedev.net
🔒 Locked

glGetQueryivARB

Started by Tree Penguin Jan 23, 2005 at 1:57 PM 5 replies 1.9k views
Original Post
Tree Penguin
Tree Penguin
void glGetQueryiv(GLenum target, GLenum pname, GLint *params) const; What does the 'pname' argument do and what value should it have? Thanks
stephanh
stephanh
Its all in the spec:

http://oss.sgi.com/projects/ogl-sample/registry/ARB/occlusion_query.txt

Accepted by the parameter of BeginQueryARB, EndQueryARB,
and GetQueryivARB:

SAMPLES_PASSED_ARB

Accepted by the parameter of GetQueryivARB:

QUERY_COUNTER_BITS_ARB
CURRENT_QUERY_ARB




void GetQueryivARB(enum target, enum pname, int *params);

If is CURRENT_QUERY_ARB, the name of the currently active
query for , or zero if no query is active, will be placed in
.

If is QUERY_COUNTER_BITS_ARB, the number of bits in the counter for
will be placed in . The minimum number of query counter
bits allowed is a function of the implementation's maximum viewport
dimensions (MAX_VIEWPORT_DIMS). If the counter is non-zero, then the
counter must be able to represent at least two overdraws for every pixel
in the viewport using only one sample buffer. The formula to compute the
allowable minimum value is below (where n is the minimum number of bits):

n = (min (32, ceil (log2 (maxViewportWidth x maxViewportHeight x 2) ) ) ) or
0

If the value of n is 0, then the result from GetQueryiv(SAMPLES_PASSED_ARB)
will always return 0,
Tree Penguin
Tree Penguin
Ok, thanks, i seem to have read the old spec then (it had only 2 arguments in that spec).
Tree Penguin
Tree Penguin
What library should the functions be in?

I linked these libraries:
opengl32.lib
glu32.lib
glut32.lib
glaux.lib
I added those but still doesn't work:
glew32.lib
glew32s.lib

But the compiler still says it cannot resolve them (_glGetQueryObjectuivARB@12,_glGetQueryObjectivARB@12,_glEndQueryARB@4 and a few others).
_DarkWIng_
_DarkWIng_
It's part of ARB_occlusion_query extension so you need some kind of extension mechanizem to load it (assuming your HW supports it). I sugest you use a library for it. I prefer GLee for this job.
You should never let your fears become the boundaries of your dreams.
Tree Penguin
Tree Penguin
I found a library i used a while ago, glew.

I now get no errors but the application hangs at the
glEndQueryARB(GL_SAMPLES_PASSED_ARB);
line, any idea how it's caused and how i can fix it?

Thanks

I got an NV 6800 GT btw, so hardware is not the problem.


I tried executing the example that comes with the nvsdb 8.5 and that one also crashes. I also have the latest drivers.

[Edited by - Tree Penguin on January 23, 2005 5:43:10 PM]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.