DGL https://delphigl.com/forum/ |
|
It is possible to convert a TBitmap to GLUInt? https://delphigl.com/forum/viewtopic.php?f=19&t=6362 |
Seite 1 von 1 |
Autor: | dpm_dpmartin [ Sa Feb 10, 2007 21:16 ] |
Betreff des Beitrags: | It is possible to convert a TBitmap to GLUInt? |
Is it relatively simple for me to convert a TBitmap to a GLUInt that can then be used as an OpenGL texture? I am OK with loading a BMP or JPG from either a file or a resource using LoadTexture and then glBindTexture. How would I go about the same, say, if my TBitmap was created at runtime? I saw NeHe's lesson 06, using auxDIBImageLoad - using GLAux I think? - anyway... it would be good to be able to do this. |
Autor: | Delphic [ So Feb 11, 2007 09:27 ] |
Betreff des Beitrags: | |
Being deprecated, you should avoid glAux. Instead the right functions to chose are gluBuild2DMipmaps for mipmapping or glTexImage for simpler textures (or if you are in need to build your mipmaps on your own). Have a look in their corresponding documentation for usage details. You will need to get the scanline data of your bitmap if it is actually stored as a TBitMap. As far as I remember you will need its Scan0 property and you are done but I'm not sure - haven't used delphi for a while. |
Seite 1 von 1 | Alle Zeiten sind UTC + 1 Stunde |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |