Jump to content
  • Advertisement
Sign in to follow this  
hayden

OpenGL How to check in my graphics card...?

This topic is 3501 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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 :)

Share this post


Link to post
Share on other sites
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 );

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!