Advertisement

Tile-Map Editor Question

Started by May 18, 2000 08:50 PM
2 comments, last by Dealerz 24 years, 7 months ago
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.
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.

Get off my lawn!

Advertisement
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
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

This topic is closed to new replies.

Advertisement