Hello.
I have started to learn OpenGL in C/C++ and I want to use 2D graphics. My operating systems are Windows XP and Linux (Ubuntu).

How do I load a image from a file and draw it on screen?
My image files are png and jpg.

Can I write a text on screen with a font?

Thanks.

I don't know too much about OpenGL, but I do know that to display an image file, you'll need to read the file itself (meaning, you'll need to know the format of the image file, and it's encryption etc).

Sound difficult? Well it is. Luckily, the internet is always one step ahead. There's a free, public domain library just for this. It's called SOIL, and you can get it here: http://www.lonesock.net/soil.html

Edit: As for the text drawing thing, it is possible, but again I'm not too OpenGL savvy or I'd be of more help.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.