• Advertisement

Archived

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

Dialogs within fullscreen Directx

This topic is 5623 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''m using Directx 6 and trying to get a dialog to display, I can load and display the dialog but the problem is that it disapears just after i display it, the functionality is there I just can''t see the dialog, do I have to lock the surfaces and flip to the GDI surafce to work, I dont have a clue on how to get this to work, and insight to my problem would be aprreciated. Thanks

Share this post


Link to post
Share on other sites
Advertisement
Hey, I had the same problem,
but this is for DirectX 7, I''m sure there are similar function calls in the previous version, just check the SDK reference.
I was writing a level editor for my sidescroller, I wanted a windows style "export map" dialog, so I used the GDI to make one of them, heres the code that did it:

OPENFILENAME ofn; // common dialog box structure
char szFile[260]; // buffer for file name
szFile[0] = ''\0'';
// Initialize OPENFILENAME
ZeroMemory(&ofn, sizeof(OPENFILENAME));
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = main_window_handle;
ofn.lpstrFile = szFile;
ofn.nMaxFile = sizeof(szFile);
ofn.lpstrFilter = "All\0*.*\0";
ofn.nFilterIndex = 1;
ofn.lpstrFileTitle = NULL;
ofn.nMaxFileTitle = 0;
ofn.lpstrInitialDir = NULL;
ofn.Flags = OFN_PATHMUSTEXIST | OFN_OVERWRITEPROMPT;

g_pDisplay->GetDirectDraw()->FlipToGDISurface();

// Display the Open dialog box.
if(GetSaveFileName(&ofn) <= 0)
return 0;


The key line here is:
g_pDisplay->GetDirectDraw()->FlipToGDISurface();

It tells DirectX to scoot over for a sec while the GDI surface is brought to the front. You didn''t mention whether you were using DirectDraw or Direct3D, but this was for directdraw, I bet theres some equivalent for direct3d rm or im in version 6. I guess just check out the sdk reference,

hope this helps,
rj

Share this post


Link to post
Share on other sites

  • Advertisement