Working on the async texture loading.

Individual async texture loading is working but not very tested.
Still need some work optimizing the texture creation ( reimplement SOIL_create_OGL_texture avoiding the data duplication if not needed ).
This commit is contained in:
spartanj
2010-07-18 04:08:35 -03:00
parent 3a5ef5289c
commit b021ec49ef
17 changed files with 473 additions and 283 deletions

View File

@@ -171,6 +171,8 @@ class cEETest : private cThread {
eeInt mHeight;
std::wstring mBuda;
cTextureLoader * mTexLoader;
};
@@ -346,6 +348,10 @@ void cEETest::Init() {
mBuda = L"El mono ve el pez en el agua y sufre. Piensa que su mundo es el único que existe, el mejor, el real. Sufre porque es bueno y tiene compasión, lo ve y piensa: \"Pobre se está ahogando no puede respirar\". Y lo saca, lo saca y se queda tranquilo, por fin lo salvé. Pero el pez se retuerce de dolor y muere. Por eso te mostré el sueño, es imposible meter el mar en tu cabeza, que es un balde.\nPowered by Text Shrinker =)";
TTF.ShrinkText( mBuda, 400 );
mTexLoader = new cTextureLoader( MyPath + "data/test.jpg" );
mTexLoader->Threaded(true);
mTexLoader->Load();
Launch();
} else {
cout << "Failed to start EE++" << endl;
@@ -686,6 +692,14 @@ void cEETest::Screen3() {
}
void cEETest::Render() {
mTexLoader->Update();
if ( mTexLoader->IsLoaded() ) {
cTexture * TexLoaded = TF->GetTexture( mTexLoader->TexId() );
TexLoaded->Draw( 0, 0 );
}
HWidth = EE->GetWidth() * 0.5f;
HHeight = EE->GetHeight() * 0.5f;
@@ -942,6 +956,8 @@ void cEETest::Process() {
}
void cEETest::End() {
delete mTexLoader;
Wait();
Mus.Stop();