How to texture files which do not have height /width thats a power of 2
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
Generate mipmaps for that texture with gluBuild2DMipmaps() :
Documents [ GDNet | MSDN | STL | OpenGL | Formats | RTFM | Asking Smart Questions ]
C++ Stuff [ MinGW | Loki | SDL | Boost. | STLport | FLTK | ACCU Recommended Books ]
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 ]
The only way to display it as is without stretching/shrinking is to break it up into power of 2 chunks.
Only DirectDraw can avoid that annoyance.
Ben
IcarusIndie.com [ The Rabbit Hole | The Labyrinth | DevZone | Gang Wars | The Wall | Hosting | Dot Com | GameShot ]
Only DirectDraw can avoid that annoyance.
Ben
IcarusIndie.com [ The Rabbit Hole | The Labyrinth | DevZone | Gang Wars | The Wall | Hosting | Dot Com | GameShot ]
quote:Original post by KalvinB
Only DirectDraw can avoid that annoyance.
DirectDraw ? In OpenGL ? On Linux ? ...
Documents [ GDNet | MSDN | STL | OpenGL | Formats | RTFM | Asking Smart Questions ]
C++ Stuff [ MinGW | Loki | SDL | Boost. | STLport | FLTK | ACCU Recommended Books ]
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!!!!!
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!!!!!
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 ]
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 ]
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!
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!
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
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
*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]
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]
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!
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!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement