32 #include "asyncFetcher.h"
36 #include <eq/client/system.h>
40 AsyncFetcher::AsyncFetcher()
46 AsyncFetcher::~AsyncFetcher()
51 const GLEWContext* AsyncFetcher::glewGetContext()
const
53 return _sharedWindow->glewGetContext();
72 LBWARN <<
"OS Window initialization failed: " << std::endl;
79 LBERROR <<
"Failed to create shared context window for "
85 LBINFO <<
"Async fetcher initialization finished" << std::endl;
89 void AsyncFetcher::setup( Window* window )
91 _sharedWindow = initSharedContextWindow( window );
95 void AsyncFetcher::stop()
103 _sharedWindow->configExit();
104 delete _sharedWindow;
112 void AsyncFetcher::run()
114 LBASSERT( _sharedWindow );
118 _sharedWindow->makeCurrent();
120 lunchbox::Bufferb textureData( 64*64*4 );
121 LBINFO <<
"async fetcher initialized" << std::endl;
124 lunchbox::sleep( 1000 );
125 for( uint8_t* i = 0; running; ++i )
129 tx->
init( GL_RGBA8, 64, 64 );
133 for(
int y = 0; y < 64; ++y )
135 for(
int x = 0; x < 64; ++x )
137 const GLbyte rnd = rng.get< uint8_t >() % 127;
138 const GLbyte val = (x / 8) % 2 == (y / 8) % 2 ? rnd : 0;
139 textureData[ j++ ] = val;
140 textureData[ j++ ] = val;
141 textureData[ j++ ] = val;
142 textureData[ j++ ] = val;
145 tx->
upload( 64, 64, textureData.getData( ));
146 EQ_GL_CALL( glFinish( ));
152 lunchbox::sleep( rng.get< uint32_t >() % 5000u );
155 const void* keyToDelete = 0;
156 while( _inQueue.tryPop( keyToDelete ))
160 LBWARN <<
"Deleting eq texture " << keyToDelete << std::endl;
161 objects.deleteEqTexture( keyToDelete );
A Pipe represents a graphics card (GPU) on a Node.
A set of settings to setup an eq::SystemWindow.
A wrapper around OpenGL textures.
EQFABRIC_API bool setIAttribute(const IAttribute attr, const int32_t value)
Set a window attribute.
EQ_API void upload(const int32_t width, const int32_t height, const void *ptr)
Copy the specified buffer to the texture at 0,0.
EQ_API void init(const unsigned internalFormat, const int32_t width, const int32_t height)
Initialize an OpenGL texture.
A Window represents an on-screen or off-screen drawable.
EQFABRIC_INL const Settings & getSettings() const
virtual EQ_API bool configInit()=0
Initialize this system window.
virtual EQ_API void makeCurrent(const bool cache=true) const
Make the window's drawable and context current.
Structure to associate OpenGL texture ids with an external key.
The interface definition for system-specific windowing code.
Window, pbuffer, FBO or OFF.
const P * getPipe() const
virtual EQ_API void makeCurrent(const bool cache=true) const =0
Make the system window rendering context and drawable current.
A facility class to manage OpenGL objects across shared contexts.
EQ_API WindowSystem getWindowSystem() const
Return the window system used by this pipe.
EQ_API unsigned getName() const
EQ_API void deleteAll()
Delete all managed objects and associated GL objects.