Window dimensions on ATI and nVidia

Started by
5 comments, last by limpacp 17 years, 5 months ago
My app is 800x600, so when i'm creating window i'm doing next: RECT rect = { 0, 0, 800, 600 }; AdjustWindowRectEx( &rect, WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX|WS_VISIBLE ,FALSE, 0L); CreateWindowEx(..., ... rect.right-rect.left, rect.bottom-rect.top, ... ); then i'm creating directx device etc... so on my ATi x800 the game looks fine. Used D3DTEXF_POINT for min mag and mip filter. All game gfx shown clear and nice. But when i've tryed to run this game on other PCs with nVidia card, all gfx are looking stretched. Especially fonts are looking stretched. I can't find any ways to run my game on both ATi and nVidia cards equally. Please help, thanks in advance.
Advertisement
Quote:
RECT rect = { 0, 0, 800, 600 };AdjustWindowRectEx( &rect, WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX|WS_VISIBLE ,FALSE, 0L);CreateWindowEx(..., ... rect.right-rect.left, rect.bottom-rect.top, ... );


These window creation OS calls are placed prior to initialization of OpenGL/Direct3D. At this moment, your app doesn't even have a clue that you're going to use a graphics API and not a single call has been made to the hardware driver. So your app can not actually differentiate between an nVidia/ATI card. Maybe you could post some code/screenshots to clear things up.
I've post this code, because i think the problem was in calculating the right window box dimensions. I will post some screenshots at monday, currently i haven't any nVidia PCs near.
Hi,

Are you using the D3DX texture loading functions? I've heard of situations where they resize the input textures to make them square - this would certainly make things look stretched. What are the dimensions of your textures? Perhaps this is something that happens on NVidia parts rather than ATI ones.

stoo
First i'm loading image data into memory, then creating textures (size is power of 2), then copy image data to texture.
I'm trying to say that they looks like stretched ony by 1 pixel.
For example texture size is 10x10, but renderes like 11x11 or 9x9 and only on nvidia.

Thanks!

A screenshot would certainly help here, but i'm wondering if perhaps you're seeing the side effects of D3D's (crazy) texel-center texture addressing? Are you offseting all your texture coordinates by half a texel? e.g. instead of top-left=<32, 32> you should have top-left=<31.5, 31.5> etc? Do a search for "Directly Mapping Texels to Pixels" in the Direct SDK docs to read up on the reasoning behind this.

In the past (and maybe even now), card vendors would allow the user to set the texel offset - perhaps your ATI system is set to address textures at the texel edge rather than the texel center?

stoo
Stuart Yarham, you were right! I've missed this things about texture coordinates offset by a half texel. Now it looks equally on both ATi and nVidia cards.

Thanks!

This topic is closed to new replies.

Advertisement