42 pipe->startAsyncFetcher(
this );
46 void Pipe::startAsyncFetcher(
Window* wnd )
51 LBINFO <<
"initialize async fetcher: " <<
this <<
", " << wnd << std::endl;
52 _asyncFetcher.setup( wnd );
60 const void* oldKey = _txId.key;
61 if( _asyncFetcher.tryGetTextureId( _txId ))
64 _asyncFetcher.deleteTexture( oldKey );
66 LBINFO <<
"new texture generated " << _txId.key << std::endl;
82 GLuint txId = pipe->getTextureId();
86 glEnable( GL_TEXTURE_2D );
87 glBindTexture( GL_TEXTURE_2D, txId );
88 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
89 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
92 const float lightPos[] = { 0.0f, 0.0f, 1.0f, 0.0f };
93 glLightfv( GL_LIGHT0, GL_POSITION, lightPos );
95 const float lightAmbient[] = { 0.2f, 0.2f, 0.2f, 1.0f };
96 glLightfv( GL_LIGHT0, GL_AMBIENT, lightAmbient );
99 glRotatef( static_cast< float >( spin.low( )) * 0.1f, 1.0f, 0.5f, 0.25f );
104 for(
int i = 0; i < 6; i++ )
106 glColor3f( i&1 ? 0.5f : 1.0f, i&2 ? 1.0f : 0.5f, i&4 ? 1.0f : 0.5f );
108 glNormal3f( 0.0f, 0.0f, 1.0f );
109 glBegin( GL_TRIANGLE_STRIP );
110 glTexCoord2f( tMax, tMax );
111 glVertex3f( .7f, .7f, -1.0f );
112 glTexCoord2f( tMin, tMax );
113 glVertex3f( -.7f, .7f, -1.0f );
114 glTexCoord2f( tMax, tMin );
115 glVertex3f( .7f, -.7f, -1.0f );
116 glTexCoord2f( tMin, tMin );
117 glVertex3f( -.7f, -.7f, -1.0f );
121 glRotatef( 90.0f, 0.0f, 1.0f, 0.0f );
123 glRotatef( 90.0f, 1.0f, 0.0f, 0.0f );
125 glRotatef( 180.0f, 1.0f, 0.0f, 0.0f );
130 glDisable( GL_TEXTURE_2D );
virtual void frameStart(const uint128_t &frameID, const uint32_t frameNumber)
Start rendering a frame.
const P * getPipe() const
bool configInitGL(const eq::uint128_t &initID)
Initialize the OpenGL state for this window.
virtual void frameDraw(const eq::uint128_t &spin)
Draw the scene.
virtual void frameStart(const eq::uint128_t &frameID, const uint32_t frameNumber)
Start rendering a frame.
virtual bool configInitGL(const uint128_t &initID)
Initialize the OpenGL state for this window.
virtual void frameDraw(const uint128_t &frameID)
Draw the scene.
virtual bool configExit()
De-initialize this pipe.
virtual bool configExit()
De-initialize this pipe.