35 #include "vertexBufferState.h"
37 #include "fragmentShader.glsl.h"
38 #include "vertexShader.glsl.h"
53 if( !GLEW_EXT_framebuffer_object )
80 glLightModeli( GL_LIGHT_MODEL_LOCAL_VIEWER, 1 );
81 glEnable( GL_CULL_FACE );
82 glCullFace( GL_BACK );
88 const InitData& initData = config->getInitData();
90 if( initData.showLogo( ))
93 if( initData.useGLSL() )
101 if( _state && !_state->isShared( ))
112 static const std::string _logoTextureName =
113 std::string( lunchbox::getExecutablePath() +
114 "/../share/Equalizer/data/logo.rgb" );
117 void Window::_loadLogo()
119 if( !GLEW_ARB_texture_rectangle )
121 LBWARN <<
"Can't load overlay logo, GL_ARB_texture_rectangle not "
122 <<
"available" << std::endl;
127 _logoTexture = om.getEqTexture( _logoTextureName.c_str( ));
134 LBWARN <<
"Can't load overlay logo " << _logoTextureName << std::endl;
138 _logoTexture = om.newEqTexture( _logoTextureName.c_str(),
139 GL_TEXTURE_RECTANGLE_ARB );
140 LBASSERT( _logoTexture );
144 LBVERB <<
"Created logo texture of size " << _logoTexture->
getWidth() <<
"x"
145 << _logoTexture->
getHeight() << std::endl;
148 void Window::_loadShaders()
150 if( _state->getShader( vertexShader_glsl ) != VertexBufferState::INVALID )
155 if( !GLEW_VERSION_2_0 )
157 LBWARN <<
"Shader function pointers missing, using fixed function "
158 <<
"pipeline" << std::endl;
162 const GLuint vShader = _state->newShader( vertexShader_glsl,
164 LBASSERT( vShader != VertexBufferState::INVALID );
165 const GLchar* vShaderPtr = vertexShader_glsl;
166 glShaderSource( vShader, 1, &vShaderPtr, 0 );
167 glCompileShader( vShader );
170 glGetShaderiv( vShader, GL_COMPILE_STATUS, &status );
173 LBWARN <<
"Failed to compile vertex shader" << std::endl;
177 const GLuint fShader =
178 _state->newShader( fragmentShader_glsl, GL_FRAGMENT_SHADER );
179 LBASSERT( fShader != VertexBufferState::INVALID );
180 const GLchar* fShaderPtr = fragmentShader_glsl;
181 glShaderSource( fShader, 1, &fShaderPtr, 0 );
182 glCompileShader( fShader );
183 glGetShaderiv( fShader, GL_COMPILE_STATUS, &status );
186 LBWARN <<
"Failed to compile fragment shader" << std::endl;
190 const GLuint program = _state->newProgram(
getPipe() );
191 LBASSERT( program != VertexBufferState::INVALID );
192 glAttachShader( program, vShader );
193 glAttachShader( program, fShader );
194 glLinkProgram( program );
195 glGetProgramiv( program, GL_LINK_STATUS, &status );
198 LBWARN <<
"Failed to link shader program" << std::endl;
203 glDisable( GL_LIGHTING );
205 LBINFO <<
"Shaders loaded successfully" << std::endl;
211 const FrameData& frameData = pipe->getFrameData();
213 _state->setRenderMode( frameData.getRenderMode( ));
virtual EQ_API bool configInitSystemWindow(const uint128_t &initID)
Initialize the OS-specific window.
The representation of one GPU.
EQ_API const Config * getConfig() const
EQ_API bool upload(const Frame::Buffer buffer, util::Texture *texture, const Vector2i &position, util::ObjectManager &glObjects) const
Upload this image to the frame buffer or a texture.
EQFABRIC_INL void setIAttribute(const WindowSettings::IAttribute attr, const int32_t value)
Set a window attribute.
EQ_API void deleteGLObjects(util::ObjectManager &om)
Delete all OpenGL objects allocated from the given object manager.
virtual EQ_API void frameStart(const uint128_t &frameID, const uint32_t frameNumber)
Start rendering a frame.
const DrawableConfig & getDrawableConfig() const
No of accumulation buffer planes.
virtual EQ_API bool configExitSystemWindow()
De-initialize the OS-specific window.
virtual bool configInitSystemWindow(const eq::uint128_t &initID)
Initialize the OS-specific window.
virtual bool configExitGL()
De-initialize the OpenGL state for this window.
virtual bool configExitGL()
De-initialize the OpenGL state for this window.
const P * getPipe() const
virtual void frameStart(const eq::uint128_t &frameID, const uint32_t frameNumber)
Start rendering a frame.
EQ_API int32_t getWidth() const
A facility class to manage OpenGL objects across shared contexts.
EQ_API int32_t getHeight() const
EQ_API bool readImage(const std::string &filename, const Frame::Buffer buffer)
Read pixel data from an uncompressed rgb image file.
The configuration, run be the EqPly application.
virtual EQ_API bool configInitGL(const uint128_t &initID)
Initialize the OpenGL state for this window.
virtual bool configInitGL(const eq::uint128_t &initID)
Initialize the OpenGL state for this window.
util::ObjectManager & getObjectManager()