bool eqHello::Renderer::initContext(co::Object* initData) { if (!seq::Renderer::initContext(initData)) return false; if (!_loadShaders()) return false; _setupCube(); return true; }
void OpenGlShape::init(const char * vertexShaderFilePath, const char * fragmentShaderFilePath, const char* textureFilename) { glGenVertexArrays(1, &_vertexArrayId); glBindVertexArray(_vertexArrayId); glGenBuffers(1, &_vertexBuffer); glBindBuffer(GL_ARRAY_BUFFER, _vertexBuffer); glBufferData(GL_ARRAY_BUFFER, _vertexBufferData.size() * sizeof(GLfloat), &_vertexBufferData.front(), GL_STATIC_DRAW); glGenBuffers(1, &_texCoordBuffer); glBindBuffer(GL_ARRAY_BUFFER, _texCoordBuffer); glBufferData(GL_ARRAY_BUFFER, _textureBufferData.size() * sizeof(GLfloat), &_textureBufferData.front(), GL_STATIC_DRAW); _programId = _loadShaders(vertexShaderFilePath, fragmentShaderFilePath); _matrixId = glGetUniformLocation(_programId, "MVP"); _loadTexture(textureFilename); }
bool Window::configInitGL( const eq::uint128_t& initID ) { if( !eq::Window::configInitGL( initID )) return false; glLightModeli( GL_LIGHT_MODEL_LOCAL_VIEWER, 1 ); glEnable( GL_CULL_FACE ); // OPT - produces sparser images in DB mode glCullFace( GL_BACK ); LBASSERT( !_state ); _state = new VertexBufferState( getObjectManager( )); const Config* config = static_cast< const Config* >( getConfig( )); const InitData& initData = config->getInitData(); if( initData.showLogo( )) _loadLogo(); if( initData.useGLSL() ) _loadShaders(); return true; }
eDeferredRenderer::eDeferredRenderer(eGraphicsApiDx9 *gfx, eU32 shadowSize, eU32 refractionSize) : eIRenderer(gfx), m_diffuseRt(eNULL), m_normalsRt(eNULL), m_specularRt(eNULL), m_positionRt(eNULL), m_deferredShadowMap(eNULL), m_unwrappedDistMap(eNULL), m_indirectionCm(eNULL), m_shadowSize(shadowSize), m_refractionTex(eNULL), m_refractionSize(refractionSize) { eASSERT(gfx != eNULL); _createIndirectionCubeMap(); _loadShaders(); // Create default material for meshes. eMaterial defaultMat; defaultMat.setFlatShaded(eTRUE); eMaterial::setDefault(defaultMat); }