Skip to content

Commit

Permalink
GL/GLEW OS X fixes:
Browse files Browse the repository at this point in the history
* Add GLEW-detected GL version to drawable config
* Don't use experimental GLEW on OS X, detects GL 4 which does not work
* Add load-balanced DB config to 4-window.all
  • Loading branch information
Stefan Eilemann authored and Stefan Eilemann committed Jul 23, 2015
1 parent 0876e1d commit 5f560ef
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 6 deletions.
2 changes: 2 additions & 0 deletions doc/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ Changelog {#Changelog}

# git master {#master}

* [473](https://github.com/Eyescale/Equalizer/pull/473)
Fix OS X OpenGL detection
* [463](https://github.com/Eyescale/Equalizer/pull/463):
Use program name as default window title
* [463](https://github.com/Eyescale/Equalizer/pull/463):
Expand Down
10 changes: 5 additions & 5 deletions eq/fabric/drawableConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,15 @@ namespace fabric
{
DrawableConfig()
: stencilBits(0), colorBits(0), alphaBits(0), accumBits(0)
, glVersion( 0.f ), stereo( false ), doublebuffered( false )
, coreProfile( false ) {}
, glVersion( 0.f ), glewGLVersion( 0.f ), stereo( false )
, doublebuffered( false ) , coreProfile( false ) {}

int32_t stencilBits; //!< Number of stencil bits
int32_t colorBits; //!< Number of bits per color component
int32_t alphaBits; //!< Number of alpha bits
int32_t accumBits; //!< Number of accumulation bits
float glVersion; //!< OpenGL version
float glVersion; //!< OpenGL version (glGetString( GL_VERSION ))
float glewGLVersion; //!< OpenGL version (GLEW detected)
bool stereo; //!< Active stereo supported
bool doublebuffered; //!< Doublebuffering supported
bool coreProfile; //!< Core or Compat profile (since OpenGL 3.2)
Expand All @@ -46,7 +47,7 @@ namespace fabric
inline std::ostream& operator << ( std::ostream& os,
const DrawableConfig& config )
{
os << "GL" << config.glVersion;
os << "GL" << config.glVersion << "|GLEW" << config.glewGLVersion;
if( config.glVersion >= 3.2f )
os << (config.coreProfile ? "|Core" : "|Compat");
os << "|rgb" << config.colorBits;
Expand Down Expand Up @@ -77,4 +78,3 @@ template<> inline void byteswap( eq::fabric::DrawableConfig& value )
}
}
#endif // EQ_DRAWABLECONFIG_H

26 changes: 25 additions & 1 deletion eq/glWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ void GLWindow::initGLEW()
if( _impl->glewInitialized )
return;

#ifndef _MSC_VER
#ifdef __linux__
// http://sourceforge.net/p/glew/patches/40/
glewExperimental = true;
#endif
Expand Down Expand Up @@ -254,6 +254,10 @@ void GLWindow::finish()
glFinish();
}

#define TEST_GLEW_VERSION( MAJOR, MINOR ) \
if( GLEW_VERSION_ ## MAJOR ## _ ## MINOR ) \
drawableConfig.glewGLVersion = MAJOR ## . ## MINOR ## f; \

void GLWindow::queryDrawableConfig( DrawableConfig& drawableConfig )
{
// GL version
Expand All @@ -274,6 +278,26 @@ void GLWindow::queryDrawableConfig( DrawableConfig& drawableConfig )
drawableConfig.coreProfile = mask & GL_CONTEXT_CORE_PROFILE_BIT;
}

TEST_GLEW_VERSION( 1, 1 );
TEST_GLEW_VERSION( 1, 2 );
TEST_GLEW_VERSION( 1, 3 );
TEST_GLEW_VERSION( 1, 4 );
TEST_GLEW_VERSION( 1, 5 );
TEST_GLEW_VERSION( 2, 0 );
TEST_GLEW_VERSION( 2, 1 );
TEST_GLEW_VERSION( 3, 0 );
TEST_GLEW_VERSION( 3, 1 );
TEST_GLEW_VERSION( 3, 2 );
TEST_GLEW_VERSION( 3, 3 );
TEST_GLEW_VERSION( 4, 0 );
TEST_GLEW_VERSION( 4, 1 );
TEST_GLEW_VERSION( 4, 2 );
TEST_GLEW_VERSION( 4, 3 );
#ifdef GLEW_VERSION_4_5
TEST_GLEW_VERSION( 4, 4 );
TEST_GLEW_VERSION( 4, 5 );
#endif

// Framebuffer capabilities
GLboolean result;
EQ_GL_CALL( glGetBooleanv( GL_STEREO, &result ));
Expand Down
31 changes: 31 additions & 0 deletions examples/configs/4-window.all.eqc
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,21 @@ server
}
}
layout
{
name "DB_Active"
view
{
observer 0
viewport [ 0 .5 .5 .5 ]
wall
{
bottom_left [ -.5 -.5 -1 ]
bottom_right [ .5 -.5 -1 ]
top_left [ -.5 .5 -1 ]
}
}
}
layout
{
name "Eye"
view
Expand Down Expand Up @@ -316,6 +331,7 @@ server
layout "DB_Stream"
layout "DB_DirectSend"
layout "DB_BinarySwap"
layout "DB_Active"
layout "MultiLevel"

layout "DFR"
Expand Down Expand Up @@ -872,6 +888,21 @@ server
inputframe { name "frame.channel4" }
}

compound
{
channel ( segment 0 layout "DB_Active" view 0 )
buffer [ COLOR DEPTH ]

load_equalizer{ mode DB }
compound {}
compound { channel "channel2" outputframe {} }
compound { channel "channel3" outputframe {} }
compound { channel "channel4" outputframe {} }
inputframe { name "frame.channel2" }
inputframe { name "frame.channel3" }
inputframe { name "frame.channel4" }
}

# wall with cross-segment load-balancing
compound
{
Expand Down

0 comments on commit 5f560ef

Please sign in to comment.