fogleman / gg

Go Graphics - 2D rendering in Go with a simple API.
https://godoc.org/github.com/fogleman/gg
MIT License
4.37k stars 354 forks source link

Drawing directly in the screen #115

Open hasanAjsf opened 3 years ago

hasanAjsf commented 3 years ago

Hi, is there a way to draw directly on the screen/monitor instead of saving the drawing at file?

G2G2G2G commented 3 years ago

wondering this too, in the normal graphics library you set the header content type to the image and make a buffer and output the image through that buffer in the encode

can't see a way to do it with this library

haiitch commented 3 years ago

I've done it and it works, in my case using the raylib2 library.

You generate an off-screen image using gg, then upload it as a texture. It works very well for repetitive kinds of animation, if you upload an animated sequence of images as GPU textures and then display those in the intended sequence, similar to the effect of a looping GIF.

On Mon, 4 Jan 2021 at 03:12, G2G2G2G notifications@github.com wrote:

wondering this too, in the normal graphics library you set the header content type to the image and make a buffer and output the image through that buffer in the encode

can't see a way to do it with this library

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/fogleman/gg/issues/115#issuecomment-753778753, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAFXITLOP6AGE34CZUNR4TSYFL3NANCNFSM4TFIYUKA .

hasanAjsf commented 3 years ago

@haiitch can you show an example code pls.