Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

dennizzz

dialog box

This topic is 5423 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I want a dialog box to appear first when I execute my OGL application. Just for showing a picture and a run and a cancel button. And maybe some resolutions choice (not very important)... any one knows where to find a nice and easy understanding example?

Share this post


Link to post
Share on other sites
Advertisement
The Nehe basecode pops up a dialog for the user to select whether they want fullscreen or not, why can''t you use that and modify it to suit your needs?

----------------
Amusing quote deleted at request of owner

Share this post


Link to post
Share on other sites
:O) i was doing this for the last few weeks, the example i could give tho is probably very confusing,im a noob and my code isnt exactly good.

http://apache.airnet.com.au/~praisegd/miscelanious/glwindowloader_bin.zip
http://apache.airnet.com.au/~praisegd/miscelanious/glwindowloader_src.zip

hope it helps

Share this post


Link to post
Share on other sites
I you are using win32/mfc try adding a resource script (and header), then use this code to load a dialog:

CDialog d;
d.Create(IDD_MYDIALOG);
d.DoModal();

This will create a dialog and return when the user clicks yes, no, ok, cancel or exits the window otherwise (=cancel).

Share this post


Link to post
Share on other sites
Just the other day, I unlazied enough to write something like this. It was rather simple, but it gets the job done. I made a small dialog window in Visual C++ 6 and saved the .rc. Then I wrote a header file for it, and now all I have to do is call one function. I''m proud of it :D

Basically, it''s a VideoSettings structure; it holds width, height, bits per pixel, and a fullscreen flag. You create a structure in the main function (or wherever you want), pass the pointer to the run function (with the handle of the instance of the application as well), and it''ll pop-up the dialog and grab settings. It''ll return one of a few predefined constants representing what button the user pressed. I use it similar to below:


#include "VideoSettings.h"

// Somewhere in main function

VideoSettings vs;
LRESULT Result;

Result = RunVideoSettings(hInstance, &vs);
if (Result == VS_ERROR)
{
MessageBox(NULL, "Error launching Video Settings dialog.", "Error", MB_OK | MB_ICONERROR);
// Shutdown stuff

return 0;
}
else if (Result == VS_EXIT)
{
// Quit program

return 0;
}

// Else, it returned VS_RUN, so run program here



Then I add the .rc file to the project.

and it looks like this:


and here''s the source if you want to use it:
VideoSettings.h
VideoSettings.rc

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!