PistonDevelopers/graphics

Is there a way to draw graphics to ImageBuffers or Textures?

radix opened this issue · 6 comments

radix commented

I haven't been able to find any obvious way to use graphics calls with ImageBuffers, but I may be missing some way to do it -- is it possible at all now?

If it's not, would it be a good idea to have an implementation of Graphics for ImageBuffer?

I've started working a software rasterizer that implements Graphics. Not sure about the design yet. Some issues:

  • Need a color buffer (rgba) and stencil buffer (u8)
  • Need to wrap image buffers in a new type that implements ImageSize

Should we do it with software? This is commonly achieved by a separate framebuffer; afaik gfx supports it from years ago.

I'd love to use this in an http server. Is that possible at the moment?

I believe it's possible, but it depends on the graphics backend.

Sorry for bringing this one up again, is there a relatively simple way to draw graphics (like a line) to a texture which later gets drawn to the window (eg. via draw_2d)?

@ivansandrk I think you need to configure OpenGL to use a texture for rendering.