Board index » cppbuilder » Accessing .bmp files via OpenGL (Newbie)

Accessing .bmp files via OpenGL (Newbie)

I am attempting to load a bitmap then convert it into a texture. This is
during a bit of OpenGL coding. The compiler reports "Unresolved external
'auxDIBImageLoadA' referenced from \PROJECT1.OBJ.  I believe the code I am
using is for Visual C++. Can anyone help me put a texture on my poor {*word*192}
polygons.

Many thanks,  David.

 

Re:Accessing .bmp files via OpenGL (Newbie)


To load a bitmap:
Graphics::TBitmap bitmap = new Graphics::TBitmap();
bitmap->LoadFromFile("Apple.bmp");

To access a pixel at (3,4):
int Color;
Color = (int) bitmap->Canvas->Pixels[3,4];

To provide a texture in OpenGL, you can
create an array of GLuint.
static GLuint texture[64][64];

Re:Accessing .bmp files via OpenGL (Newbie)


Canvas->Pixels is VERY VERY slow, use Scanline instead of it.

Lev

Claude Glauser schrieb:

Quote
> To load a bitmap:
> Graphics::TBitmap bitmap = new Graphics::TBitmap();
> bitmap->LoadFromFile("Apple.bmp");

> To access a pixel at (3,4):
> int Color;
> Color = (int) bitmap->Canvas->Pixels[3,4];

> To provide a texture in OpenGL, you can
> create an array of GLuint.
> static GLuint texture[64][64];

Other Threads