Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Anton_suv

OpenAL&GL

This topic is 5395 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
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);
}
}
//////////////////////////////////////////////////

Share this post


Link to post
Share on other sites
here a little demo with source watch it to plz
i''ve repair a nehe lesson5...
http://www.gamedev.ru/cgi-bin/download/download.pl?id=207

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!