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
|
#include <Windows.h>
#include <TriBase.h>
#include "InitWindow.h"
#include "Direct3DEnum.h"
#include "InitDirect3D.h"
#include "E:\CD.exe\Beispiele\Kapitel 02\01 - Fenster\Resource.h"
tbResult Render(float fNumSecsPassed)
{
return TB_OK;
}
tbResult Move(float fNumSecsPassed)
{
return TB_OK;
}
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, char* pcCmdLine, int iShowCmd)
{
tbInit();
SDirect3DParameters Direct3DParameters;
tbResult Result = GetDirect3DParameters(&Direct3DParameters);
if(Result == TB_ERROR)
{
MessageBox(NULL, "Fehler beim Abzählen!", "Fehler", MB_OK | MB_ICONEXCLAMATION);
tbExit();
return 1;
}
else if(Result == TB_CANCELED)
{
tbExit();
return 0;
}
if(InitWindow(Direct3DParameters.VideoMode.Width,
Direct3DParameters.VideoMode.Height,
"Beispielprogramm Nr. 2: Direct3D-Abzählung",
LoadIcon(hInstance, MAKEINTRESOURCE(IDI_ICON1))))
{
MessageBox(NULL, "Fehler beim Erstellen des Fensters!", "Fehler", MB_OK | MB_ICONEXCLAMATION);
tbExit();
return 1;
}
if(InitDirect3D(&Direct3DParameters, g_hWindow))
{
MessageBox(g_hWindow, "Fehler beim Initialisieren von Direct3D!", "Fehler", MB_OK | MB_ICONEXCLAMATION);
ExitWindow();
tbExit();
return 1;
}
tbDoMessageLoop(Render, Move);
ExitDirect3D();
ExitWindow();
tbExit();
return 0;
}
|