Du bist nicht angemeldet.

Stilllegung des Forums
Das Forum wurde am 05.06.2023 nach über 20 Jahren stillgelegt (weitere Informationen und ein kleiner Rückblick).
Registrierungen, Anmeldungen und Postings sind nicht mehr möglich. Öffentliche Inhalte sind weiterhin zugänglich.
Das Team von spieleprogrammierer.de bedankt sich bei der Community für die vielen schönen Jahre.
Wenn du eine deutschsprachige Spieleentwickler-Community suchst, schau doch mal im Discord und auf ZFX vorbei!

Werbeanzeige

1

15.11.2009, 11:12

[Erstes Spiel] Hagelt voller Fehler

Hallo zusammen,
nachdem ich das 7. Kapitel gelesen hatte, dache ich mir, dass
ich mal versuche ein eigenes Spiel zu schreiben.
Ich hab mich dann für Tic Tac Toe entschieden.
Als ich dann das Intro und die Standartklasse fertig geschrieben hatte,
wollte ich mal sehen ob es funktioniert aber es hagelte nur so von Fehlern.
Hab ich vergessen eine Datei zu linken, weil er den Bezeichner "tbResult" anscheinend gar nicht kennt?

BuildLog:

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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
Kompilieren...
Game.cpp
Intro.cpp
c:\meineprojekte\tic tac toe\tic tac toe\intro.h(4) : error C2146: Syntaxfehler: Fehlendes ';' vor Bezeichner 'm_pBackground'
c:\meineprojekte\tic tac toe\tic tac toe\intro.h(4) : error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
c:\meineprojekte\tic tac toe\tic tac toe\intro.h(4) : error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
c:\meineprojekte\tic tac toe\tic tac toe\intro.h(8) : error C2146: Syntaxfehler: Fehlendes ';' vor Bezeichner 'Init'
c:\meineprojekte\tic tac toe\tic tac toe\intro.h(8) : error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
c:\meineprojekte\tic tac toe\tic tac toe\intro.h(8) : error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
c:\meineprojekte\tic tac toe\tic tac toe\intro.h(8) : warning C4183: 'Init': Rückgabetyp fehlt; Memberfunktion, die 'int' zurückgibt wird angenommen
c:\meineprojekte\tic tac toe\tic tac toe\intro.h(9) : error C2146: Syntaxfehler: Fehlendes ';' vor Bezeichner 'Exit'
c:\meineprojekte\tic tac toe\tic tac toe\intro.h(9) : error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
c:\meineprojekte\tic tac toe\tic tac toe\intro.h(9) : error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
c:\meineprojekte\tic tac toe\tic tac toe\intro.h(9) : warning C4183: 'Exit': Rückgabetyp fehlt; Memberfunktion, die 'int' zurückgibt wird angenommen
c:\meineprojekte\tic tac toe\tic tac toe\intro.h(10) : error C2146: Syntaxfehler: Fehlendes ';' vor Bezeichner 'Load'
c:\meineprojekte\tic tac toe\tic tac toe\intro.h(10) : error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
c:\meineprojekte\tic tac toe\tic tac toe\intro.h(10) : error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
c:\meineprojekte\tic tac toe\tic tac toe\intro.h(10) : warning C4183: 'Load': Rückgabetyp fehlt; Memberfunktion, die 'int' zurückgibt wird angenommen
c:\meineprojekte\tic tac toe\tic tac toe\intro.h(11) : error C2146: Syntaxfehler: Fehlendes ';' vor Bezeichner 'Unload'
c:\meineprojekte\tic tac toe\tic tac toe\intro.h(11) : error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
c:\meineprojekte\tic tac toe\tic tac toe\intro.h(11) : error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
c:\meineprojekte\tic tac toe\tic tac toe\intro.h(11) : warning C4183: 'Unload': Rückgabetyp fehlt; Memberfunktion, die 'int' zurückgibt wird angenommen
c:\meineprojekte\tic tac toe\tic tac toe\intro.h(12) : error C2146: Syntaxfehler: Fehlendes ';' vor Bezeichner 'Move'
c:\meineprojekte\tic tac toe\tic tac toe\intro.h(12) : error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
c:\meineprojekte\tic tac toe\tic tac toe\intro.h(12) : error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
c:\meineprojekte\tic tac toe\tic tac toe\intro.h(12) : warning C4183: 'Move': Rückgabetyp fehlt; Memberfunktion, die 'int' zurückgibt wird angenommen
c:\meineprojekte\tic tac toe\tic tac toe\intro.h(13) : error C2146: Syntaxfehler: Fehlendes ';' vor Bezeichner 'Render'
c:\meineprojekte\tic tac toe\tic tac toe\intro.h(13) : error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
c:\meineprojekte\tic tac toe\tic tac toe\intro.h(13) : error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
c:\meineprojekte\tic tac toe\tic tac toe\intro.h(13) : warning C4183: 'Render': Rückgabetyp fehlt; Memberfunktion, die 'int' zurückgibt wird angenommen
c:\meineprojekte\tic tac toe\tic tac toe\intro.h(6) : error C3861: "ZeroMemory": Bezeichner wurde nicht gefunden.
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(5) : error C2146: Syntaxfehler: Fehlendes ';' vor Bezeichner 'vPosition'
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(5) : error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(5) : error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(7) : error C2146: Syntaxfehler: Fehlendes ';' vor Bezeichner 'Color'
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(7) : error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(7) : error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(8) : error C2146: Syntaxfehler: Fehlendes ';' vor Bezeichner 'vTex0'
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(8) : error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(8) : error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(9) : error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(9) : error C2146: Syntaxfehler: Fehlendes ';' vor Bezeichner 'dwFVF'
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(9) : error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(12) : error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(12) : error C2653: 'STitleVertex': Keine Klasse oder Namespace
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(12) : error C2146: Syntaxfehler: Fehlendes ';' vor Bezeichner 'dwFVF'
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(12) : error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(12) : error C2065: 'D3DFVF_XYZRHW': nichtdeklarierter Bezeichner
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(12) : error C2065: 'D3DFVF_DIFFUSE': nichtdeklarierter Bezeichner
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(12) : error C2065: 'D3DFVF_TEX1': nichtdeklarierter Bezeichner
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(14) : error C2143: Syntaxfehler: Es fehlt ';' vor 'CIntro::Init'
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(14) : error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(15) : error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(16) : error C2065: 'TB_ERROR': nichtdeklarierter Bezeichner
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(16) : error C3861: "TB_ERROR": Bezeichner wurde nicht gefunden.
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(18) : error C2065: 'TB_OK': nichtdeklarierter Bezeichner
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(21) : error C2143: Syntaxfehler: Es fehlt ';' vor 'CIntro::Exit'
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(21) : error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(21) : error C2086: 'int tbResult': Neudefinition
        c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(14): Siehe Deklaration von 'tbResult'
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(22) : error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(25) : error C2065: 'TB_OK': nichtdeklarierter Bezeichner
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(28) : error C2143: Syntaxfehler: Es fehlt ';' vor 'CIntro::Load'
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(28) : error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(28) : error C2086: 'int tbResult': Neudefinition
        c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(14): Siehe Deklaration von 'tbResult'
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(29) : error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(30) : error C2065: 'm_pBackground': nichtdeklarierter Bezeichner
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(30) : error C2653: 'tbTextureManager': Keine Klasse oder Namespace
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(30) : error C2228: Links von ".GetTexture" muss sich eine Klasse/Struktur/Union befinden.
        Typ ist ''unknown-type''
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(30) : error C3861: "Instance": Bezeichner wurde nicht gefunden.
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(31) : error C2065: 'm_pBackground': nichtdeklarierter Bezeichner
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(31) : error C2065: 'NULL': nichtdeklarierter Bezeichner
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(31) : error C2065: 'TB_ERROR': nichtdeklarierter Bezeichner
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(31) : error C3861: "TB_ERROR": Bezeichner wurde nicht gefunden.
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(32) : error C2065: 'TB_OK': nichtdeklarierter Bezeichner
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(35) : error C2143: Syntaxfehler: Es fehlt ';' vor 'CIntro::Unload'
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(35) : error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(35) : error C2086: 'int tbResult': Neudefinition
        c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(14): Siehe Deklaration von 'tbResult'
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(36) : error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(37) : error C2653: 'tbTextureManager': Keine Klasse oder Namespace
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(37) : error C2146: Syntaxfehler: Fehlendes ';' vor Bezeichner 'ReleaseTexture'
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(37) : error C3861: "Instance": Bezeichner wurde nicht gefunden.
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(37) : error C2065: 'm_pBackground': nichtdeklarierter Bezeichner
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(37) : error C3861: "ReleaseTexture": Bezeichner wurde nicht gefunden.
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(38) : error C2065: 'TB_OK': nichtdeklarierter Bezeichner
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(41) : error C2143: Syntaxfehler: Es fehlt ';' vor 'CIntro::Move'
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(41) : error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(41) : error C2086: 'int tbResult': Neudefinition
        c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(14): Siehe Deklaration von 'tbResult'
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(42) : error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(42) : error C2511: 'int CIntro::Move(void)': Überladene Memberfunktion nicht in 'CIntro' gefunden
        c:\meineprojekte\tic tac toe\tic tac toe\intro.h(2): Siehe Deklaration von 'CIntro'
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(50) : error C2143: Syntaxfehler: Es fehlt ';' vor 'CIntro::Render'
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(50) : error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(50) : error C2086: 'int tbResult': Neudefinition
        c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(14): Siehe Deklaration von 'tbResult'
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(51) : error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(51) : error C2511: 'int CIntro::Render(void)': Überladene Memberfunktion nicht in 'CIntro' gefunden
        c:\meineprojekte\tic tac toe\tic tac toe\intro.h(2): Siehe Deklaration von 'CIntro'
