OpenAL&GL
Posted - 10/10/2003 : 06:50:23 AM
--------------------------------------------------------------------------------
i use OpenGL...
after the code my 3d application doesn''t want render,... there is nothing appears in GL window but the music is normaly playing!...
/*======INITIALIZATION OPENGL====*/
SetListenerValues();
// Setup an exit procedure.
atexit(KillALData);
/*======END INITIALIZATION OPENGL====*/
//============render my scene=====================
// Begin the source playing.
alSourcePlay(Source);
/*===============END======================*/
//||||||||||||WIN API||||||||||||||||||||||||||||
// Loop
ALint time = 0;
ALint elapse = 0;
while(!kbhit())
{
elapse += clock() - time;
time += elapse;
if(elapse > 50)
{
elapse = 0;
SourcePos[0] += SourceVel[0];
SourcePos[1] += SourceVel[1];
SourcePos[2] += SourceVel[2];
alSourcefv(Source, AL_POSITION, SourcePos);
}
}
//||||||||||||||||||||||||||END||||||||||||||||||||||||||||||
test
What is suppose to appear? I don''t see any OpenGL draw commands, just a loop that moves an OpenAL source around until a key is hit.
here it is!
-----------------------------------------
int DrawGLScene(GLvoid)
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
glTranslatef(0.0f,0.0f,-5.0f);
drawScene();
/////////////////sound/////////////////
SetListenerValues();
atexit(KillALData);
alSourcePlay(Source);
ALint time = 0;
ALint elapse = 0;
while(!kbhit())
{
elapse += clock() - time;
time += elapse;
if(elapse > 50)
{
elapse = 0;
SourcePos[0] += SourceVel[0];
SourcePos[1] += SourceVel[1];
SourcePos[2] += SourceVel[2];
alSourcefv(Source, AL_POSITION, SourcePos);
}
}
//////////////////////////////////////////////////
-----------------------------------------
int DrawGLScene(GLvoid)
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
glTranslatef(0.0f,0.0f,-5.0f);
drawScene();
/////////////////sound/////////////////
SetListenerValues();
atexit(KillALData);
alSourcePlay(Source);
ALint time = 0;
ALint elapse = 0;
while(!kbhit())
{
elapse += clock() - time;
time += elapse;
if(elapse > 50)
{
elapse = 0;
SourcePos[0] += SourceVel[0];
SourcePos[1] += SourceVel[1];
SourcePos[2] += SourceVel[2];
alSourcefv(Source, AL_POSITION, SourcePos);
}
}
//////////////////////////////////////////////////
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement