OpenGL system design-integrated directxaudio (2)

Source: Internet
Author: User


<! --
/* Font Definitions */
@ Font-face
{Font-family:;
Panose-1: 2 1 6 0 3 1 1 1 1 1;
MSO-font-alt: simsun;
MSO-font-charset: 134;
MSO-generic-font-family: auto;
MSO-font-pitch: variable;
MSO-font-Signature: 3 135135232 16 0 262145 0 ;}
@ Font-face
{Font-family: "/@ ";
Panose-1: 2 1 6 0 3 1 1 1 1 1;
MSO-font-charset: 134;
MSO-generic-font-family: auto;
MSO-font-pitch: variable;
MSO-font-Signature: 3 135135232 16 0 262145 0 ;}
/* Style definitions */
P. msonormal, Li. msonormal, Div. msonormal
{MSO-style-parent :"";
Margin: 0 cm;
Margin-bottom:. 0001pt;
MSO-pagination: none;
Font-size: 10.5pt;
MSO-bidi-font-size: 12.0pt;
Font-family: "Times New Roman ";
MSO-Fareast-font-family:;
MSO-font-kerning: 1.0pt ;}
P. msobodytext, Li. msobodytext, Div. msobodytext
{Margin-top: 0 cm;
Margin-Right: 0 cm;
Margin-bottom: 6.0pt;
Margin-left: 0 cm;
MSO-pagination: none;
Font-size: 10.5pt;
MSO-bidi-font-size: 12.0pt;
Font-family: "Times New Roman ";
MSO-Fareast-font-family:;
MSO-font-kerning: 1.0pt ;}
P. msobodytextfirstindent, Li. msobodytextfirstindent, Div. msobodytextfirstindent
{MSO-style-Update: auto;
MSO-style-parent: body text;
MSO-style-link: "char ";
Margin: 0 cm;
Margin-bottom:. 0001pt;
Text-indent: 19.85pt;
MSO-pagination: none;
Font-size: 10.5pt;
Font-family: "Times New Roman ";
MSO-Fareast-font-family:;
MSO-ANSI-language: ZH-CN ;}
Span. charchar
{MSO-style-name: "char ";
MSO-style-locked: yes;
MSO-style-link: indent of the first line of the body;
MSO-ANSI-font-size: 10.5pt;
MSO-bidi-font-size: 10.5pt;
Font-family:;
MSO-Fareast-font-family:;
MSO-ANSI-language: ZH-CN;
MSO-Fareast-language: ZH-CN;
Mm-bidi-language: AR-SA ;}
/* Page Definitions */
@ Page
{MSO-page-border-Surround-header: No;
MSO-page-border-Surround-footer: No ;}
@ Page Section1
{Size: 612.0pt 792.0pt;
Margin: 72.0pt 90.0pt 72.0pt 90.0pt;
MSO-header-margin: 361_pt;
MSO-footer-margin: 36366pt;
MSO-paper-Source: 0 ;}
Div. Section1
{Page: Section1 ;}
-->

When
After setting directaudio, we will return
In OpenGL. Pair
OpenGL initialization functions
Glinit and main cyclic Functions
Glmain does not require any changes, but it requires a response function to the input.
Modify keypressed. When you press the left mouse button to start playing the music, right-click it to stop playing the music.

 

Int keypressed ()

{


If (buffer [dik_escape])
//
The values here are Dik _***
Instead of VK _***


Return false;


......

//
The keyboard direction keys remain unchanged.

 


//
Start playing music with the left mouse button


If (mousestate. rgbbuttons [mouse_left] &
0x80)


{


//
Play music. The number of cycles is unlimited.


Dmplay (& sound,
Dmus_seg_repeat_infinite );


}

 


//
Right-click to stop playing music


If (mousestate. rgbbuttons [mouse_right] &
0x80)


{


Dmstop (& Sound );


}

 


Return true;

}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.