more X11/Linux debug-graphics fixes
This commit is contained in:
@@ -1,13 +1,26 @@
|
||||
|
||||
///See http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-14-render-to-texture/
|
||||
|
||||
bool gIntelLinuxglDrawBufferWorkaround=false;
|
||||
|
||||
#include "GLRenderToTexture.h"
|
||||
#include "Bullet3Common/b3Scalar.h" // for b3Assert
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
bool gIntelLinuxglDrawBufferWorkaround=false;
|
||||
|
||||
GLRenderToTexture::GLRenderToTexture()
|
||||
:m_framebufferName(0)
|
||||
{
|
||||
const GLubyte* ven = glGetString(GL_VENDOR);
|
||||
printf("ven = %s\n",ven);
|
||||
|
||||
if (strncmp((const char*)ven,"Intel",5)==0)
|
||||
{
|
||||
printf("Workaround for some crash in the Intel OpenGL driver on Linux/Ubuntu\n");
|
||||
gIntelLinuxglDrawBufferWorkaround=true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void GLRenderToTexture::init(int width, int height, GLuint textureId, int renderTextureType)
|
||||
|
||||
@@ -17,7 +17,6 @@ struct GLRenderToTexture
|
||||
bool m_initialized;
|
||||
int m_renderTextureType;
|
||||
public:
|
||||
|
||||
GLRenderToTexture();
|
||||
|
||||
void init(int width, int height, GLuint textureId, int renderTextureType=RENDERTEXTURE_COLOR);
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
#include <unistd.h>
|
||||
|
||||
#include <pthread.h>
|
||||
extern bool gIntelLinuxglDrawBufferWorkaround;
|
||||
|
||||
GLint att[] = { GLX_RGBA, GLX_DEPTH_SIZE, 24, GLX_DOUBLEBUFFER, None };
|
||||
static bool forceOpenGL3 = true;
|
||||
@@ -235,11 +234,6 @@ void X11OpenGLWindow::enableOpenGL()
|
||||
const GLubyte* ven = glGetString(GL_VENDOR);
|
||||
printf("GL_VENDOR=%s\n", ven);
|
||||
|
||||
if (strncmp((const char*)ven,"Intel",5)==0)
|
||||
{
|
||||
printf("Workaround for some crash in the Intel OpenGL driver on Linux/Ubuntu\n");
|
||||
gIntelLinuxglDrawBufferWorkaround=true;
|
||||
}
|
||||
const GLubyte* ren = glGetString(GL_RENDERER);
|
||||
printf("GL_RENDERER=%s\n",ren);
|
||||
const GLubyte* ver = glGetString(GL_VERSION);
|
||||
@@ -276,7 +270,10 @@ printf("createWindow\n");
|
||||
|
||||
m_data->m_root = DefaultRootWindow(m_data->m_dpy);
|
||||
|
||||
|
||||
if (ci.m_openglVersion < 3)
|
||||
{
|
||||
forceOpenGL3 = false;
|
||||
}
|
||||
|
||||
if (forceOpenGL3)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user