small freem cleanup
This commit is contained in:
@@ -44,7 +44,6 @@ LowLevelWindow_X11::LowLevelWindow_X11()
|
|||||||
int iRevision = iXServerVersion / 1000; iXServerVersion %= 1000;
|
int iRevision = iXServerVersion / 1000; iXServerVersion %= 1000;
|
||||||
int iPatch = iXServerVersion;
|
int iPatch = iXServerVersion;
|
||||||
|
|
||||||
|
|
||||||
LOG->Info( "Display: %s (screen %i)", DisplayString(Dpy), iScreen );
|
LOG->Info( "Display: %s (screen %i)", DisplayString(Dpy), iScreen );
|
||||||
LOG->Info( "X server vendor: %s [%i.%i.%i.%i]", XServerVendor( Dpy ), iMajor, iMinor, iRevision, iPatch );
|
LOG->Info( "X server vendor: %s [%i.%i.%i.%i]", XServerVendor( Dpy ), iMajor, iMinor, iRevision, iPatch );
|
||||||
LOG->Info( "Server GLX vendor: %s [%s]", glXQueryServerString( Dpy, iScreen, GLX_VENDOR ), glXQueryServerString( Dpy, iScreen, GLX_VERSION ) );
|
LOG->Info( "Server GLX vendor: %s [%s]", glXQueryServerString( Dpy, iScreen, GLX_VENDOR ), glXQueryServerString( Dpy, iScreen, GLX_VERSION ) );
|
||||||
@@ -86,8 +85,8 @@ LowLevelWindow_X11::~LowLevelWindow_X11()
|
|||||||
void *LowLevelWindow_X11::GetProcAddress( RString s )
|
void *LowLevelWindow_X11::GetProcAddress( RString s )
|
||||||
{
|
{
|
||||||
// XXX: We should check whether glXGetProcAddress or
|
// XXX: We should check whether glXGetProcAddress or
|
||||||
// glXGetProcAddressARB is available, and go by that, instead of
|
// glXGetProcAddressARB is available/not NULL, and go by that,
|
||||||
// assuming like this.
|
// instead of assuming like this.
|
||||||
return (void*) glXGetProcAddressARB( (const GLubyte*) s.c_str() );
|
return (void*) glXGetProcAddressARB( (const GLubyte*) s.c_str() );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -95,11 +94,9 @@ RString LowLevelWindow_X11::TryVideoMode( const VideoModeParams &p, bool &bNewDe
|
|||||||
{
|
{
|
||||||
#if defined(UNIX)
|
#if defined(UNIX)
|
||||||
/* nVidia cards:
|
/* nVidia cards:
|
||||||
*
|
|
||||||
* This only works the first time we set up a window; after that, the
|
* This only works the first time we set up a window; after that, the
|
||||||
* drivers appear to cache the value, so you have to actually restart
|
* drivers appear to cache the value, so you have to actually restart
|
||||||
* the program to change it again.
|
* the program to change it again. */
|
||||||
*/
|
|
||||||
static char buf[128];
|
static char buf[128];
|
||||||
strcpy( buf, "__GL_SYNC_TO_VBLANK=" );
|
strcpy( buf, "__GL_SYNC_TO_VBLANK=" );
|
||||||
strcat( buf, p.vsync?"1":"0" );
|
strcat( buf, p.vsync?"1":"0" );
|
||||||
@@ -173,7 +170,6 @@ RString LowLevelWindow_X11::TryVideoMode( const VideoModeParams &p, bool &bNewDe
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
XSelectInput( Dpy, Win, winAttrib.your_event_mask );
|
XSelectInput( Dpy, Win, winAttrib.your_event_mask );
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -243,9 +239,11 @@ RString LowLevelWindow_X11::TryVideoMode( const VideoModeParams &p, bool &bNewDe
|
|||||||
XSetWMNormalHints( Dpy, Win, &hints );
|
XSetWMNormalHints( Dpy, Win, &hints );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Workaround for metacity and compiz, if the window have the same resolution or higher than the screen
|
/* Workaround for metacity and compiz: if the window have the same
|
||||||
// it gets automaximized even when the window is set to don't let do it.
|
* resolution or higher than the screen, it gets automaximized even
|
||||||
// This happens changing from fullscreen to window mode and our screen resolution is bigger.
|
* when the window is set to not let it happen. This happens when
|
||||||
|
* changing from fullscreen to window mode and our screen resolution
|
||||||
|
* is bigger. */
|
||||||
{
|
{
|
||||||
XEvent xev;
|
XEvent xev;
|
||||||
Atom wm_state = XInternAtom(Dpy, "_NET_WM_STATE", False);
|
Atom wm_state = XInternAtom(Dpy, "_NET_WM_STATE", False);
|
||||||
@@ -392,8 +390,8 @@ RenderTarget_X11::~RenderTarget_X11()
|
|||||||
glDeleteTextures( 1, reinterpret_cast<GLuint*>(&m_iTexHandle) );
|
glDeleteTextures( 1, reinterpret_cast<GLuint*>(&m_iTexHandle) );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Note that although the texture size may need to be a power of 2, the Pbuffer
|
/* Note that although the texture size may need to be a power of 2,
|
||||||
* does not. */
|
* the Pbuffer does not. */
|
||||||
void RenderTarget_X11::Create( const RenderTargetParam ¶m, int &iTextureWidthOut, int &iTextureHeightOut )
|
void RenderTarget_X11::Create( const RenderTargetParam ¶m, int &iTextureWidthOut, int &iTextureHeightOut )
|
||||||
{
|
{
|
||||||
//ASSERT( param.iWidth == power_of_two(param.iWidth) && param.iHeight == power_of_two(param.iHeight) );
|
//ASSERT( param.iWidth == power_of_two(param.iWidth) && param.iHeight == power_of_two(param.iHeight) );
|
||||||
@@ -515,9 +513,9 @@ RenderTarget *LowLevelWindow_X11::CreateRenderTarget()
|
|||||||
|
|
||||||
void LowLevelWindow_X11::BeginConcurrentRenderingMainThread()
|
void LowLevelWindow_X11::BeginConcurrentRenderingMainThread()
|
||||||
{
|
{
|
||||||
/* Move the main thread, which is going to be loading textures, etc. but
|
/* Move the main thread, which is going to be loading textures, etc.
|
||||||
* not rendering, to an undisplayed window. This results in smoother
|
* but not rendering, to an undisplayed window. This results in
|
||||||
* rendering. */
|
* smoother rendering. */
|
||||||
bool b = glXMakeCurrent( Dpy, g_AltWindow, g_pContext );
|
bool b = glXMakeCurrent( Dpy, g_AltWindow, g_pContext );
|
||||||
ASSERT(b);
|
ASSERT(b);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user