Original Post
Hi there, I'm developing a 2D Game Engine, which is currently using GDI to draw, but I want to use OpenGL. So far, I've been sucessful in drawing shapes to the screen ( by adding code to my engine's GDI-based functions that replaces GDI calls with OpenGL calls ), and I've come to the point where I need to precache an image. I know how to precache images as textures, but the thing is, the images aren't always precached at once. The GDI version simply retrieves an HBITMAP and places it within a vector, so it can be drawn by giving a supplied handle. However, if I'm not mistaken, OpenGL wants me to precache all textures at once, after calling glGenTextures or something of the sort. I can't do this, as it would destroy the engine's functionality. The current GDI function loads in the image to an IPicture, then into a DDB HBITMAP, which is stored in a vector, and then the drawing function cross-references the handle with another vector of handles, which allows the drawing function to access the HBITMAP. Using OpenGL, how can I have the precaching function work without destroying already precached images ( since images can be precached at anytime by the client-game ) ? Thanks, The Imaginate