View Full Version : Very Urgent : Rendering image wihtout using DIB in openGL

vijaykumar katkar
01-24-2005, 04:28 AM
I have image information (pixels, color, depth, etc)in the ASCII file. I wanted to display image in the openGL without creating bitmap (BMP) fle using the ASCII file. I dont want to use CreateDIBSection function. I want to read the text file directly to create the image in OpenGL. Is it possible in OpenGL and how? i.e. Can we write directly to openGL frame buffer? Is there any sample code available? please help me .....

01-24-2005, 05:12 AM
You would have to load data yourself from the file into a buffer which you will pass to (If you have simple binary data, you can use glBitmap for that, or if you have rgb values, use glDrawPixel for it.)Look up the definitions in the specs. If its unclear, lt me know your image format and I will try to code it out for you.

01-24-2005, 12:54 PM
Well you would have to traslate that to a sequence of bytes that OpenGL can understand. Then it's only a call to glTexImage2D. It accepts, among others, a pointer to unsigned char that holds the image data.