Is there a way to load openGL textures for mapping in Delphi without using any external libraries (like glaux or any other) ? I searched around the internet, but couldn't find any source code particularly for Delphi.
Asked
Active
Viewed 770 times
0
-
3The [top Google result for "load opengl texture mapping delphi"](http://www.sulaco.co.za/opengl_project_BMP_JPG_TGA_texture_loader.htm) besides this page seems to include code for loading bitmaps and JPEGs, and it doesn't look like it uses any external libraries, aside from the OpenGL unit itself. – Rob Kennedy Mar 17 '14 at 18:38
-
Ahh, thank you very much. Somehow had missed this one. – Andris Gauračs Mar 17 '14 at 18:40
-
see [opening image file on c++ , PNG , JPEG](https://stackoverflow.com/a/37340970/2521214) ignore extensions: `*.sgi,*.rgb,*.dds,*.png` (as you do not have the code behind it) but the rest will work (jpg is in `#include
` bmp is native VCL and pcx decoder is in the example) the code will load/decode image into 32bit bitmap. That can be used to load as texture just copy its content `bmp->ScanLine[0..bmp->Height-1][0..bmp->Width-1]` to 1D array of `DWORD` and copy to OpenGL (that is how I do it) – Spektre Aug 24 '17 at 17:35 -
See [Applying map of the earth texture a Sphere](https://stackoverflow.com/a/31804515/2521214) for C++/VCL example of this just port to pascal ... – Spektre Aug 24 '17 at 17:42