Simple image drawing with OpenGL

Feeling useless here. I’m trying to put together the pieces from the OpenGL demos to simply draw a background image from a PNG file. Naturally, all I’m getting is a black rectangle and memory leaks.

Can some paste in here the minimum required code based on OpenGLDemo2D, so the selection box will have an option to use an image from binary data?

And if the answer is “its really not that simple”, that would make me feel a whole lot better.