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
|
#include<Windows.h>
#include<TriBase.h>
#include"InitWindow.h"
#include"Direct3DEnum.h"
#include"InitDirect3D.h"
#include"resource.h"
#pragma comment(lib,"TriBaseD.lib")
//Renderfunktion (leer)
tbResult Render(float fNumSecsPassed)
{
return TB_OK;
}
//Move Funktion(Leer)
tbResult Move(float fNumSecsPassed)
{
return TB_OK;
}
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, char* pcCmdLine,int iShowCmd)
{
//Tribase Engine Intialisieren
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;
}
//Fenster intialisieren Die größe hängt vom gewähltern videomodus ab, der in derparameterstruktur gespeichert ist
if(InitWindow(Direct3DParameters.VideoMode.Width,
Direct3DParameters.VideoMode.Height,
"BEISPIELPROGRAMM 2: Direct Aufzählung",
LoadIcon(hInstance,MAKEINTRESOURCE(IDI_ICON1))))
{
//Fehler beim erstellen
MessageBox(NULL,"FEHLER BEIM ERSTELLEN FENSTER","FEHLER",MB_OK|MB_ICONEXCLAMATION);
tbExit();
return 1;
}
if(InitDirect3D(&Direct3DParameters,g_hWindow))
{
//FEHLER
MessageBox(g_hWindow,"FEHLER beim intialisieren von direct3d","FEHLER",MB_OK|MB_ICONEXCLAMATION);
ExitWindow();
tbExit();
return 1;
}
tbDoMessageLoop(Render,Move);
//Direct 3d und Fenster Herunterfahren
ExitDirect3D();
ExitWindow();
tbExit();
return 0;
}
|