|
|
@ -245,15 +245,15 @@ extern "C"
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
static Bool WndProc(Display *d, XEvent *e, char *arg)
|
|
|
|
static Bool WndProc(Display *d, XEvent *e, char *arg)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
nlinfo("3D: glop %d %d", e->type, e->xmap.window);
|
|
|
|
nlinfo("3D: glop %d %d", e->type, e->xmap.window);
|
|
|
|
CDriverGL *pDriver = (CDriverGL*)arg;
|
|
|
|
CDriverGL *pDriver = (CDriverGL*)arg;
|
|
|
|
if (pDriver != NULL)
|
|
|
|
if (pDriver != NULL)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Process the message by the emitter
|
|
|
|
// Process the message by the emitter
|
|
|
|
pDriver->_EventEmitter.processMessage();
|
|
|
|
pDriver->_EventEmitter.processMessage();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// TODO i'don t know what to return exactly
|
|
|
|
// TODO i'don t know what to return exactly
|
|
|
|
return (e->type == MapNotify) && (e->xmap.window == (Window) arg);
|
|
|
|
return (e->type == MapNotify) && (e->xmap.window == (Window) arg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
#endif // NL_OS_UNIX
|
|
|
|
#endif // NL_OS_UNIX
|
|
|
@ -867,7 +867,7 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
|
|
|
|
_hDC = NULL;
|
|
|
|
_hDC = NULL;
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_FullScreen= false;
|
|
|
|
_FullScreen= false;
|
|
|
@ -1074,21 +1074,21 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
|
|
|
|
visual_info = glXChooseVisual(dpy, DefaultScreen(dpy), sAttribList16bpp);
|
|
|
|
visual_info = glXChooseVisual(dpy, DefaultScreen(dpy), sAttribList16bpp);
|
|
|
|
if(visual_info == NULL)
|
|
|
|
if(visual_info == NULL)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
nlerror("glXChooseVisual() failed");
|
|
|
|
nlerror("glXChooseVisual() failed");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
nldebug("3D: glXChooseVisual OK");
|
|
|
|
nldebug("3D: glXChooseVisual OK");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ctx = glXCreateContext (dpy, visual_info, None, GL_TRUE);
|
|
|
|
ctx = glXCreateContext (dpy, visual_info, None, GL_TRUE);
|
|
|
|
if(ctx == NULL)
|
|
|
|
if(ctx == NULL)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
nlerror("glXCreateContext() failed");
|
|
|
|
nlerror("glXCreateContext() failed");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
nldebug("3D: glXCreateContext() OK");
|
|
|
|
nldebug("3D: glXCreateContext() OK");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
XSetWindowAttributes attr;
|
|
|
|
XSetWindowAttributes attr;
|
|
|
@ -1136,6 +1136,8 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
|
|
|
|
XChangeWindowAttributes(dpy, win, attr_flags, &attr);
|
|
|
|
XChangeWindowAttributes(dpy, win, attr_flags, &attr);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const char *title="NeL window";
|
|
|
|
|
|
|
|
|
|
|
|
XSizeHints size_hints;
|
|
|
|
XSizeHints size_hints;
|
|
|
|
size_hints.x = 0;
|
|
|
|
size_hints.x = 0;
|
|
|
|
size_hints.y = 0;
|
|
|
|
size_hints.y = 0;
|
|
|
@ -1147,13 +1149,14 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
|
|
|
|
size_hints.max_width = width;
|
|
|
|
size_hints.max_width = width;
|
|
|
|
size_hints.max_height = height;
|
|
|
|
size_hints.max_height = height;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef X_HAVE_UTF8_STRING
|
|
|
|
|
|
|
|
Xutf8SetWMProperties (dpy, win, (char*)title, (char*)title, NULL, 0, &size_hints, NULL, NULL);
|
|
|
|
|
|
|
|
#else
|
|
|
|
XTextProperty text_property;
|
|
|
|
XTextProperty text_property;
|
|
|
|
// FIXME char*s are created as const char*, but that doesn't work
|
|
|
|
|
|
|
|
// with XStringListToTextProperty()'s char** ...
|
|
|
|
|
|
|
|
const char *title="NeL window";
|
|
|
|
|
|
|
|
XStringListToTextProperty((char**)&title, 1, &text_property);
|
|
|
|
XStringListToTextProperty((char**)&title, 1, &text_property);
|
|
|
|
|
|
|
|
|
|
|
|
XSetWMProperties (dpy, win, &text_property, &text_property, 0, 0, &size_hints, 0, 0);
|
|
|
|
XSetWMProperties (dpy, win, &text_property, &text_property, 0, 0, &size_hints, 0, 0);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
glXMakeCurrent (dpy, win, ctx);
|
|
|
|
glXMakeCurrent (dpy, win, ctx);
|
|
|
|
XMapRaised (dpy, win);
|
|
|
|
XMapRaised (dpy, win);
|
|
|
|
|
|
|
|
|
|
|
@ -1310,8 +1313,6 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
|
|
|
|
if(_Extensions.EXTSeparateSpecularColor)
|
|
|
|
if(_Extensions.EXTSeparateSpecularColor)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
glLightModeli((GLenum)GL_LIGHT_MODEL_COLOR_CONTROL_EXT, GL_SEPARATE_SPECULAR_COLOR_EXT);
|
|
|
|
glLightModeli((GLenum)GL_LIGHT_MODEL_COLOR_CONTROL_EXT, GL_SEPARATE_SPECULAR_COLOR_EXT);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
_VertexProgramEnabled= false;
|
|
|
|
_VertexProgramEnabled= false;
|
|
|
@ -3594,7 +3595,7 @@ void CDriverGL::initFragmentShaders()
|
|
|
|
//
|
|
|
|
//
|
|
|
|
nglEndFragmentShaderATI();
|
|
|
|
nglEndFragmentShaderATI();
|
|
|
|
GLenum error = glGetError();
|
|
|
|
GLenum error = glGetError();
|
|
|
|
nlassert(error == GL_NONE);
|
|
|
|
nlassert(error == GL_NONE);
|
|
|
|
|
|
|
|
|
|
|
|
// The same but with a diffuse map added
|
|
|
|
// The same but with a diffuse map added
|
|
|
|
nglBindFragmentShaderATI(ATIWaterShaderHandle);
|
|
|
|
nglBindFragmentShaderATI(ATIWaterShaderHandle);
|
|
|
@ -3608,7 +3609,7 @@ void CDriverGL::initFragmentShaders()
|
|
|
|
|
|
|
|
|
|
|
|
nglEndFragmentShaderATI();
|
|
|
|
nglEndFragmentShaderATI();
|
|
|
|
error = glGetError();
|
|
|
|
error = glGetError();
|
|
|
|
nlassert(error == GL_NONE);
|
|
|
|
nlassert(error == GL_NONE);
|
|
|
|
nglBindFragmentShaderATI(0);
|
|
|
|
nglBindFragmentShaderATI(0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -4139,8 +4140,8 @@ void CDriverGL::checkTextureOn() const
|
|
|
|
nlassert(!flag2D);
|
|
|
|
nlassert(!flag2D);
|
|
|
|
nlassert(flagCM);
|
|
|
|
nlassert(flagCM);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
dgs.activeTextureARB(currTexStage);
|
|
|
|
dgs.activeTextureARB(currTexStage);
|
|
|
|