Page 1 of 1

Small FMOD-Visualizer (little OpenGL + source)

Posted: Thu Feb 02, 2006 1:30 pm
by Tomcat
Hello all together,

I've coded some time ago a small visualizer for FMOD in C++ and I've thought about converting this little demo to PB, since it uses a little bit OpenGL and it just needs pure CPU-power (which is easily done by PB :-)

Click here for a screenshot ~159kb

Click here for download (with sources) ~176kb

I've also included the sourcecode (hopefully, I've commented it good enough for you :-), so you can have an idea of how I've done it. If some of you like, I could also convert my "dancing fire" from my C++ version. Have fun!

Bye,
Tomek

Posted: Thu Feb 02, 2006 2:18 pm
by benny
@Tomcat:

That looks fantastic :!: Thanks for sharing the source ... will have a look into
it later on - very good job :!:

Posted: Thu Feb 02, 2006 2:53 pm
by KarLKoX
wow !! what a very nice effect !

Posted: Thu Feb 02, 2006 3:01 pm
by Fred
Very good ! About the WindowEvent() handling, you have to process all the events at each frame or some event will lag (try resizing the window):

It can look like this:

Code: Select all

  Repeat
    Select WindowEvent()
      Case #PB_Event_Menu
        [...]
      Case 0
        Break
    EndSelect
  ForEver
Then the resize works as expected :).

Posted: Thu Feb 02, 2006 5:45 pm
by Inf0Byt3
Tomcat, this is extremely usefull. Thanx for sharing. I am amazed again :wink:

Posted: Thu Feb 02, 2006 6:12 pm
by dmoc
Nice effect and thanks for the source!

Posted: Fri Feb 03, 2006 2:57 am
by Intrigued
Ditto the other comments, thanks!

Posted: Fri Feb 03, 2006 10:00 am
by Tomcat
Hi guys,

thanks again for your positive feedback :-) I've made some small modifications on the source (little speed-ups) and enabled the window to accept files (just drag & drop your file into the window).

@Fred: I've tried like you said, but then it just quits. Well, as long as it lag just a little bit, I can bear it :-)

Bye,
Tomek

Posted: Fri Feb 03, 2006 11:40 am
by benny
@Tomcat:

Just one little thing. Your app is rather cpu-consuming (~98%). Maybe you
add a little Delay() function or try to run it at a constant framerate.

Posted: Fri Feb 03, 2006 11:46 am
by dmoc
Yeah, I thought that too. Usually just "delay(1)" works fine. Or turn vsync on?

Posted: Fri Feb 03, 2006 11:47 am
by Baldrick
Excellent stuff Tomcat!!

Big thanks for sharing

Posted: Fri Feb 03, 2006 4:02 pm
by Tomcat
Hi benny and dmoc,

thanks for your suggestion, I've now added a small delay.

I've also added a second effect (a "dancing fire" :-) and already uploaded the new version (same link as before, screenshot is also updated).

Bye,
Tomek

Posted: Fri Feb 03, 2006 4:56 pm
by benny
@tomcat:

2nd fx is cool as well and work perfectly here, too :!:
Also the cpu-usage is now at a moderate state ... well done :!: