Hi..me again~
I'm using OpenAL to adding sound into my program...but wonder how to do this....because if I'm using glut, then I can simply init the alutInit(&argc, argv) ;
in the main function just like other glutInit....but my program..is using windows programming to do the openGL....i not familiar with windows programming and now while learning doing this project...so I wonder where should I init the OpenAL in this case?
Plus...is there any possibility to use glutMouseFunc in windows programming?
Shame on me...always ask simple questions~hope u all wont mind~haha:blush:
thanks~
Using OpenAL for sound in OpenGL problem
Started by kennyurge, Apr 13 2006 03:54 PM
9 replies to this topic
#1
Posted 13 April 2006 - 03:54 PM
#2
Posted 13 April 2006 - 06:04 PM
Are you using the Win32 API, MFC, Windows Forms, etc?
A Windows GUI application has a WinMain function that is similar to a regular main entry point. With MFC, the InitInstance of you application class would be a good place. I'm not as familiar with Windows Forms.
A Windows GUI application has a WinMain function that is similar to a regular main entry point. With MFC, the InitInstance of you application class would be a good place. I'm not as familiar with Windows Forms.
#3
Posted 13 April 2006 - 06:25 PM
monjardin said:
Are you using the Win32 API, MFC, Windows Forms, etc?
A Windows GUI application has a WinMain function that is similar to a regular main entry point. With MFC, the InitInstance of you application class would be a good place. I'm not as familiar with Windows Forms.
A Windows GUI application has a WinMain function that is similar to a regular main entry point. With MFC, the InitInstance of you application class would be a good place. I'm not as familiar with Windows Forms.
Im using Win32!!! And yes...it contains the WinMain..but the question is...the alutInit needs 2 params (argc and argv)....i can't find this in WinMain...
What should I do for this?
int WINAPI WinMain( HINSTANCE hInstance, // Instance
HINSTANCE hPrevInstance, // Previous Instance
LPSTR lpCmdLine, // Command Line Parameters
int nCmdShow) // Window Show State
{
MSG msg; // Windows Message Structure
BOOL done=FALSE; // Bool Variable To Exit Loop
// Ask The User Which Screen Mode They Prefer
if (MessageBox(NULL,"Would You Like To Run In Fullscreen Mode?", "Start FullScreen?",MB_YESNO|MB_ICONQUESTION)==IDNO)
{
fullscreen=FALSE; // Windowed Mode
}
.......
......
......}
Thanks for helping.......:happy:
#5
Posted 13 April 2006 - 06:42 PM
You can also set both parameters to NULL if you don't care about letting AL do command line processing.
reedbeta.com - developer blog, OpenGL demos, and other projects
#7
Posted 14 April 2006 - 08:28 AM
Reedbeta said:
You can also set both parameters to NULL if you don't care about letting AL do command line processing.
do u mean for the mouse function we also can use glutMouseFunc in WinMain there as long as we include the library needed?
#8
Posted 14 April 2006 - 12:37 PM
monjardin said:
lpCmdLine is the command line string without the module name. Use GetCommandLine to get the whole thing and parse your variables out of that.
I still not really understand ur way in doin this...can u explain more further?
or maybe some example coding please~:worthy:
#9
Posted 14 April 2006 - 12:40 PM
Reedbeta said:
You can also set both parameters to NULL if you don't care about letting AL do command line processing.
I tried ur way...when compile and run there is no error but it will make the pc hang(OMG!) I wonder whether loading in a sound file is too big and heavy computational load till the program will improper shut down and need to send report to microsoft. Or maybe because of setting the params to NULL?
#10
Posted 14 April 2006 - 05:20 PM
Read this stuff:
http://en.wikipedia...._line_interface
http://cplus.about.c...y/aa042902d.htm
http://msdn.microsof...ons/winmain.asp
http://msdn.microsof....asp?frame=true
http://www.google.com/
http://en.wikipedia...._line_interface
http://cplus.about.c...y/aa042902d.htm
http://msdn.microsof...ons/winmain.asp
http://msdn.microsof....asp?frame=true
http://www.google.com/
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users












