//////////// // global // GLuint tex; // texture object name int width=100, height=100; // image size (100x100) unsigned char* bitmapData; // image data ///////////////////// // pre-step (once) // // memory allocation on system memory (RGBA per pixel) bitmapData = new unsigned char[width*height*4]; // loading image data from a file LoadBitmapFromFile( bitmapData, "testImage.bmp" ); // 2D