Hi guys. First and foremost, read the book, and absolutely loved it! Gave me insight that other books just don't do. I've got LaMothe's Tricks and Tips of windows game programming gurus, also a few others, but none go into depth on anything aside from DirectX.
Anyway, I just need a bit of help with my User Interface code. I've created a graphic button class as follows:
class GraphicButton : public BitmapSprite
{
protected:
bool focus;
...etc
public:
virtual VOnMsgProc(AppMsg msg);
virtual VOnUpdate(const int deltaMilliseconds);
...etc
void OnMouseOver();
void OnMouseOut();
void OnClick();
}
Most of my GUI classes/components have been implemented this way.
Anyway this seems to work fine, the bitmap series loops when Mouse is Over it, goes back to frame 0 on mouse out, and clicking it will pass a result stating this button has been clicked to the calling code (i've used my own Screen classes to receive this msg to do something useful).
I know the problem might seem basic, but what I want to do is actually to add sound. I can do it when I add a smart pointer and launch the CSoundProcess, but because the button is declared in a seperate header file. UserInterface.h, it needs a public access to a ProcessManager.
I considered implementing another ProcessManager in my ScreenManager class. Or would I have to actually send an event to the sound sub system???
Anyway, I just need a bit of help with my User Interface code. I've created a graphic button class as follows:
class GraphicButton : public BitmapSprite
{
protected:
bool focus;
...etc
public:
virtual VOnMsgProc(AppMsg msg);
virtual VOnUpdate(const int deltaMilliseconds);
...etc
void OnMouseOver();
void OnMouseOut();
void OnClick();
}
Most of my GUI classes/components have been implemented this way.
Anyway this seems to work fine, the bitmap series loops when Mouse is Over it, goes back to frame 0 on mouse out, and clicking it will pass a result stating this button has been clicked to the calling code (i've used my own Screen classes to receive this msg to do something useful).
I know the problem might seem basic, but what I want to do is actually to add sound. I can do it when I add a smart pointer and launch the CSoundProcess, but because the button is declared in a seperate header file. UserInterface.h, it needs a public access to a ProcessManager.
I considered implementing another ProcessManager in my ScreenManager class. Or would I have to actually send an event to the sound sub system???
If you put your mind to it, you can accomplish anything.