In C++ OpenGL, I want to draw each pixel manually (as a texture I assume) on to a simple square primitive, or indeed 2 polygons forming a square.
I have no idea where to start, or what phrases to look for. Am I looking for texture mapping or creating textures? Most examples are to load from a file, but I dont want to do that.
I’ve tried reading my OpenGL Programming Guide book, but its just a maze as I’m quite new to OpenGL. Please help.
Take a close look at glTexImage2D. This is the call that loads the image in OpenGL for a 2D Texture.
glTexImage2D actually takes a raw pointer to the pixel data in the image. You can allocate memory yourself, and set the image data directly (however you want), then call this function to pass the image to OpenGL.
Once you’ve created the texture, you can bind it to the state so that your triangles use that texture.
There is nothing in OpenGL that directly requires images used as textures to be loaded from files. A good resource for textures can be found in this GameDev article.