opengl_graphics icon indicating copy to clipboard operation
opengl_graphics copied to clipboard

Move here GL init from window back-ends.

Open Potpourri opened this issue 10 years ago • 4 comments

See PistonDevelopers/window#56

  • [ ] Add second argument (&mut W where W: OpenGLWindow) to GlGraphics::new and add GL init inside it
  • [ ] Remove GL init from window back-ends:
    • [ ] sdl2_window
    • [ ] glfw_window
    • [ ] glutin_window

Potpourri avatar Apr 09 '15 21:04 Potpourri

There is a problem when you are using OpenGL for other things than 2D, or if you are using different shaders for 2D. I'd like to separate this step from the creation of Gl.

bvssvni avatar Apr 10 '15 19:04 bvssvni

I don't like run-time argument here, because:

  • you always know in advance
  • no need to link and compile multiple instances of gl-rs

kvark avatar Apr 10 '15 19:04 kvark

@kvark What do you mean with "run-time argument"?

bvssvni avatar Apr 10 '15 19:04 bvssvni

You proposed to add a switch to the WindowSettings here. This would be a run-time switch, so all the gl is still going to be linked and compiled. I vote for either removal, or making it a cargo configuration flag (compile switch).

kvark avatar Apr 10 '15 19:04 kvark