MainMenu.cpp
c:\meineprojekte\tic tac toe\tic tac toe\mainmenu.h(4) : error C2146: Syntaxfehler: Fehlendes ';' vor Bezeichner 'm_pBackground'
c:\meineprojekte\tic tac toe\tic tac toe\mainmenu.h(4) : error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
c:\meineprojekte\tic tac toe\tic tac toe\mainmenu.h(4) : error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
c:\meineprojekte\tic tac toe\tic tac toe\mainmenu.h(9) : error C2146: Syntaxfehler: Fehlendes ';' vor Bezeichner 'Init'
c:\meineprojekte\tic tac toe\tic tac toe\mainmenu.h(9) : error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
c:\meineprojekte\tic tac toe\tic tac toe\mainmenu.h(9) : error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
c:\meineprojekte\tic tac toe\tic tac toe\mainmenu.h(9) : warning C4183: 'Init': Rückgabetyp fehlt; Memberfunktion, die 'int' zurückgibt wird angenommen
c:\meineprojekte\tic tac toe\tic tac toe\mainmenu.h(10) : error C2146: Syntaxfehler: Fehlendes ';' vor Bezeichner 'Exit'
c:\meineprojekte\tic tac toe\tic tac toe\mainmenu.h(10) : error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
c:\meineprojekte\tic tac toe\tic tac toe\mainmenu.h(10) : error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
c:\meineprojekte\tic tac toe\tic tac toe\mainmenu.h(10) : warning C4183: 'Exit': Rückgabetyp fehlt; Memberfunktion, die 'int' zurückgibt wird angenommen
c:\meineprojekte\tic tac toe\tic tac toe\mainmenu.h(11) : error C2146: Syntaxfehler: Fehlendes ';' vor Bezeichner 'Load'
c:\meineprojekte\tic tac toe\tic tac toe\mainmenu.h(11) : error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
c:\meineprojekte\tic tac toe\tic tac toe\mainmenu.h(11) : error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
c:\meineprojekte\tic tac toe\tic tac toe\mainmenu.h(11) : warning C4183: 'Load': Rückgabetyp fehlt; Memberfunktion, die 'int' zurückgibt wird angenommen
c:\meineprojekte\tic tac toe\tic tac toe\mainmenu.h(12) : error C2146: Syntaxfehler: Fehlendes ';' vor Bezeichner 'Unload'
c:\meineprojekte\tic tac toe\tic tac toe\mainmenu.h(12) : error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
c:\meineprojekte\tic tac toe\tic tac toe\mainmenu.h(12) : error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
c:\meineprojekte\tic tac toe\tic tac toe\mainmenu.h(12) : warning C4183: 'Unload': Rückgabetyp fehlt; Memberfunktion, die 'int' zurückgibt wird angenommen
c:\meineprojekte\tic tac toe\tic tac toe\mainmenu.h(13) : error C2146: Syntaxfehler: Fehlendes ';' vor Bezeichner 'Move'
c:\meineprojekte\tic tac toe\tic tac toe\mainmenu.h(13) : error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
c:\meineprojekte\tic tac toe\tic tac toe\mainmenu.h(13) : error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
c:\meineprojekte\tic tac toe\tic tac toe\mainmenu.h(13) : warning C4183: 'Move': Rückgabetyp fehlt; Memberfunktion, die 'int' zurückgibt wird angenommen
c:\meineprojekte\tic tac toe\tic tac toe\mainmenu.h(14) : error C2146: Syntaxfehler: Fehlendes ';' vor Bezeichner 'Render'
c:\meineprojekte\tic tac toe\tic tac toe\mainmenu.h(14) : error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
c:\meineprojekte\tic tac toe\tic tac toe\mainmenu.h(14) : error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
c:\meineprojekte\tic tac toe\tic tac toe\mainmenu.h(14) : warning C4183: 'Render': Rückgabetyp fehlt; Memberfunktion, die 'int' zurückgibt wird angenommen
c:\meineprojekte\tic tac toe\tic tac toe\mainmenu.h(7) : error C2065: 'CMainmenu': nichtdeklarierter Bezeichner
c:\meineprojekte\tic tac toe\tic tac toe\mainmenu.h(7) : error C2070: ''unknown-type'': Ungültiger sizeof-Operand
c:\meineprojekte\tic tac toe\tic tac toe\mainmenu.h(7) : error C3861: "ZeroMemory": Bezeichner wurde nicht gefunden.
TicTacToe.cpp
c:\meineprojekte\tic tac toe\tic tac toe\mainmenu.h(7) : error C2065: 'CMainmenu': nichtdeklarierter Bezeichner
c:\meineprojekte\tic tac toe\tic tac toe\mainmenu.h(7) : error C2070: ''unknown-type'': Ungültiger sizeof-Operand
c:\meineprojekte\tic tac toe\tic tac toe\intro.h(2) : error C2011: 'CIntro': 'class' Typneudefinition
        c:\meineprojekte\tic tac toe\tic tac toe\intro.h(2): Siehe Deklaration von 'CIntro'
