public:
Window window;
- GlxDrawable(const Visual *vis, int w, int h) :
- Drawable(vis, w, h)
+ GlxDrawable(const Visual *vis, int w, int h, bool pbuffer) :
+ Drawable(vis, w, h, pbuffer)
{
XVisualInfo *visinfo = static_cast<const GlxVisual *>(visual)->visinfo;
void
init(void) {
+ XInitThreads();
+
display = XOpenDisplay(NULL);
if (!display) {
std::cerr << "error: unable to open display " << XDisplayName(NULL) << "\n";
Visual *
createVisual(bool doubleBuffer, Profile profile) {
if (profile != PROFILE_COMPAT &&
- profile != PROFILE_CORE) {
+ profile != PROFILE_CORE &&
+ profile != PROFILE_ES2) {
return NULL;
}
}
Drawable *
-createDrawable(const Visual *visual, int width, int height)
+createDrawable(const Visual *visual, int width, int height, bool pbuffer)
{
- return new GlxDrawable(visual, width, height);
+ return new GlxDrawable(visual, width, height, pbuffer);
}
Context *
switch (profile) {
case PROFILE_COMPAT:
break;
+ case PROFILE_ES2:
+ attribs.add(GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_ES2_PROFILE_BIT_EXT);
+ break;
case PROFILE_CORE:
// XXX: This will invariable return a 3.2 context, when supported.
// We probably should have a PROFILE_CORE_XX per version.