Closed uberswe closed 4 years ago
So it looks like pixel is trying to create a glhf texture, which is in turn trying to create a GL texture, but because you don't have a window, OpenGL hasn't been initialized which I believe is causing the error you're seeing.
You could try creating the window with the 'Invisible' config option; though I'm not sure if that'll keep the update loop going (some will pause the input polling and drawing when the window is hidden, don't know about pixel).
If that doesn't work, you could try making a TransparentFramebuffer and Undecorated window; I think that'll result in a completely invisible (but still active) window.
Thanka @dusk125 the invisible flag worked like this
cfg := pixelgl.WindowConfig{
Title: "Window",
Bounds: pixel.R(0, 0, float64(resX), float64(resY)),
Invisible: true,
}
I know this might be an unusual use of pixel but I am trying to use pixel to make some basic videos as a hobby project. With this project I do not need a window and I would therefore like to only use a canvas to draw on. I would still like to use all of the methods available in pixel to generate the content for my video. Here is my full code which works:
However if I remove the first lines in the run function, specifically these lines
Then I get the following error:
I was wondering if this might be a bug or if it is expected? If it is expected I would appreciate some hints as to what I might be doing wrong as I can not find anything about this in other issues or in the documentation.