c:\meineprojekte\tic tac toe\tic tac toe\mainmenu.h(2) : error C2011: 'CMainMenu': 'class' Typneudefinition
        c:\meineprojekte\tic tac toe\tic tac toe\mainmenu.h(2): Siehe Deklaration von 'CMainMenu'
c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.h(2) : fatal error C1014: Zu viele Headerdateien: Tiefe = 1024
Code wird generiert...


TicTacToe.cpp

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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
#include "TicTacToe.h"

CTicTacToe* g_pTicTacToe;
float*          g_pfButtons = NULL;
BOOL*           g_pbButtons = NULL;

int WINAPI WinMain(HINSTANCE hInstance,
                   HINSTANCE hPrevInstance,
                   char* pcCommandLine,
                   int iShowCommand)
{
    tbResult r;
    g_pTicTacToe = new CTicTacToe;
    r = g_pTicTacToe->Init();
    if(r == TB_CANCELED)
    {
        TB_SAFE_DELETE(g_pTicTacToe);
        return 0;
    }
    else if(r)
    {
        TB_SAFE_DELETE(g_pTicTacToe);
        MessageBox(0,"Fehler beim Initialisieren des Spiels", "Fehler", MB_OK | MB_ICONEXCLAMATION);
        return 1;
    }

    if(g_pTicTacToe->Run())
    {
        g_pTicTacTie->Exit();
        TB_SA FE_DELETE(g_pTicTacToe);
        MessageBox(0, "Fehler im Spiel", "Fehler", MB_OK | MB_ICONEXLAMATION);
        return 1;
    }

    g_pTicTacToe->Exit;
    TB_SAFE_DELETE(g_pTicTacToe);
    return 0;
}

tbResult CTicTacToe::Init()
{
    tbResult r;
    
    ZeroMemory(this, sizeof(CTicTacToe));

    if(tbInit()) return TB_ERROR;
    r = tbDoConfigDialog(&m_Config)
    if(r == CANCELED) return TB_CANCELED;
    else if(r) TB_ERROR("Engine konnte nicht Initialisiert werden", r);  
    
    if(Load()) TB_ERROR("Fehler beim Laden des Spiels", TB_ERROR);

    m_pIntro = new CIntro;
    m_pMainMenu = new CMainMenu;
    m_pGame = new CGame;

    SetGameStat(GS_INTRO);

    return TB_OK;
}

