Jump to content
  • Advertisement

Archived

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

Dealerz

Tile-Map Editor Question

This topic is 6910 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 making a tile-map editor and I''m planning on using slipframe windows, but I''m having a problem trying to create the DirectX window as child class in one of the frames? I''m using MFC becasue it has the splitFrame class to make things easy, but I can''t figure out how to applie the directx window to one of the windows in the frame. I hope some one could help me out.

Share this post


Link to post
Share on other sites
Advertisement
the problem is that you are trying to call SetCooperativeLevel with a child window, and ddraw requires that the hwnd passed be a top level window and not a child.

however, dont be dismayed. you can still limit directdraws output to the child window. first, pass NULL as the hwnd when calling SetCooperativeLevel. second, create a clipper, and use SetHWnd for that clipper, using the window handle of the child window(in MFC i believe its the GetSafeHWnd function).

always remember that in windowed directdraw, the primary screen consists of the entire surface, not just the client area of the window to which you are outputting, so using ClientToScreen to convert from the window''s coordinates to the primary surfaces coordinates is a must.

Share this post


Link to post
Share on other sites
Ok, thanks... one little question. I'm not fully understanding Windows programing because there is so much crap you have to do just to write 'Hello World' But in MFC using the SplitFrame they set it up as a CDoc class. do I use that class as the parent for the direct draw window? And inside that classes init function that's were I would setup the directx window, right? Thanks for the reply.

Edited by - Dealerz on May 18, 2000 10:59:04 PM

Share this post


Link to post
Share on other sites
Hi Dealerz,

A couple of recommendations for you. I like working with MFC and soon will learn DirectX. There are some great books out there that can help you better use both technologies. I strongly recommend them, as somebody recommended them to me:

DirectX Complete, by Michael D. Root, James R. Boer
(everything about DirectX EXCEPT Direct3D [you need another book about that] this book uses MFC with DirectX!!!)
ISBN: 0079137806

Visual C++ MFC Programming by Example, by John E. Swanke
(A must for any MFC developer, I love it)
ISBN: 879305444

The MFC Answer Book; by Eugene Kain (Preface), Scot Wingo
(You want to know all the tricks about splitter and other
not much discussed features ? THIS IS IT)
ISBN: 0201185377

Check out Amazon.com for the reviews.

What I would also suggest is use your CView (or CScrollView) class for the interface and use CDocument for your algorithm data processing.

Peter

PS: If you are still at the beginning of the road of MFC then you NEED to also get (you need to have some C++ skils):

Inside Visual C++ : Updated for Version 5.0 and Internet Development (Microsoft Programming Series)
by David J. Kruglinski
ISBN: 1572315652

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!