Background music

kinggori

13-02-2007 18:29:19

Hi guys

sorry for bothering you again :(

ok, so I'm still stuck lol. I'm trying to get a very simple backgroud sound running. So here is what I did

To make sure I'm not interfering with any of ogre's other functions I went to the main function and first thing in main I put:

OgreAL::SoundManager *soundManager;
soundManager = new OgreAL::SoundManager();
OgreAL::Sound *bgSound = soundManager->createSound("roar", "roar.wav", true);
bgSound->setRelativeToListener(true);
bgSound->play();


at the very top of that same file I put:

#include "OgreAL.h"
#include "OgreALListener.h"
#include "OgreALSoundManager.h"


This should be like the simplest test ever. Nothing should go wrong... but...when I build i get the error

Error 1 error C2512: 'OgreAL::SoundManager' : no appropriate default constructor available c:\mydev\LIAV\src\CAXApplication.cpp 341

any ideas what's wrong here? :(

Bagheera

13-02-2007 21:38:52

Funny question, but the error reports to the line you posted right? This bit of code?


OgreAL::SoundManager *soundManager;
soundManager = new OgreAL::SoundManager();


Because the same code works for me... I'm guessing you're trying to make another instant of OgreAL::SoundManager somewhere else in your code?

CaseyB

13-02-2007 21:58:20

In v0.2 you needed to pass in a pointer to the SceneManager, so you can either do that or update from SVN to fix this problem.

kinggori

14-02-2007 01:42:24

In v0.2 you needed to pass in a pointer to the SceneManager, so you can either do that or update from SVN to fix this problem.

thanks for your reply

so I guess I have 2 options. Is passing a pointer easy? I have no idea how this could be done


If I update from SVN how do I actually install/update? The stable version was a downloadable zip but the SVNs are just many files and they're not zipped.
And how do I know which version of ogre i have, Ogre 1.2 Dagon or Ogre 1.4 Eihort?


Sorry Casey for all the questions. Do you think I'm dumb or is it just bad luck? :wink:

CaseyB

14-02-2007 03:01:13

Is passing a pointer easy? I have no idea how this could be doneThen I would recommend that you put Ogre on the back burner for a while and spend some time learning the basics of C++. I don't think you are stupid or bad luck! In fact I admire your enthusiasm and that is why I make my suggestion! I don't want to see you get frustrated and give up!

kinggori

14-02-2007 03:25:17

Is passing a pointer easy? I have no idea how this could be doneThen I would recommend that you put Ogre on the back burner for a while and spend some time learning the basics of C++. I don't think you are stupid or bad luck! In fact I admire your enthusiasm and that is why I make my suggestion! I don't want to see you get frustrated and give up!

thanks for your reply :)
of course I know what pointers are but I have no idea where I have to pass the pointer coz I haven’t really looked at OgreAL's source code. Doesn’t the beauty of object-orientedness revolve around using the libraries without actually knowing any of the code inside? :)

Anyhow, I'll try updating my library so that the empty construct is available. I’ll let you know how things go.

t0tAl_mElTd0wN

15-02-2007 17:02:37

There's a sticky thread with the link to the documentation of OgreAL. In there you'll find the function (is it the constructor? I don't use that version) that you're looking for.

kungfoomasta

19-02-2007 23:54:37

So for the SVN version, are sounds movable objects that can be attached to Scene Nodes, or what is the proper way to sync with a Scene Node?

Thanks in advance,

KungFooMasta

[edit] scrolled down a little in the svn manual, and saw that it says you can attach to scene node. [/edit]

CaseyB

20-02-2007 00:48:41

It's never been the other way. Sounds have been MovableObjects from the beginning.