tbResult CTicTacToe::Exit()
{
    SetGameStat(GS_NONE);

    Unload;

    TB_SAFE_DELETE(m_pIntro);
    TB_SAFE_DELETE(m_pMainMenu);
    TB_SAFE_DELETE(m_pGame);

    tbExit();
    
    return TB_OK;
}
tbResult CTicTacToe::Load()
{
 tbResult r;
 if(tbDirect3D::Instance().Init(&m_Config,"Tic Tac Toe", 0, 0);
 {
     TB_ERROR("Fehler beim Initialisieren von Direct3D", TB_ERROR);
 }

 tbDirect3D::Instance()->CreateStateBlock(D3DSBT_ALL, &m_pStateBlock);

 if(tbTextureManager::Instance().Init())
 {
     TB_ERROR("Fehler beim Initialisieren des Textur Managers",TB_ERROR);
 }

 if(tbDirectInput::Instance().Init())
 {
     TB_ERROR("Fehler beim Initialisieren von Direct Input", TB_ERROR);
 }

 g_pfButtons = new float[tbDirectInput::Instance().GetNumButtons()];
 g_pbButtons = new BOOL[tbDirectInput::Instance().GetNumButtons()];

 m_pFont = new tbFont;
 if(m_pFont->Init("Data\\Font.tga", "Data\\Font.tbf"))
 {
     TB_ERROR("Fehler beim Laden der Fonts", TB_ERROR);
 }

 return TB_OK;
}

tbResult CTicTacToe::Unload()
{
    TB_SAFE_DELTE(m_pFont);
    TB_SAFE_RELEASE(m_pStatBlock);
    TB_SAFE_DELETE_ARRAY(g_pfBottons);
    TB_SAFE_DELETE_ARRAY(g_pbBottons);
    tbDirect3D::Instance().Exit();
    tbTextureManager::Instance().Exit();
    tbDirectInput::Instance().Exit();

    return TB_OK;
}

tbResult Move(float fTime) {return g_pTicTacToe->Move(float fTime);}
tbResult Render(float fTime) {return g_pTicTacToe->Render(float fTime);}

tbResult CTicTacToe::Run()
{
    if(tbDoMessageLoop(::Move, ::Render)
    {
        TB_ERROR("Fehler in der Nachrichtenschleife", TB_ERROR);
    }

    return TB_OK;
}

tbResult CTicTacToe::SetGameStat(EGameStat NewGameStat)
{
    tbResult r = TB_OK;

    switch(m_GameStat)
    {
    case GS_INTRO:      m_pIntro->Exit(); break;
    case GS_MAINMENU:   m_pMainMenu->Exit(); break;
    case GS_GAME:       m_pGame->Exit(); break;
    }

    m_fTime = 0.0f;

    m_pStatBlock->Apply();
    tbDirect3D::Instance().Capture();

    m_GameStat = NewGameStat;

    switch(m_GameStat)
    {
    case GS_INTRO:       m_pIntro->Init(); break;
    case GS_MAINMENU:    m_pMainMenu->Init(); break;
    case GS_GAME:        m_pGame->Init(); break;
    }

    if(r) TB_ERROR("Fehler beim Setzen des Spiel Status", TB_ERROR);
}

tbResult CTicTacToe::Move(float fTime)
{
    tbResult r = TB_OK;

    tbDirectInput::Instance().GetState(g_pfBottons, g_pbBottons);

    switch(m_GameStat)
    {
    case GS_INTRO:     m_pIntro->Move(fTime);
    case GS_MAINMENU:  m_pMainMenu->Move(fTime);
    case GS_GAME:      m_pGame->Move(fTime);
    }

    if(r) TB_ERROR("Fehler beim Bewegen des Spiels", TB_ERROR);

    m_fTime += fTime;

    return TB_OK;
}

tbResult CTicTacToe::Render(float fTime)
{
    tbResult r = TB_OK;

    switch(m_GameStat)
    {
    case GS_INTRO:     m_pIntro->Render(fTime);
    case GS_MAINMENU:  m_pMainMenu->Render(fTime);
    case GS_GAME:      m_pGame->Render(fTime);
    }

    if(r) TB_ERROR("Fehler beim Zeichnen des Spiels", TB_ERROR);

    return TB_OK;
}


TicTacToe.h

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
#include <TriBase.h>
#include "Intro.h"
#include "MainMenu.h"
#include "TicTacToe.h"


enum EGameStat
{
    GS_NONE,
    GS_INTRO,
    GS_MAINMENU,
    GS_GAME
}
class CTicTacToe
{
public:
    tbConfig m_Config;
    PDIRECT3DSTATEBLOCK9    m_pStateBlock;

    CIntro*     m_pIntro;
    CMainMenu*  m_pMainmenu;
    CGame*      m_pGame;
    EGameStat   m_GameStat;
    float       m_fTime;

    tbFont* m_pFont;

    tbResult Init();
    tbResult Exit();
    tbResult Load();
    tbResult Unload();
    tbResult SetGameStat(EGameStat NewGameStat);
    tbResult Move(float fTime);
    tbResilt Render(flaot fTime);
};

extern CBreakanoid* g_pBreakanoid;
extern float*       g_pfButtons;
extern BOOL*        g_pbButtons;


Intro.cpp

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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#include "Intro.h"

struct STitelVertex
{
    tbVector3           vPosition;
    float               fRHW;
    D3DCOLOR            Color;
    tbVector2           vTex0;
    static const DWORD  dwFVF;
};

const DWORD STitleVertex::dwFVF = D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1;

tbResult CIntro::Init()
{
    if(Load()) TB_ERROR("Fehler beim Laden des Spielzustands", TB_ERROR);

    return TB_OK;
}

tbResult CIntro::Exit()
{
    Unload();

    return TB_OK;
}

tbResult CIntro::Load()
{
    m_pBackground = tbTextureManager::Instance().GetTexture("Data\\Bild.jpg");
    if(m_pBackground == NULL) TB_ERROR("Fehler beim Laden der Texturen", TB_ERROR);
    return TB_OK;
}

tbResult CIntro::Unload()
{
    tbTextureManager::Instance()ReleaseTexture(m_pBackground);
    return TB_OK;
}

tbResult CIntro::Move()
{
    if(g_pbBottons[TB_KEY_ENTER]||g_pbBottons[TB_KEY_SPACE])
    {
        tbDelay(100);
        g_pTicTacToe->SetGameStat(GS_MAINMENU);
    }
}

tbResult CIntro::Render()
{
    STitelVertex aVertex[4];

    tbDirect3D& D3D = tbDirect3D::Instance();
    D3D->Clear(0 , 0 , D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, tbColor(0.0f,0.0f,0.0f), 1.0f, 0);
    D3D->BeginScene();

    D3D.SetFvF(STitelVertex::dwFVF);
    D3D.SetTextur(0, m_pBackground);
    D3D.SetRS(D3DRS_ZENABLE, D3DZB_FALSE);

    aVertex[0].vPosition = tbVector3(0.0f, D3D.GetScreenSize().y, 0.5f);
    aVertex[0].fRHW = 1.0f;
    aVertex[0].Color = tbColor(1.0f, 0.8f, 0.8f);
    aVertex[0].vTex0 = tbVector2(0.0f, 1.0f);

    aVertex[1].vPosition = tbVector3(0.0f, 0.0f, 0.0f);
    aVertex[1].fRHW = 1.0f;
    aVertex[1].Color = tbColor(0.8f, 1.0f, 0.8f);
    aVertex[1].vTex0 = tbVector2(0.0f, 0.0f);

    aVertex[2].vPosition = tbVector3(D3D.GetScreenSize().x, D3D.GetScreenSize().y, 0.5f);
    aVertex[2].fRHW = 1.0f;
    aVertex[2].Color = tbColor(0.8f, 0.8f, 1.0f);
    aVertex[2].vTex0 = tbVector2(1.0f, 1.0f);

    aVertex[3].vPosition = tbVector3(D3D.GetScreenSize().x, 0.0f, 0.5f);
    aVertex[3].fRHW = 1.0f;
    aVertex[3].Color = tbColor(1.0f, 1.0f, 0.8f);
    aVertex[3].vTex0 = tbVector2(1.0f, 0.0f);

    D3D->DrawPrimitveUP(D3DPT_TRIANGLESTRIP, 2, aVertex, sizeof(STitelVertex));

    g_pTicTacToe->m_pFont->Begin();
    g_pTicTacToe->m_pFont->DrawText(tbVector2(0.5f, 0.5f), "Drücken Sie Enter", TB_FF_ALIGN_HCENTER | TB_FF_ALIGN_VCENTER | TB_FF_RELATIVE | TB_FF_RELATIVESCALING);
    g_pTicTacToe->m_pFont->End();

    D3D->EndScene();

    return TB_OK;
}


Intor.h

C-/C++-Quelltext

1
2
3
4
5
6
7
8
9
10
11
12
13
14
class CIntro
{
public:
  PDIRECT3DTEXTURE9 m_pBackground;

  inline CIntro() {ZeroMemory(this,sizeof(CIntro));}

  tbResult Init();
  tbResult Exit();
  tbResult Load();
  tbResult Unload();
  tbResult Move(float fTime);
  tbResult Render(float fTime);
};


Folgende Libs hab ich noch als zusätzliche Abhängigkeiten:
tribased.lib
d3d9.lib
dxerr9.lib
odbc32.lib
odbccp32.lib

Hab ich alles? Oder braucht ihr noch mehr Infos?

mfg

2

15.11.2009, 11:18

in Intro.h muss noch ein

C-/C++-Quelltext

1
#include<TriBase.h>

3

15.11.2009, 12:10

Zitat von »"E122"«

in Intro.h muss noch ein

C-/C++-Quelltext

1
#include<TriBase.h>

In mainmenu.h auch.

4

15.11.2009, 12:59

Danke für eure Antworten! ;)
Hab das jetzt gemacht und bei TicTacToe.h
hab ich das "#include "ticTacToe.h" weggemacht, weil er sich
sonst selbst includiert.
Und das

C-/C++-Quelltext

1
extern CBreakanoid* g_pBreakanoid

in

C-/C++-Quelltext

1
extern CTicTacToe* g_pTicTacToe
.
Jetzt kommen die folgenden Fehler:

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
71
72
73
74
75
76
77
78
79
80
81
82
1>Kompilieren...
1>Intro.cpp
1>c:\meineprojekte\tic tac toe\tic tac toe\mainmenu.h(9) : error C2065: 'CMainmenu': nichtdeklarierter Bezeichner
1>c:\meineprojekte\tic tac toe\tic tac toe\mainmenu.h(9) : error C2070: ''unknown-type'': Ungültiger sizeof-Operand
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.h(21) : error C2143: Syntaxfehler: Es fehlt ';' vor '*'
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.h(21) : error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.h(21) : error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
1>c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(11) : error C2653: 'STitleVertex': Keine Klasse oder Namespace
1>c:\meineprojekte\tic tac toe\tic tac toe\intro.cpp(42) : error C2065: 'g_pbBottons': nichtdeklarierter Bezeichner
1>MainMenu.cpp
1>c:\meineprojekte\tic tac toe\tic tac toe\mainmenu.h(9) : error C2065: 'CMainmenu': nichtdeklarierter Bezeichner
1>c:\meineprojekte\tic tac toe\tic tac toe\mainmenu.h(9) : error C2070: ''unknown-type'': Ungültiger sizeof-Operand
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.h(21) : error C2143: Syntaxfehler: Es fehlt ';' vor '*'
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.h(21) : error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.h(21) : error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
1>TicTacToe.cpp
1>c:\meineprojekte\tic tac toe\tic tac toe\mainmenu.h(9) : error C2065: 'CMainmenu': nichtdeklarierter Bezeichner
1>c:\meineprojekte\tic tac toe\tic tac toe\mainmenu.h(9) : error C2070: ''unknown-type'': Ungültiger sizeof-Operand
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.h(21) : error C2143: Syntaxfehler: Es fehlt ';' vor '*'
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.h(21) : error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.h(21) : error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.cpp(27) : error C2039: 'Run': Ist kein Element von 'CTicTacToe'
1>        c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.h(14): Siehe Deklaration von 'CTicTacToe'
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.cpp(29) : error C2065: 'g_pTicTacTie': nichtdeklarierter Bezeichner
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.cpp(29) : error C2227: Links von "->Exit" muss sich ein Zeiger auf Klassen-/Struktur-/Union-/generischen Typ befinden.
1>        Typ ist ''unknown-type''
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.cpp(30) : error C2065: 'TB_SA': nichtdeklarierter Bezeichner
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.cpp(30) : error C2146: Syntaxfehler: Fehlendes ';' vor Bezeichner 'FE_DELETE'
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.cpp(30) : error C3861: "FE_DELETE": Bezeichner wurde nicht gefunden.
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.cpp(35) : error C3867: "CTicTacToe::Exit": Dem Funktionsaufruf fehlt die Argumentliste. Verwenden Sie "&CTicTacToe::Exit", um einen Zeiger auf den Member zu erstellen.
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.cpp(48) : error C2143: Syntaxfehler: Es fehlt ';' vor 'if'
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.cpp(48) : error C2065: 'CANCELED': nichtdeklarierter Bezeichner
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.cpp(55) : error C2065: 'm_pGame': nichtdeklarierter Bezeichner
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.cpp(55) : error C2061: Syntaxfehler: Bezeichner 'CGame'
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.cpp(66) : error C3867: "CTicTacToe::Unload": Dem Funktionsaufruf fehlt die Argumentliste. Verwenden Sie "&CTicTacToe::Unload", um einen Zeiger auf den Member zu erstellen.
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.cpp(70) : error C2065: 'm_pGame': nichtdeklarierter Bezeichner
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.cpp(70) : error C2065: 'm_pGame': nichtdeklarierter Bezeichner
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.cpp(70) : error C2541: 'delete': Objekte, die keine Zeiger sind, können nicht gelöscht werden
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.cpp(70) : error C2065: 'm_pGame': nichtdeklarierter Bezeichner
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.cpp(79) : error C2143: Syntaxfehler: Es fehlt ')' vor ';'
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.cpp(80) : warning C4390: ';': Leere kontrollierte Anweisung aufgetreten; ist dies beabsichtigt?
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.cpp(110) : error C3861: "TB_SAFE_DELTE": Bezeichner wurde nicht gefunden.
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.cpp(111) : error C2065: 'm_pStatBlock': nichtdeklarierter Bezeichner
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.cpp(111) : error C2065: 'm_pStatBlock': nichtdeklarierter Bezeichner
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.cpp(111) : error C2227: Links von "->Release" muss sich ein Zeiger auf Klassen-/Struktur-/Union-/generischen Typ befinden.
1>        Typ ist ''unknown-type''
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.cpp(111) : error C2065: 'm_pStatBlock': nichtdeklarierter Bezeichner
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.cpp(112) : error C2065: 'g_pfBottons': nichtdeklarierter Bezeichner
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.cpp(112) : error C2065: 'g_pfBottons': nichtdeklarierter Bezeichner
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.cpp(112) : error C2541: 'delete': Objekte, die keine Zeiger sind, können nicht gelöscht werden
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.cpp(112) : error C2065: 'g_pfBottons': nichtdeklarierter Bezeichner
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.cpp(113) : error C2065: 'g_pbBottons': nichtdeklarierter Bezeichner
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.cpp(113) : error C2065: 'g_pbBottons': nichtdeklarierter Bezeichner
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.cpp(113) : error C2541: 'delete': Objekte, die keine Zeiger sind, können nicht gelöscht werden
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.cpp(113) : error C2065: 'g_pbBottons': nichtdeklarierter Bezeichner
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.cpp(121) : error C2144: Syntaxfehler: 'float' sollte auf ')' folgen
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.cpp(121) : error C2660: 'CTicTacToe::Move': Funktion akzeptiert keine 0 Argumente
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.cpp(121) : error C2059: Syntaxfehler: ')'
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.cpp(122) : error C2144: Syntaxfehler: 'float' sollte auf ')' folgen
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.cpp(122) : error C2660: 'CTicTacToe::Render': Funktion akzeptiert keine 0 Argumente
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.cpp(122) : error C2059: Syntaxfehler: ')'
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.cpp(124) : error C2039: 'Run': Ist kein Element von 'CTicTacToe'
1>        c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.h(14): Siehe Deklaration von 'CTicTacToe'
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.cpp(125) : error C2365: "Run": Erneute Definition; vorherige Definition war "Ehemals unbekannter Bezeichner".
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.cpp(127) : error C2143: Syntaxfehler: Es fehlt ')' vor '{'
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.cpp(142) : error C2065: 'm_pGame': nichtdeklarierter Bezeichner
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.cpp(142) : error C2227: Links von "->Exit" muss sich ein Zeiger auf Klassen-/Struktur-/Union-/generischen Typ befinden.
1>        Typ ist ''unknown-type''
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.cpp(147) : error C2065: 'm_pStatBlock': nichtdeklarierter Bezeichner
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.cpp(147) : error C2227: Links von "->Apply" muss sich ein Zeiger auf Klassen-/Struktur-/Union-/generischen Typ befinden.
1>        Typ ist ''unknown-type''
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.cpp(156) : error C2065: 'm_pGame': nichtdeklarierter Bezeichner
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.cpp(156) : error C2227: Links von "->Init" muss sich ein Zeiger auf Klassen-/Struktur-/Union-/generischen Typ befinden.
1>        Typ ist ''unknown-type''
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.cpp(166) : error C2065: 'g_pfBottons': nichtdeklarierter Bezeichner
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.cpp(166) : error C2065: 'g_pbBottons': nichtdeklarierter Bezeichner
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.cpp(172) : error C2065: 'm_pGame': nichtdeklarierter Bezeichner
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.cpp(172) : error C2227: Links von "->Move" muss sich ein Zeiger auf Klassen-/Struktur-/Union-/generischen Typ befinden.
1>        Typ ist ''unknown-type''
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.cpp(190) : error C2065: 'm_pGame': nichtdeklarierter Bezeichner
1>c:\meineprojekte\tic tac toe\tic tac toe\tictactoe.cpp(190) : error C2227: Links von "->Render" muss sich ein Zeiger auf Klassen-/Struktur-/Union-/generischen Typ befinden.
1>        Typ ist ''unknown-type''


Edit: Hab ja die MainMenu.h ganz vergessen.

C-/C++-Quelltext

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include<TriBase.h>

class CMainMenu
{
public:
    PDIRECT3DTEXTURE9 m_pBackground;
    int m_iCursor;

    inline CMainMenu() {ZeroMemory(this, sizeof(CMainmenu));}

    tbResult Init();
    tbResult Exit();
    tbResult Load();
    tbResult Unload();
    tbResult Move(float fTime);
    tbResult Render(float fTime);
};

GR-PA

Treue Seele

Beiträge: 326

Wohnort: Daheim

Beruf: Faulenzer

  • Private Nachricht senden

5

15.11.2009, 14:01

C++ ist case-sensitive...

C-/C++-Quelltext

1
inline CMainMenu() {ZeroMemory(this, sizeof(CMainmenu));}/*fällt dir was auf?*/ 
;)
Signaturen werden überbewertet

