Is there an OpenGL based program that allows me to load up an image (.bmp, .png or .jpg) and draw it on that window? I have been searching hours and hours and the best I can find are programs that rotate the pictures in a circle, ofc I could modify the source code but these are old examples and would never compile, half of the functions used in them haven't existed in OpenGL for years.
Help? Where can I find this? Programming my own isn't option since I only know SDL and Allegro.
Anyone? Why is this such a hard task? Load up an image and draw it on the screen, c'mon.
Name:
Anonymous2011-08-04 21:29
Bueller? Bueller? Bueller?
Name:
Anonymous2011-08-04 21:35
read a book; fucking retarded;
Name:
Anonymous2011-08-04 21:39
You could find some sample code somewhere that loads a texture and then renders it on a quad (a rectangle if you aren't familiar with this stuff yet), and then have the quad sit in front of the camera and use the orthographic projection (just make it 2D like and such). It might be easier in SDL. As for loading the image from various formats, you should check out some libraries that can load that stuff. If you use OpenGL, it'll probably seem more complicated than it might need to be, but you could easily do a whole bunch of 3D stuff once it was working. What are you trying to do?
Name:
Anonymous2011-08-04 21:40
I think your typical second year computer programming major at San Francisco State University could do this in like 15 minutes.
Name:
Anonymous2011-08-04 22:50
nah, opengl is so shit it needs external libraries or over 9000 lines of code to load image files
There is no standard way to load an image from a file in OpenGL, you need to use something like libpng, libjpeg etc for that- then convert it to a representation usable by OpenGL (i.e.: RGBA).
To draw it on the window you need to set the projection matrix using glOrtho, and then draw a single quad which will be texture mapped to the previously created texture.
If you can't manage this I'm sorry but you are retarded; and should probably try Java instead.
Name:
Anonymous2011-08-05 3:17
>>13
fuck you faggot, that's no way to treat a newcomer you flaming butthole
If you don't want to use library to load image, then just use bmp image format. Sure the pictures take lot's of space, but even a newb can read the image data. Just google for bmp file structure.