Advertisement

New Winamp GL Mini Contest

Started by December 16, 2004 12:41 PM
138 comments, last by esolem 19 years, 10 months ago
Quote: Original post by llvllatrix
I think thats my fault :) . When the window gets deinitialized it writes the window size/post to the config file. So if you try to configure the dimentions while the plugin is runnig, your settings wont take. If however, you configure while the visualization is not running, and then open the window, your configurations will take. I think we need to destroy and recreate the window in order to get the configuration dialog to work. I'm glad fullscreen is working tho :)


I do all my configuring of dimensions without the vis. running. I even can open the config file and look at it to confirm that it has the correct values, but when I run the vis. it uses the old ones. I suspect that a static variable is probably to blame or something. As for fullscreen, Bourricot's works fine, but mine is still 'temperamental'. The viewport seems to be a bit off so things look a bit squished so I'm still looking into it.
Yeeeeeehhhhaaaaaa!!!! Just got fullscreen working. YAY!

For those of you who are interested, here is my "hack-and-slash" fullscreen solution (probably not the best way but it works):

1) Enable the ESC key to quit in fullscreen mode
vis_wnd_proc() function in visualization_template.cpp

// edit the WM_KEYDOWN handler
case WM_KEYDOWN:
{
// never used this way of doing keys so I did it my way
//if(wnd_set_key_press(wParam, true))

if (vis_fullscreen && wParam == VK_ESCAPE)
{
// quit if in fullscreen
PostQuitMessage(0);
}
return 0;
}


2) Prevent using an embedded window. This ensures that the fullscreen call has the correct window size (the wamp_setup_wnd_state() call changes the size to handle the fancy winamp borders etc.)
wamp_module_init() function in wamp_module_functions.cpp

// change the lines under the "Check compatibility - version 5.0+ is required"
// comment to the following:
HWND h_wnd_parent = NULL;
if (!fullscreen)
{
h_wnd_parent = wamp_setup_wnd_state(*module);
if(!h_wnd_parent)
return 1;
}


3) Ensure that the window gets properly destroyed on quit (this solves the "unable to register window" error)
wamp_module_quit() function in wamp_module_functions.cpp:

// change this if statement to allow fullscreen mode through
// (as we don't have an embedded window any more)
if(wamp_wnd_state.me || fullscreen)
{
.
.
.

// just after the wamp_wnd_state.me state is destroyed, destroy the
// actual window. This was missing previously so the UnregisterClass
// was failing as the class still had an active window. Thus, trying to
// create a new window later would result in the "unable to
// register window" error
DestroyWindow(wamp_wnd_state.me);
// need to destroy the window here too
DestroyWindow(h_wnd);
UnregisterClass(module->module_title, module->hDllInstance);
}


Hope that helps anyone trying to get fullscreen going. As I said, its a bit of a hack and not too pretty but it works and that's good enough for me right now [smile]

Now I'm going to bed (its 1:30 am here). Will send my entry in after I've cleaned up the code a bit.
Advertisement
Weird, I'm logged in but seem to have posted anonymously. Lets try again (can't edit an anonymous post) with proper source tags [smile] Maybe a moderator can delete the previous post?

- Custard Slice


Yeeeeeehhhhaaaaaa!!!! Just got fullscreen working. YAY!

For those of you who are interested, here is my "hack-and-slash" fullscreen solution (probably not the best way but it works):

1) Enable the ESC key to quit in fullscreen mode
vis_wnd_proc() function in visualization_template.cpp
  // edit the WM_KEYDOWN handler  case WM_KEYDOWN:  {    // never used this way of doing keys so I did it my way    //if(wnd_set_key_press(wParam, true))				    if (vis_fullscreen && wParam == VK_ESCAPE)    {      // quit if in fullscreen      PostQuitMessage(0);    }    return 0;  }


2) Prevent using an embedded window. This ensures that the fullscreen call has the correct window size (the wamp_setup_wnd_state() call changes the size to handle the fancy winamp borders etc.)
wamp_module_init() function in wamp_module_functions.cpp
  // change the lines under the "Check compatibility - version 5.0+ is required"   // comment to the following:  HWND h_wnd_parent = NULL;  if (!fullscreen)  {    h_wnd_parent = wamp_setup_wnd_state(*module);    if(!h_wnd_parent)    return 1;   }


3) Ensure that the window gets properly destroyed on quit (this solves the "unable to register window" error)
wamp_module_quit() function in wamp_module_functions.cpp:
  // change this if statement to allow fullscreen mode through   // (as we don't have an embedded window any more)  if(wamp_wnd_state.me || fullscreen)  {     .     .     .     // just after the wamp_wnd_state.me state is destroyed, destroy the      // actual window. This was missing previously so the UnregisterClass     // was failing as the class still had an active window. Thus, trying to     // create a new window later would result in the "unable to      // register window" error     DestroyWindow(wamp_wnd_state.me);     // need to destroy the window here too     DestroyWindow(h_wnd);     UnregisterClass(module->module_title, module->hDllInstance);}


Hope that helps anyone trying to get fullscreen going. As I said, its a bit of a hack and not too pretty but it works and that's good enough for me right now [smile]

Now I'm going to bed (its 1:30 am here). Will send my entry in after I've cleaned up the code a bit.
Is there any way the fixes above can be worked into the sample code base? That way it saves time for everybody.
*News tagenigma.com is my new domain.
Quote:
Is there any way the fixes above can be worked into the sample code base? That way it saves time for everybody.


I'll see what I can do,
- llvllatrix
Thanks for yours encouragements.
Advertisement
Where is the cheapest place to get an FX card? I usually go through PriceWatch.com.
*News tagenigma.com is my new domain.
Just downloaded the base code and started on my project.

Unfortunatly I've been an ANSI C & ISO C++ complient complier user for along time, and now I have had to goto MSVC6 (reinstalled it, haven't bothered opening any of the boxes for the other microsoft compilers though) and one thing I have to really ask is:

Is there ANY way to force the MSVC compiler to handle the scope of variables correctly?


I mean

for(int i=0;i<4;i++);
for(int i=0;i<8;i++);

should not throw redefinition errors under ISO C++.

Well, now matter how much I like windows (yes, I actually do) I think I know the reason why it has some memory faults - some one probably used correct scoping whilst programming, yet the compiler buggered it up.


Anyway, if anyone knows which options to set to force it to scope things properly, it would be much appreciated.

Aside from that my reindeers kinematics are working well. Nice basecode, and I like the other demos that have been posted do far.
Beer - the love catalystgood ol' homepage
I've got an entry too!
You can find it @
http://www.marco-we.de/mweber_winamp_plugin.zip
Visit my website now, at http://www.vanbirk.de !
Quote:
Where is the cheapest place to get an FX card?


lol, this contest ;)

This topic is closed to new replies.

Advertisement