6

15.11.2009, 14:12

ohh :D ja. Danke da ist mir wohl ein kleiner Schreibfehler unterlaufen.

mfg

7

16.11.2009, 14:59

Ich hab wieder ein Problem.
Das Intro wurde mir schön angezeigt, bis ich das Hauptmenü fertig
programmiert hatte.
Jetzt überspringt er das Intro und geht direkt zum Hauptmenü.
Und dort wird auch die Textur erst angezeigt nachdem man auf "Spiel beenden" gedrückt hat.

Dann mal hier alle Quellcodes:
TicTacToe.cpp

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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
#include "TicTacToe.h" 

//______________Globale___Variablen_______________________________________//

CTicTacToe*     g_pTicTacToe;
float*          g_pfButtons = NULL;
BOOL*           g_pbButtons = NULL;
//________________________________________________________________________//

int WINAPI WinMain(HINSTANCE hInstance,
                   HINSTANCE hPrevInstance,
                   char* pcCommandLine,
                   int iShowCommand)
{
    tbResult r;
    g_pTicTacToe = new CTicTacToe;
    r = g_pTicTacToe->Init();
    if(r == TB_CANCELED)
    {
        TB_SAFE_DELETE(g_pTicTacToe);
        return 0;
    }
    else if(r)
    {
        TB_SAFE_DELETE(g_pTicTacToe);
        MessageBox(0,"Fehler beim Initialisieren des Spiels", "Fehler", MB_OK | MB_ICONEXCLAMATION);
        return 1;
    }

    if(g_pTicTacToe->Run())
    {
        g_pTicTacToe->Exit();
        TB_SAFE_DELETE(g_pTicTacToe);
        MessageBox(0, "Fehler im Spiel", "Fehler", MB_OK | MB_ICONEXCLAMATION);
        return 1;
    }

    g_pTicTacToe->Exit();
    TB_SAFE_DELETE(g_pTicTacToe);
    return 0;
}

