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 …
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.
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.