Modifying Irrlicht

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Guest

Modifying Irrlicht

Post by Guest »

Ok, I tried adding audio functionality into Irrlicht using Audiere and FMOD, at first I was using it inside the code of my app and it was working fine. Now, I decided to put it in the Irrlicht dll, so I added the sources and the headers to the Irrlicht project.

To create the device I use a function similar to Irrlicht's createDevice function called createAudioDevice. To add it to the dll exports I put the declaration inside irrlicht.h just below the declaration of createDevice like this:

Code: Select all

	IRRLICHT_API IrrlichtDevice* createDevice(
		video::EDriverType deviceType = video::EDT_SOFTWARE, 
		const core::dimension2d<s32>& windowSize = core::dimension2d<s32>(640,480),
		u32 bits = 16,
		bool fullscreen = false,
		bool stencilbuffer=false,
		IEventReceiver* receiver = 0,
		const wchar_t* sdk_version_do_not_use = IRRLICHT_SDK_VERSION);

    //! Creates an Audio device. deviceType can be audio::EAD_NULL, audio::EAD_AUDIERE or audio::EAD_FMOD (if compiled with USE_FMOD)
    IRRLICHT_API audio::IAudioDevice* createAudioDevice(audio::eAudioDevice deviceType, bool music);
When I try to compile I get the following error:

syntax error before '*' token

What am I doing wrong??
l0calh05t
Posts: 68
Joined: Wed Apr 07, 2004 7:08 pm

Post by l0calh05t »

19 views and no reply? should i repost this in the advanced help forum? ( was somehow logged out as i posted this message)

EDIT btw, the code is displayed wrong, the comment is in one line in reality (as it should be)
Raw data for raw nerves

My main PC: Athlon XP 2800+, 512MB RAM, ATI Radeon 9700 Pro 128MB, Win2k SP4
My secondary PC: Pentium III 500 Mhz, 256MB RAM, TNT2 64, Gentoo Linux
warui
Posts: 232
Joined: Wed Apr 14, 2004 12:06 pm
Location: Lodz, Poland
Contact:

Post by warui »

The error is in the line you added i assume (remember next time to state in which line is an error if you post multiline codes). Can you post your IAudioDevice definition with namespaces ? And what is IRRLICHT_API ?
Tomasz Nowakowski
Openoko - www.openoko.pl
l0calh05t
Posts: 68
Joined: Wed Apr 07, 2004 7:08 pm

Post by l0calh05t »

warui wrote:The error is in the line you added i assume (remember next time to state in which line is an error if you post multiline codes). Can you post your IAudioDevice definition with namespaces ? And what is IRRLICHT_API ?
yes, the error is in that line.

Here's my IAudioDevice.h file:

Code: Select all

#ifndef __I_AUDIO_DEVICE_H_INCLUDED__
#define __I_AUDIO_DEVICE_H_INCLUDED__

#include "irrlicht.h"

namespace irr
{
namespace audio
{

enum eAudioDevice
{
    EAD_AUDIERE = 0,
#ifdef USE_FMOD
    EAD_FMOD,
#endif
    EAD_NULL
};

enum eSound
{
    kThump = 0,
    kGunshot
};

class IAudioDevice : public irr::IUnknown
{
public:
    virtual ~IAudioDevice() {};

    virtual void playSound(eSound sound) = 0;
    virtual void playSound(eSound sound,
        const irr::core::vector3df &position,
        const irr::core::vector3df &playerposition) = 0;
    
    virtual void toggleMusic() = 0;

protected:
    virtual void init() = 0;
};
}
}

#endif
what IRRLICHT_API is is defined like this (it's the original code from irrlicht.h):

Code: Select all

#ifdef WIN32
#ifdef IRRLICHT_EXPORTS
#define IRRLICHT_API __declspec(dllexport)
#else
#define IRRLICHT_API __declspec(dllimport)
#endif // IRRLICHT_EXPORT
#else
#define IRRLICHT_API 
#endif // WIN32
Hope this helps.
Raw data for raw nerves

My main PC: Athlon XP 2800+, 512MB RAM, ATI Radeon 9700 Pro 128MB, Win2k SP4
My secondary PC: Pentium III 500 Mhz, 256MB RAM, TNT2 64, Gentoo Linux
warui
Posts: 232
Joined: Wed Apr 14, 2004 12:06 pm
Location: Lodz, Poland
Contact:

Post by warui »

I added the same and everything compiles fine with DevCpp. Did you included IAudioDevice.h (sorry for stupid question, but it's only thing that comes to my mind) ? Are you sure it is included correctly ? Maybe you compiler just don't see it (but it should give an error message then).
Tomasz Nowakowski
Openoko - www.openoko.pl
l0calh05t
Posts: 68
Joined: Wed Apr 07, 2004 7:08 pm

Post by l0calh05t »

no it's in the irrlicht include directory.
and
IRRLICHT_API audio::IAudioDevice* createAudioDevice(audio::eAudioDevice deviceType, bool music);

is the declaration of the function createAudioDevice so it shouldn't make much of a difference anyways :(
Raw data for raw nerves

My main PC: Athlon XP 2800+, 512MB RAM, ATI Radeon 9700 Pro 128MB, Win2k SP4
My secondary PC: Pentium III 500 Mhz, 256MB RAM, TNT2 64, Gentoo Linux
Post Reply