tbResult CTicTacToe::Init()
{
    tbResult r;
    
    ZeroMemory(this, sizeof(CTicTacToe));

    if(tbInit()) return TB_ERROR;
    r = tbDoConfigDialog(&m_Config);
    if(r == TB_CANCELED) return TB_CANCELED;
    else if(r) TB_ERROR("Engine konnte nicht Initialisiert werden", r);  
    
    if(Load()) TB_ERROR("Fehler beim Laden des Spiels", TB_ERROR);

    m_pIntro = new CIntro;
    m_pMainMenu = new CMainMenu;
    m_pGame = new CGame;

    SetGameStat(GS_INTRO);

    return TB_OK;
}

tbResult CTicTacToe::Exit()
{
    SetGameStat(GS_NONE);

    Unload();

    TB_SAFE_DELETE(m_pIntro);
    TB_SAFE_DELETE(m_pMainMenu);
    TB_SAFE_DELETE(m_pGame);

    tbExit();
    
    return TB_OK;
}
tbResult CTicTacToe::Load()
{
 tbResult r;
 if(tbDirect3D::Instance().Init(&m_Config,"Tic Tac Toe", NULL, 0))
 {
     TB_ERROR("Fehler beim Initialisieren von Direct3D", TB_ERROR);
 }

 tbDirect3D::Instance()->CreateStateBlock(D3DSBT_ALL, &m_pStateBlock);

 if(tbTextureManager::Instance().Init())
 {
     TB_ERROR("Fehler beim Initialisieren des Textur Managers",TB_ERROR);
 }

 if(tbDirectInput::Instance().Init())
 {
     TB_ERROR("Fehler beim Initialisieren von Direct Input", TB_ERROR);
 }

 g_pfButtons = new float[tbDirectInput::Instance().GetNumButtons()];
 g_pbButtons = new BOOL[tbDirectInput::Instance().GetNumButtons()];

 m_pFont = new tbFont;
 if(m_pFont->Init("Data\\Font.tga", "Data\\Font.tbf"))
 {
     TB_ERROR("Fehler beim Laden der Fonts", TB_ERROR);
 }

 return TB_OK;
}

tbResult CTicTacToe::Unload()
{
    TB_SAFE_DELETE(m_pFont);
    TB_SAFE_RELEASE(m_pStateBlock);
    TB_SAFE_DELETE_ARRAY(g_pfButtons);
    TB_SAFE_DELETE_ARRAY(g_pbButtons);
    tbDirect3D::Instance().Exit();
    tbTextureManager::Instance().Exit();
    tbDirectInput::Instance().Exit();

    return TB_OK;
}

tbResult Move(float fTime) {return g_pTicTacToe->Move(fTime);}
tbResult Render(float fTime) {return g_pTicTacToe->Render(fTime);}

tbResult CTicTacToe::Run()
{
    if(tbDoMessageLoop(::Move, ::Render))
    {
        TB_ERROR("Fehler in der Nachrichtenschleife", TB_ERROR);
    }

    return TB_OK;
}

