hi @ all,
nachdem ich mein system (vista) neu aufgesetzt habe, habe ich vc++ ee 2008, platform sdk und dx sdk dez. 2005 installiert. danach dann das fenster programm geschrieben. ging ohne probleme. nachdem ich aber das 2. programm geschrieben habe, übersetzt mir der compiler das programm, bricht es aber bei tb_canceled ab. hier der quellcode
|
C-/C++-Quelltext
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
#include <windows.h>
#include <tribase.h>
#include "../../../../Beispiele/Allgemeines/InitWindow.h"
#include "../../../../Beispiele/Allgemeines/Direct3DEnum.h"
#include "../../../../Beispiele/Allgemeines/InitDirect3D.h"
#include <mfc/afxres.h>
tbResult Render(float fNumSesPassed)
{
return TB_OK;
}
tbResult Move(float fNumSecsPassed)
{
return TB_OK;
}
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
tbInit();
SDirect3DParameters Direct3Dparams;
tbResult Result = GetDirect3DParameters(&Direct3Dparams);
if(Result == NULL)
{
tbWriteToLog("Fehler beim abzählen");
tbExit();
return 1;
}
else if(Result == TB_CANCELED)
{
tbWriteToLog("hier ist ende im gelände");
tbExit();
return 0;
}
if(InitWindow(Direct3Dparams.VideoMode.Width,
Direct3Dparams.VideoMode.Height,
"Beispielprogramm 2",
LoadIcon(NULL, IDI_WINLOGO)))
{
tbWriteToLog("Fehler beim erstellen des Fensters!");
tbExit();
return 1;
}
if(InitDirect3D(&Direct3Dparams, g_hWindow))
{
tbWriteToLog("Fehler beim initialisieren von Direct3D!");
ExitWindow();
tbExit();
return 1;
}
tbDoMessageLoop(Render, Move);
ExitDirect3D();
ExitWindow();
tbExit();
return 0;
}
|