Turgut
Turgut

Reputation: 809

OpenGL context without a monitor

I want to create an opengl context but that context must be created without a monitor attach to the system. The reason I want this is because this program should ran in a linux ubuntu server. Inside a docker image to be specific. I'm using many opengl libraries including modern opengl(GLSL), GLFW, glad and glm. I've found this question but I'm not sure whether or not one of the methods will work and it might be a bit outdated. I've also seen someone using something like this on an obsolete site but I'm not sure how to implement it:

glXMakeContextCurrent(display,None,None,context);

I think it still needs a window as display, if not what is the type of display and context variable and where can i download glX?

Edit: I'm only using GLFW for window/context creation on my local machine so I can exclude it.

Upvotes: 5

Views: 1189

Answers (1)

Alexey S. Larionov
Alexey S. Larionov

Reputation: 7927

You can use an X Virtual Framebuffer that allows to emulate presence of a physical display in Linux.

It can be installed via

apt-get install xvfb

And used as

xvfb-run -a "your command"

Upvotes: 4

Related Questions