tbResult CTicTacToe::SetGameStat(EGameStat NewGameStat)
{
    tbResult r = TB_OK;

    switch(m_GameStat)
    {
    case GS_INTRO:      m_pIntro->Exit(); break;
    case GS_MAINMENU:   m_pMainMenu->Exit(); break;
    //case GS_GAME:       m_pGame->Exit(); break;

    }

    m_fTime = 0.0f;

    m_pStateBlock->Apply();
    tbDirect3D::Instance().Capture();

    m_GameStat = NewGameStat;

    switch(m_GameStat)
    {
    case GS_INTRO:       m_pIntro->Init(); break;
    case GS_MAINMENU:    m_pMainMenu->Init(); break;
    //case GS_GAME:        m_pGame->Init(); break;

    }

    if(r) TB_ERROR("Fehler beim Setzen des Spiel Status", TB_ERROR);
}

tbResult CTicTacToe::Move(float fTime)
{
    tbResult r = TB_OK;

    tbDirectInput::Instance().GetState(g_pfButtons, g_pbButtons);

    switch(m_GameStat)
    {
    case GS_INTRO:     m_pIntro->Move(fTime);
    case GS_MAINMENU:  m_pMainMenu->Move(fTime);
  //case GS_GAME:      m_pGame->Move(fTime);

    }

    if(r) TB_ERROR("Fehler beim Bewegen des Spiels", TB_ERROR);

    m_fTime += fTime;

    return TB_OK;
}

tbResult CTicTacToe::Render(float fTime)
{
    if(tbDirect3D::Instance().GetPresentResult())
    {
        // Anzeigen ist fehlgeschlagen!

        // Wahrscheinlich läuft das Programm im Vollbildmodus und es

        // wurde zwischenzeitlich minimiert.

        // Wir initialisieren das Spiel komplett neu.


        // Aktuellen Spielzustand entladen

        switch(m_GameStat)
        {
        case GS_INTRO:      m_pIntro->Unload();     break;
        case GS_MAINMENU:   m_pMainMenu->Unload();  break;
        //case GS_GAME:     m_pGame->Unload();      break;

        }

        // Das ganze Spiel entladen und dann wieder neu laden

        Unload();
        Load();

        // Aktuellen Spielstatus neu laden

        switch(m_GameStat)
        {
        case GS_INTRO:      m_pIntro->Load();       break;
        case GS_MAINMENU:   m_pMainMenu->Load();    break;
        //case GS_GAME:     m_pGame->Load();        break;

        }
    }
    tbResult r = TB_OK;

    switch(m_GameStat)
    {
    case GS_INTRO:     m_pIntro->Render(fTime);
    case GS_MAINMENU:  m_pMainMenu->Render(fTime);
    //case GS_GAME:      m_pGame->Render(fTime);

    }

    if(r) TB_ERROR("Fehler beim Zeichnen des Spiels", TB_ERROR);

    return TB_OK;
}

TicTacToe.h

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
#include <TriBase.h>
#include "Intro.h"
#include "MainMenu.h"
#include "Game.h"

enum EGameStat
{
    GS_NONE,
    GS_INTRO,
    GS_MAINMENU,
    GS_GAME
};

class CTicTacToe
{
public:
    tbConfig m_Config;
    PDIRECT3DSTATEBLOCK9    m_pStateBlock;

    CIntro*     m_pIntro;
    CMainMenu*  m_pMainMenu;
    CGame*      m_pGame;
    EGameStat   m_GameStat;
    float       m_fTime;

    tbFont* m_pFont;

    tbResult Init();
    tbResult Exit();
    tbResult Load();
    tbResult Unload();
    tbResult Run();
    tbResult SetGameStat(EGameStat NewGameStat);
    tbResult Move(float fTime);
    tbResult Render(float fTime);
};

extern CTicTacToe*  g_pTicTacToe;
extern float*       g_pfButtons;
extern BOOL*        g_pbButtons;

Intro.cpp

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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#include "TicTacToe.h" 

struct STitleVertex
{
    tbVector3           vPosition;
    float               fRHW;
    D3DCOLOR            Color;
    tbVector2           vTex0;
    static const DWORD  dwFVF;
};

const DWORD STitleVertex::dwFVF = D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1;

tbResult CIntro::Init()
{
    if(Load()) TB_ERROR("Fehler beim Laden des Spielzustands", TB_ERROR);

    return TB_OK;
}

tbResult CIntro::Exit()
{
    Unload();

    return TB_OK;
}

tbResult CIntro::Load()
{
    m_pBackground = tbTextureManager::Instance().GetTexture("Data\\Bild.jpg");
    if(m_pBackground == NULL) TB_ERROR("Fehler beim Laden der Texturen", TB_ERROR);
    return TB_OK;
}

tbResult CIntro::Unload()
{
    tbTextureManager::Instance().ReleaseTexture(m_pBackground);
    return TB_OK;
}

tbResult CIntro::Move(float fTime)
{
    if(g_pbButtons[TB_KEY_RETURN] ||
       g_pbButtons[TB_KEY_SPACE])
    {
        tbDelay(100);
        g_pTicTacToe->SetGameStat(GS_MAINMENU);
    }
    return TB_OK;
}

tbResult CIntro::Render(float fTime)
{
    STitleVertex aVertex[4];

    tbDirect3D& D3D = tbDirect3D::Instance();
    D3D->Clear(0 , 0 , D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, tbColor(0.0f,0.0f,0.0f), 1.0f, 0);
    D3D->BeginScene();

    D3D.SetFVF(STitleVertex::dwFVF);
    D3D.SetTexture(0, m_pBackground);
    D3D.SetRS(D3DRS_ZENABLE, D3DZB_FALSE);

    aVertex[0].vPosition = tbVector3(0.0f, D3D.GetScreenSize().y, 0.5f);
    aVertex[0].fRHW = 1.0f;
    aVertex[0].Color = tbColor(1.0f, 0.8f, 0.8f);
    aVertex[0].vTex0 = tbVector2(0.0f, 1.0f);

    aVertex[1].vPosition = tbVector3(0.0f, 0.0f, 0.0f);
    aVertex[1].fRHW = 1.0f;
    aVertex[1].Color = tbColor(0.8f, 1.0f, 0.8f);
    aVertex[1].vTex0 = tbVector2(0.0f, 0.0f);

    aVertex[2].vPosition = tbVector3(D3D.GetScreenSize().x, D3D.GetScreenSize().y, 0.5f);
    aVertex[2].fRHW = 1.0f;
    aVertex[2].Color = tbColor(0.8f, 0.8f, 1.0f);
    aVertex[2].vTex0 = tbVector2(1.0f, 1.0f);

    aVertex[3].vPosition = tbVector3(D3D.GetScreenSize().x, 0.0f, 0.5f);
    aVertex[3].fRHW = 1.0f;
    aVertex[3].Color = tbColor(1.0f, 1.0f, 0.8f);
    aVertex[3].vTex0 = tbVector2(1.0f, 0.0f);

    D3D->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, aVertex, sizeof(STitleVertex));

    g_pTicTacToe->m_pFont->Begin();
    g_pTicTacToe->m_pFont->DrawText(tbVector2(0.5f, 0.5f), "Druecken Sie Enter", TB_FF_ALIGN_HCENTER | TB_FF_ALIGN_VCENTER | TB_FF_RELATIVE | TB_FF_RELATIVESCALING);
    g_pTicTacToe->m_pFont->End();

    D3D->EndScene();

    return TB_OK;
}

