Search code examples
openglcolorstexturesopengl-4

Is there an OpenGL function to reset a texture to a solid color?


Is there a way to initialize or reset an OpenGL texture with a solid color? I can use functions up to OpenGL 4.0 since I'd like to support notebook's Intel HD Graphics 4000.


Solution

  • Maybe you can use a framebuffer. You can link it with a texture and draw what you want on the framebuffer. If the fallback is in action, you clear the framebuffer to a color you want.

    And then you draw the framebuffer as texture.