--- week1oplossing/Week1Oplossing.cpp (revision 4)
+++ week1oplossing/Week1Oplossing.cpp (revision 10)
@@ -9,7 +9,7 @@
// Include Files
//-----------------------------------------------------------------
#include "Week1Oplossing.h"
-
+#include "functionpointer.h"
//-----------------------------------------------------------------
// Week1Oplossing methods
//-----------------------------------------------------------------
@@ -17,7 +17,8 @@
Week1Oplossing::Week1Oplossing()
{
// nothing to create
- onetime =0;
+ mFptest = new functionpointertest(this);
+
}
Week1Oplossing::~Week1Oplossing()
@@ -29,7 +30,9 @@
{
AbstractGame::GameInitialize(hInstance);
- GAME_ENGINE->SetTitle(_T("Week1Oplossing"));
+ GAME_ENGINE->SetTitle(_T("Week1Oplossing"));
+
+ GAME_ENGINE->MessageBox(_T("yow"));
}
void Week1Oplossing::GameStart()
@@ -54,11 +57,12 @@
//lijst4+=lijst1;
//lijst4 = lijst4;
+ mFptest->setfunction(&Week1Oplossing::MyPwnFunction);
}
void Week1Oplossing::GamePaint(RECT rect)
{
- Vector3 Vector1PTR;
+ /*Vector3 Vector1PTR;
Vector3 Vector2PTR;
Vector3 Vector3PTR;
Vector3 Vector4PTR;
@@ -73,7 +77,7 @@
tstring temp;
temp = _T("lol ");
- GAME_ENGINE->DrawString(temp+Vector1PTR,100,10+(20*0));
+ GAME_ENGINE->DrawString(temp+Vector1PTR,100,10+(20*0));*/
// GAME_ENGINE->DrawString(Vector2PTR.ToString(),100,10+(20*1));
// GAME_ENGINE->DrawString(Vector3PTR.ToString(),100,10+(20*2));
@@ -121,4 +125,10 @@
// GAME_ENGINE->DrawString(test.str(),100,10+(20*++i));
// test.str(_T(""));
+}
+
+
+void Week1Oplossing::MyPwnFunction(int i)
+{
+ GAME_ENGINE->MessageBox(i);
}
\ No newline at end of file
--- week1oplossing/Week1Oplossing.h (revision 2)
+++ week1oplossing/Week1Oplossing.h (revision 10)
@@ -18,6 +18,9 @@
#include "KeyValueLijst.h"
#include "KeyValuePaar.h"
#include "vector3.h"
+
+class functionpointertest;
+
using namespace Machiel;
//-----------------------------------------------------------------
// Week1Oplossing Class
@@ -42,17 +45,20 @@
void GameInitialize(HINSTANCE hInstance);
void GameStart();
void GamePaint(RECT rect);
+ void MyPwnFunction(int i);
private:
// -------------------------
// Datamembers
// -------------------------
- int onetime;
- IntLijst lijst1;
- IntLijst lijst2;
- IntLijst lijst3;
- IntLijst lijst4;
+// int onetime;
+// IntLijst lijst1;
+// IntLijst lijst2;
+// IntLijst lijst3;
+// IntLijst lijst4;
+functionpointertest *mFptest;
+
// -------------------------
// Disabling default copy constructor and default assignment operator.
// If you get a linker error from one of these functions, your class is internally trying to use them. This is
--- week1oplossing/Week1Oplossing.vcproj (revision 1)
+++ week1oplossing/Week1Oplossing.vcproj (revision 10)
@@ -171,6 +171,14 @@
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
+ RelativePath=".\functionpointer.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\functionpointer.h"
+ >
+ </File>
+ <File
RelativePath=".\IntLijst.cpp"
>
</File>