Intro.h

C-/C++-Quelltext

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include<TriBase.h>
class CIntro
{
public:
  PDIRECT3DTEXTURE9 m_pBackground;

  inline CIntro() {ZeroMemory(this,sizeof(CIntro));}

  tbResult Init();
  tbResult Exit();
  tbResult Load();
  tbResult Unload();
  tbResult Move(float fTime);
  tbResult Render(float fTime);
};

MainMenu.cpp

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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#include "TicTacToe.h"
struct SMainMenuVertex
{
    tbVector3           vPosition;
    float               fRHW;
    D3DCOLOR            Color;
    tbVector2           vTex0;
    static const DWORD  dwFVF;
};

const DWORD SMainMenuVertex::dwFVF = D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1;

tbResult CMainMenu::Init()
{
    if(Load()) TB_ERROR("Fehler beim Initialisieren des Menues", TB_ERROR);

    m_iCursor = 0;
    return TB_OK;
}

tbResult CMainMenu::Exit()
{
    Unload();
    return TB_OK;
}
tbResult CMainMenu::Load()
{
    m_pBackground = tbTextureManager::Instance().GetTexture("Data\\MainMenu.jpg");
    if(m_pBackground == NULL) TB_ERROR("Fehler beim Laden der Textur", TB_ERROR);

    return TB_OK;
}
tbResult CMainMenu::Unload()
{
    tbTextureManager::Instance().ReleaseTexture(m_pBackground);
    return TB_OK;
}
tbResult CMainMenu::Move(float fTime)
{
    if(g_pbButtons[TB_KEY_UP])
    {
        m_iCursor++; 
        tbDelay(80);
    }
    if(g_pbButtons[TB_KEY_DOWN]) 
    {
        m_iCursor--; 
        tbDelay(80);
    }
    if(m_iCursor > 2) m_iCursor = 0;
    if(m_iCursor < 0) m_iCursor = 1;
    if(g_pbButtons[TB_KEY_SPACE]||g_pbButtons[TB_KEY_RETURN])
    {
        switch(m_iCursor)
        {
        case 0: PostQuitMessage(0);
            break;
        case 1: PostQuitMessage(0);
            break;
        }
    }

    return TB_OK;
}
tbResult CMainMenu::Render(float fTime)
{
    SMainMenuVertex aVertex[4];
    char*               MenuEntry[2] = {"Spiel starten",                                     
                                        "Spiel beenden"};
    tbVector2           vPosition;
    tbColor             Color;

    tbDirect3D& D3D = tbDirect3D::Instance();
    D3D->Clear(0 , 0 , D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, tbColor(0.0f,0.0f,0.0f), 1.0f, 0);
    D3D->BeginScene();

    D3D.SetFVF(SMainMenuVertex::dwFVF);
    D3D.SetTexture(0, m_pBackground);
    D3D.SetRS(D3DRS_ZENABLE, D3DZB_FALSE);

    aVertex[0].vPosition = tbVector3(0.0f, D3D.GetScreenSize().y, 0.5f);
    aVertex[0].fRHW = 1.0f;
    aVertex[0].Color = tbColor(1.0f, 0.8f, 0.8f);
    aVertex[0].vTex0 = tbVector2(0.0f, 1.0f);

    aVertex[1].vPosition = tbVector3(0.0f, 0.0f, 0.0f);
    aVertex[1].fRHW = 1.0f;
    aVertex[1].Color = tbColor(0.8f, 1.0f, 0.8f);
    aVertex[1].vTex0 = tbVector2(0.0f, 0.0f);

    aVertex[2].vPosition = tbVector3(D3D.GetScreenSize().x, D3D.GetScreenSize().y, 0.5f);
    aVertex[2].fRHW = 1.0f;
    aVertex[2].Color = tbColor(0.8f, 0.8f, 1.0f);
    aVertex[2].vTex0 = tbVector2(1.0f, 1.0f);

    aVertex[3].vPosition = tbVector3(D3D.GetScreenSize().x, 0.0f, 0.5f);
    aVertex[3].fRHW = 1.0f;
    aVertex[3].Color = tbColor(1.0f, 1.0f, 0.8f);
    aVertex[3].vTex0 = tbVector2(1.0f, 0.0f);

    D3D->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, aVertex, sizeof(SMainMenuVertex));
    //__________________________________________________________________________________//

    g_pTicTacToe->m_pFont->Begin();
    for(int iEntry = 0; iEntry < 2; iEntry++)
    {
    vPosition.x = 0.5f;
    vPosition.y = 0.4f + (float)(iEntry) * 0.125f;
    if(m_iCursor == iEntry)
    {
        Color = tbColor(0.3f,0.8f,0.0f);
    }
    else
    {
        Color = tbColor(0.5f,0.0f,0.0f);
    }
    g_pTicTacToe->m_pFont->DrawText(vPosition,MenuEntry[iEntry],TB_FF_ALIGN_HCENTER | TB_FF_ALIGN_HCENTER | TB_FF_RELATIVE | TB_FF_RELATIVESCALING,
                                    -1, Color, Color, tbVector2(1.5f, 1.5f));
    }
    g_pTicTacToe->m_pFont->End();

    D3D->EndScene();
    return TB_OK;
}

MainMenu.h

C-/C++-Quelltext

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include<TriBase.h>

class CMainMenu
{
public:
    PDIRECT3DTEXTURE9 m_pBackground;
    int m_iCursor;

    inline CMainMenu() {ZeroMemory(this, sizeof(CMainMenu));}

    tbResult Init();
    tbResult Exit();
    tbResult Load();
    tbResult Unload();
    tbResult Move(float fTime);
    tbResult Render(float fTime);
};

CBenni::O

1x Contest-Sieger

Beiträge: 1 145

Wohnort: Stuttgart

  • Private Nachricht senden

8

16.11.2009, 18:40

wieso erstellst du 2 posts mit massenhaft quelltext und dem selben problem? einer reicht...

mfg CBenni::O
Ein Mitglied der VEGeiCoUndGraSonMaWiGeS Bewegung.
42!
Aufräumen kann jeder, nur das Genie überblickt das Chaos!
Metal will never die!
1. Sppro Gamecontest - mein Beitrag

9

16.11.2009, 20:45

Ja, sorry aber es war dringend und in dem Thread wurde mir nicht geantwortet.

Werbeanzeige