I’m trying to display a splash screen while I’m loading my textures so that the user isn’t just looking at a blank screen for a few seconds. Here are parts of my code:
DWORD WINAPI TextureThread(LPVOID lpParam)
{if (!LoadPlanetGLTexture() | | !LoadMoonGLTextures() | | !LoadRingGLTexture() | | !LoadSunGLTexture()) // Load texture
{
return false;
}return true;
}DWORD WINAPI LoadingThread(LPVOID lpParam)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);glColor3f(1.0f, 1.0f, 1.0f);
if (!LoadStarGLTexture())
{
return false;
}DrawStarField();
return true;
}void startup()
{
DWORD iID[2];
DWORD dwThrdParam = 1;HANDLE hThread[2];
hThread[0] = CreateThread(NULL,0,TextureThread,&dwThrdParam,NULL,&iID[0]);
hThread[1] = CreateThread(NULL,0,LoadingThread,&dwThrdParam,NULL,&iID[1]);WaitForMultipleObjects(2,hThread,TRUE,INFINITE);
}
I call startup from my WinMain routine. However nothing appears to even happen. Right away it goes to start drawing the scene without loading any textures. It’s like it completely skips this two threads but for a split second I think I see the starfield texture flash but I cannot be sure.
What am I doing wrong?
Thank You.
[This message has been edited by Rhaegar (edited 04-02-2003).]
[This message has been edited by Rhaegar (edited 04-02-2003).]