How to check in my graphics card...?

Started by
10 comments, last by hayden 15 years, 5 months ago
Hi, i'm programming an application in GLSL/OpenGL and i need to check if my graphics supports any resolution or if only supports width/height values as power of 2. How can i check this? I google searched it but i didn't found the answer... Sorry for the basic question :)
Advertisement
Texture resolution or screen resolution?

If you mean screen resolution, this is done through your operating system, or if you mean textures, you can get it with this:

 int gl_max_texture_size; glGetIntegerv( GL_MAX_TEXTURE_SIZE, &gl_max_texture_size );

I'm pretty sure most modern graphics cards only support textures with power of 2 sizes mainly because it means they can do a lot of optimisations.

Screen resolution is usually 16:9, 16:10 or 4:3 ratios, there is nothing to stop you creating a window of any width/height though.

Quote:Original post by Malal
I'm pretty sure most modern graphics cards only support textures with power of 2 sizes mainly because it means they can do a lot of optimisations.

Screen resolution is usually 16:9, 16:10 or 4:3 ratios, there is nothing to stop you creating a window of any width/height though.

If ARB_texture_non_power_of_two is supported, you can use textures of any dimensions (as long as they're below the max size samster581 posted) and they'll work just fine.

IIRC "proper" video cards have supported this for several years (back to nVidia's FX6xxx, and ATi's equivilent), not sure about those crappy intel chips though.

[Edited by - OrangyTang on November 19, 2008 11:49:06 AM]
Quote:Original post by samster581
Texture resolution or screen resolution?

If you mean screen resolution, this is done through your operating system, or if you mean textures, you can get it with this:

 int gl_max_texture_size; glGetIntegerv( GL_MAX_TEXTURE_SIZE, &gl_max_texture_size );


I forgot to specify that.. sorry :S

I was referring texture resolutions the graphics card supports.

I did what you suggest and it gave me the value of 1244396. This means i can use any texture resolution?
I stand corrected :P
ARB_texture_non_power_of_two has promoted to core since opengl 2.0.
From the OpenGL 2.0 Specification:
Quote:

I.3 Non-Power-Of-Two Textures


The restriction of textures to power-of-two dimensions has been relaxed for all texture targets, so that non-power-of-two textures may be specified without generating errors. Non-power-of-two textures was promoted from the ARB_texture_non_power_of_two extension.


Thus you can use non-power-of-two textures in opengl 2.0 or higher (check glGetString(GL_VERSION) ) or if ARB_texture_non_power_of_two is supported (GL_ARB_texture_non_power_of_two is included in the string returned glGetString(GL_EXTENSIONS) ).


Quote:Original post by hayden
I did what you suggest and it gave me the value of 1244396. This means i can use any texture resolution?


1) You should call glGetIntegerv after creating a valid opengl context, 1244396 is strange value, the max texture size is more likely something like 2048, 4096 or 8192.

2) No, Max texture size just tells you that the texture can not be larger than the maximum size in each dimension.
Quote:Original post by OrangyTang
IIRC "proper" video cards have supported this for several years (back to nVidia's FX5200, and ATi's equivilent), not sure about those crappy intel chips though.
My Intel X3100 works fine with non-power-of-2, even with the ghastly Apple drivers.

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

Quote:Original post by OrangyTang
IIRC "proper" video cards have supported this for several years (back to nVidia's FX5200, and ATi's equivilent), not sure about those crappy intel chips though.


Actually it started at the GeForce 6, on ATI i'm not pretty sure it started before the HD series.
Quote:Original post by hayden
I did what you suggest and it gave me the value of 1244396. This means i can use any texture resolution?


No, that can't be correct. You either got garbage back or you're not printing out the text correctly. You pass the address of an integer variable to that function.
You should get back a nice number like 1024, 2048 or 4096.

This topic is closed to new replies.

Advertisement