Commit 0d00c3be authored by hybrid's avatar hybrid

Another fix for the linux device by zeitgeisty. Added another OpenGL Stencil extension.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@739 dfc29bdd-3216-0410-991c-e03cc46cb475
parent ad19e6eb
......@@ -104,8 +104,6 @@ CIrrDeviceLinux::~CIrrDeviceLinux()
XFree(StdHints);
if (display)
{
//os::Printer::log("Deleting window...", ELL_INFORMATION);
#ifdef _IRR_COMPILE_WITH_OPENGL_
if (Context)
{
......@@ -591,7 +589,8 @@ bool CIrrDeviceLinux::createWindow(const core::dimension2d<s32>& windowSize,
ZPixmap, 0, 0, Width, Height,
BitmapPad(display), 0);
SoftwareImage->data = new char[SoftwareImage->bytes_per_line * SoftwareImage->height];
// use malloc because X will free it later on
SoftwareImage->data = (char*) malloc(SoftwareImage->bytes_per_line * SoftwareImage->height * sizeof(char));
}
XFree(visual);
......
......@@ -725,6 +725,7 @@ class COpenGLExtensionHandler
void extGlGenRenderbuffers(GLsizei n, GLuint *renderbuffers);
void extGlRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
void extGlFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
void extGlActiveStencilFace(GLenum face);
protected:
// the global feature array
......@@ -785,6 +786,7 @@ class COpenGLExtensionHandler
PFNGLGENRENDERBUFFERSEXTPROC pGlGenRenderbuffersEXT;
PFNGLRENDERBUFFERSTORAGEEXTPROC pGlRenderbufferStorageEXT;
PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC pGlFramebufferRenderbufferEXT;
PFNGLACTIVESTENCILFACEEXTPROC pGlActiveStencilFaceEXT;
#endif
};
......@@ -1305,6 +1307,18 @@ inline void COpenGLExtensionHandler::extGlFramebufferRenderbuffer(GLenum target,
#endif
}
inline void COpenGLExtensionHandler::extGlActiveStencilFace(GLenum face)
{
#ifdef _IRR_OPENGL_USE_EXTPOINTER_
if (pGlActiveStencilFaceEXT)
pGlActiveStencilFaceEXT(face);
#elif defined(GL_EXT_stencil_two_side)
glActiveStencilFaceEXT(face);
#else
os::Printer::log("glActiveStencilFace not supported", ELL_ERROR);
#endif
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment