Archived

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

Sir_Spritely

RE: Solution ideas needed for problem

Recommended Posts

Okay I will try and explain this the best I can, if you have any further questions or need more explaining then reply to this. First off, I have key support to exit the DX application in the message Handler. This is the standard press escape to exit routine which is popular. What I am trying to do is add another key support using something like the F2 key to change the Transformations of the application. My problem lies in the message handler is in one cpp file and the transformation function is in another routine. I cannot just include the header file because this creates problems, so that is not an option. I also do not want to condense everything together as it would confuse matters later on. I am presuming I need to declare this somehow in the DX application header file, in the class but how? This is far less confusing if anyone reading this has the book Real-Time Rendering Tricks and Techniques in DirectX. I am attempting to do the 4th exercise at the end of chapter 9. I didn''t want to post code because there is a lot of it but if it''s essential then let me know. Thanks, Paul.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
ok say you have two different structs A and B.

  
//in A.h

struct A
{
void f();
};

//in B.h

struct B
{
void g();
};

//ok we have our headers set up, we need to write A::f

//but we need access to B, so we include it

#include "B.h"
void A::f()
{
B b;
b.do_something();
}

//then do the same thing for B, but you don''t

//have to include A.h unless B::g uses A


Share this post


Link to post
Share on other sites