Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

How to texture files which do not have height /width thats a power of 2

This topic is 5708 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

i want to create texture from a bmp file with resolution 800x600.I I do not want to strech or shrink the resolution ..ie i want to display it as it is. Is there a way to do it?If yes,PLz tell me . note:I am working on Linux for this project. Any help will be appreciated and will be thankful to u all my life

Share this post


Link to post
Share on other sites
Advertisement
Generate mipmaps for that texture with gluBuild2DMipmaps() :

quote:
Red Book, p 385
"If your original has dimensions that are not exact powers of 2, gluBuild*DMipmaps() helpfully scales the image to the nearest power of 2. Also if your texture is too large, gluBuild*DMipmaps reduces the size of the image until it fits".


Documents [ GDNet | MSDN | STL | OpenGL | Formats | RTFM | Asking Smart Questions ]
C++ Stuff [ MinGW | Loki | SDL | Boost. | STLport | FLTK | ACCU Recommended Books ]

Share this post


Link to post
Share on other sites
well i donot know what i Direct Draw .
And not have mip mapping convert it into the nearest power of 2.
Any other way out like loading the bmp file on the screen???
HELP!!!!!

Share this post


Link to post
Share on other sites
glDrawPixels can render a chunk of memory to the screen, if that''s all you want to do. It will be slow though. But if you want a texture, there is no other way... and don''t dismiss the solution I gave you before even trying it.

As for DirectDraw, it is Windows+DirectX only, hence my comment.

Documents [ GDNet | MSDN | STL | OpenGL | Formats | RTFM | Asking Smart Questions ]
C++ Stuff [ MinGW | Loki | SDL | Boost. | STLport | FLTK | ACCU Recommended Books ]

Share this post


Link to post
Share on other sites
I believe that there''s actually an OpenGL extension you can enable which will allow you to use textures whose heights and/or widths are not powers of two. I''m not sure of it''s name, though. Anyone else know?

You might want to try searching for it here: http://oss.sgi.com/projects/ogl-sample/registry/. This is list of all the OpenGL extensions currently available, maintained by SGI. Have a look through (although there are about 300 of them...sorry )


Movie Quote of the Week:

"You''ve been eating retard sandwiches again."
- Birdman, Beautiful Girls.
Try http://uk.geocities.com/mentalmantle. Seriously. It''s brilliant.
And I just completely redesigned it so it looks even better.
DarkVertex Beta 0.8 available soon!

Share this post


Link to post
Share on other sites
Hey my requirements are very stringent in terms of shrinking/streching because this is being developed for a Physcology experiment and they want to track the exact position of the eye for a picture which is displayed full screen.
I am trying glDrawPixels..but if u have sum code that reads bmp and dumps its pixel info on the screen it will be great

thanks a lot for your Help

Share this post


Link to post
Share on other sites
*sigh* Mipmapping fits the requirements. Which you would realise if you would only read the *censored* manual, or even done a quick search on the concept.

Get your psychology department to buy you a copy if you can't afford it yourself.

As to sharing code, I don't see why I should bother when you're not even doing your share of the research work.

Documents [ GDNet | MSDN | STL | OpenGL | Formats | RTFM | Asking Smart Questions ]
C++ Stuff [ MinGW | Loki | SDL | Boost. | STLport | FLTK | ACCU Recommended Books ]


[edited by - Fruny on October 3, 2002 3:47:04 PM]

Share this post


Link to post
Share on other sites
Well, glDrawPixels would seem to be the only answer then, if you have to have the exact image you load on the screen.
Mipmapping will distort the image or shrink it (most systems can''t handle textures over 512x512). Either way, you''ll lose pixels...

Look up glReadPixels in the Red Book...


Movie Quote of the Week:

"You''ve been eating retard sandwiches again."
- Birdman, Beautiful Girls.
Try http://uk.geocities.com/mentalmantle. Seriously. It''s brilliant.
And I just completely redesigned it so it looks even better.
DarkVertex Beta 0.8 available soon!

Share this post


Link to post
Share on other sites

  • 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!