Click here to Skip to main content
15,885,309 members
Articles / Multimedia / DirectX

A DirectX Game: Quadrino

Rate me:
Please Sign up or sign in to vote.
4.89/5 (41 votes)
16 Oct 2008CPOL26 min read 396.3K   6.2K   125  
An interpretation of a popular falling block game implemented with DirectX that attempts to avoid any copyright infringement.
/* DSSoundManager.h ***********************************************************
Author:		Paul Watt, Copyright (c) 2002
Date:		10/20/2002
Purpose:	Definition for a class that will manage the DirectX sound system
			for playing sound files.
******************************************************************************/
#ifndef __DSSOUNDMANAGER_H
#define __DSSOUNDMANAGER_H

#include <dsound.h>
#include "DSSound.h"

/* Class **********************************************************************
Author:		Paul Watt
Date:		10/20/2002
Purpose:	Class to manage the DirectSound system.
******************************************************************************/
class DSSoundManager
{
protected:
	LPDIRECTSOUND8	m_pDS;
public:

	DSSoundManager ();
	virtual ~DSSoundManager();

    virtual HRESULT Initialize (HWND hWnd, DWORD dwCoopLevel=DSSCL_PRIORITY , DWORD dwPrimaryChannels=2, DWORD dwPrimaryFreq=22050, DWORD dwPrimaryBitRate=16);
    virtual HRESULT SetPrimaryBufferFormat(DWORD dwPrimaryChannels, DWORD dwPrimaryFreq, DWORD dwPrimaryBitRate);

    LPDIRECTSOUND GetDirectSound();

    virtual HRESULT CreateSound(DSSound** ppSound, LPTSTR strWaveFileName, DWORD dwCreationFlags = 0, DWORD dwNumBuffers = 1, GUID guid3DAlgorithm = GUID_NULL);
};


/* Public *********************************************************************
Author:		Paul Watt
Date:		10/20/2002
Purpose:	Returns a pointer to the DirectSound interface.
Parameters:	NONE
Return:		-
******************************************************************************/
inline LPDIRECTSOUND DSSoundManager::GetDirectSound() 
{ 
	return m_pDS; 
}


#endif

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Engineer
United States United States
I am a software architect and I have been developing software for nearly two decades. Over the years I have learned to value maintainable solutions first. This has allowed me to adapt my projects to meet the challenges that inevitably appear during development. I use the most beneficial short-term achievements to drive the software I develop towards a long-term vision.

C++ is my strongest language. However, I have also used x86 ASM, ARM ASM, C, C#, JAVA, Python, and JavaScript to solve programming problems. I have worked in a variety of industries throughout my career, which include:
• Manufacturing
• Consumer Products
• Virtualization
• Computer Infrastructure Management
• DoD Contracting

My experience spans these hardware types and operating systems:
• Desktop
o Windows (Full-stack: GUI, Application, Service, Kernel Driver)
o Linux (Application, Daemon)
• Mobile Devices
o Windows CE / Windows Phone
o Linux
• Embedded Devices
o VxWorks (RTOS)
o Greenhills Linux
o Embedded Windows XP

I am a Mentor and frequent contributor to CodeProject.com with tutorial articles that teach others about the inner workings of the Windows APIs.

I am the creator of an open source project on GitHub called Alchemy[^], which is an open-source compile-time data serialization library.

I maintain my own repository and blog at CodeOfTheDamned.com/[^], because code maintenance does not have to be a living hell.

Comments and Discussions