35 #include "vertexBufferState.h"
37 #include "fragmentShader.glsl.h"
38 #include "vertexShader.glsl.h"
53 if( !GLEW_EXT_framebuffer_object )
82 glLightModeli( GL_LIGHT_MODEL_LOCAL_VIEWER, 1 );
83 glEnable( GL_CULL_FACE );
84 glCullFace( GL_BACK );
90 const InitData& initData = config->getInitData();
92 if( initData.showLogo( ))
95 if( initData.useGLSL() )
103 if( _state && !_state->isShared( ))
115 # ifdef _WIN32 // final INSTALL_DIR is not known at compile time
116 static const std::string _logoTextureName =
117 std::string(
"../share/Equalizer/data/logo.rgb" );
119 static const std::string _logoTextureName = std::string( EQ_INSTALL_DIR ) +
120 std::string(
"share/Equalizer/data/logo.rgb" );
123 static const std::string _logoTextureName = std::string( EQ_SOURCE_DIR ) +
124 std::string(
"examples/eqPly/logo.rgb" );
128 void Window::_loadLogo()
130 if( !GLEW_ARB_texture_rectangle )
132 LBWARN <<
"Can't load overlay logo, GL_ARB_texture_rectangle not "
133 <<
"available" << std::endl;
138 _logoTexture = om->getEqTexture( _logoTextureName.c_str( ));
145 LBWARN <<
"Can't load overlay logo " << _logoTextureName << std::endl;
149 _logoTexture = om->newEqTexture( _logoTextureName.c_str(),
150 GL_TEXTURE_RECTANGLE_ARB );
151 LBASSERT( _logoTexture );
155 LBVERB <<
"Created logo texture of size " << _logoTexture->
getWidth() <<
"x"
156 << _logoTexture->
getHeight() << std::endl;
159 void Window::_loadShaders()
161 if( _state->getShader( vertexShader_glsl ) != VertexBufferState::INVALID )
166 if( !GLEW_VERSION_2_0 )
168 LBWARN <<
"Shader function pointers missing, using fixed function "
169 <<
"pipeline" << std::endl;
173 const GLuint vShader = _state->newShader( vertexShader_glsl,
175 LBASSERT( vShader != VertexBufferState::INVALID );
176 const GLchar* vShaderPtr = vertexShader_glsl;
177 glShaderSource( vShader, 1, &vShaderPtr, 0 );
178 glCompileShader( vShader );
181 glGetShaderiv( vShader, GL_COMPILE_STATUS, &status );
184 LBWARN <<
"Failed to compile vertex shader" << std::endl;
188 const GLuint fShader =
189 _state->newShader( fragmentShader_glsl, GL_FRAGMENT_SHADER );
190 LBASSERT( fShader != VertexBufferState::INVALID );
191 const GLchar* fShaderPtr = fragmentShader_glsl;
192 glShaderSource( fShader, 1, &fShaderPtr, 0 );
193 glCompileShader( fShader );
194 glGetShaderiv( fShader, GL_COMPILE_STATUS, &status );
197 LBWARN <<
"Failed to compile fragment shader" << std::endl;
201 const GLuint program = _state->newProgram(
getPipe() );
202 LBASSERT( program != VertexBufferState::INVALID );
203 glAttachShader( program, vShader );
204 glAttachShader( program, fShader );
205 glLinkProgram( program );
206 glGetProgramiv( program, GL_LINK_STATUS, &status );
209 LBWARN <<
"Failed to link shader program" << std::endl;
214 glDisable( GL_LIGHTING );
216 LBINFO <<
"Shaders loaded successfully" << std::endl;
222 const FrameData& frameData = pipe->getFrameData();
224 _state->setRenderMode( frameData.getRenderMode( ));
bool upload(const Frame::Buffer buffer, util::Texture *texture, const Vector2i &position, ObjectManager *glObjects) const
Upload this image to the frame buffer or a texture.
virtual bool configExitGL()
De-initialize the OpenGL state for this window.
const DrawableConfig & getDrawableConfig() const
virtual void frameStart(const eq::uint128_t &frameID, const uint32_t frameNumber)
Start rendering a frame.
const P * getPipe() const
int32_t getHeight() const
A facility class to manage OpenGL objects across shared contexts.
bool readImage(const std::string &filename, const Frame::Buffer buffer)
Read pixel data from an uncompressed rgb image file.
virtual bool configInitSystemWindow(const uint128_t &initID)
Initialize the OS-specific window.
The representation of one GPU.
void deleteGLObjects(ObjectManager *om)
Delete all OpenGL objects allocated from the given object manager.
ObjectManager * getObjectManager()
virtual bool configExitGL()
De-initialize the OpenGL state for this window.
const Config * getConfig() const
void setIAttribute(const IAttribute attr, const int32_t value)
Set a window attribute.
virtual bool configInitGL(const uint128_t &initID)
Initialize the OpenGL state for this window.
No of accumulation buffer planes.
virtual bool configInitGL(const eq::uint128_t &initID)
Initialize the OpenGL state for this window.
virtual bool configExitSystemWindow()
De-initialize the OS-specific window.
virtual void frameStart(const uint128_t &frameID, const uint32_t frameNumber)
Start rendering a frame.
virtual bool configInitSystemWindow(const eq::uint128_t &initID)
Initialize the OS-specific window.
The configuration, run be the EqPly application.