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
Zitat von »"Jonathan_Klein"«
Dein Programmierstil ist schlecht.
Du solltest die Position in einem Vektor speichern. Und für einen Button eine eigene Klasse haben.
Dann hättest du nur noch:
C-/C++-Quelltext
1 2 3m_SingleMultiButton //bzw.: m_SingleMultiButton.Position.x
Zitat von »"Gon"«
Zitat von »"Jonathan_Klein"«
Dein Programmierstil ist schlecht.
Du solltest die Position in einem Vektor speichern. Und für einen Button eine eigene Klasse haben.
Dann hättest du nur noch:
C-/C++-Quelltext
1 2 3m_SingleMultiButton //bzw.: m_SingleMultiButton.Position.x
ne eigene klasse für einen button???
nur für eine variable???
in heiko kalistas buch hat der das aber so gemacht...
David_pb hat recht.
C-/C++-Quelltext |
|
1 2 3 4 5 |
int zahl1; char buchstabe; double dkommazahl; int nAndere_zahl; int VAR; |
Zitat von »"drakon"«
@Gon: Das ist jetzt nicht gegen dich gerichtet!
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 |
//----------------------------------------------------------------------------- // GLOBALS //----------------------------------------------------------------------------- long tempLong; long temp1Long; long temp2Long; long temp3Long; long temp4Long; long temp5Long; long temp6Long; long testLong ; long tempColor; long tempColor2; float testFloat; float tempFloat; float temp1Float; float temp2Float; float temp3Float; float temp4Float; float temp5Float; float temp6Float; float temp7Float; float temp8Float; float temp9Float; float temp10Float; float temp11Float; float temp12Float; D3DXMATRIX tempMatrix; D3DXMATRIX tempMatrix1; D3DXMATRIX tempMatrix2; D3DXMATRIX tempMatrix3; D3DXMATRIX tempMatrix4; D3DXVECTOR3 PlayerTempVerschiebungsvektor; D3DXVECTOR3 PlayerTemp2Verschiebungsvektor; D3DXVECTOR3 tempVektor3; D3DXVECTOR3 temp1Vektor3; D3DXVECTOR3 temp2Vektor3; D3DXVECTOR3 temp3Vektor3; D3DXVECTOR3 temp4Vektor3; D3DXVECTOR3 temp5Vektor3; D3DXVECTOR3 tempVelVektor3; // globaler Verschiebungs-(Geschwindigkeits)vektor |
Zitat von »"drakon"«
Dann weist das mich darauf hin, dass diese Person ein wenig unstrukturiert und ohne sich dabei viel gedacht zu haben vorgegangen ist. Und da würde ich behaupten, dass der sonstige Programmierstil nicht viel besser aussieht.
Zitat von »"David_pb"«
Unsinn, zumal ein Programmierstil ohnehin nie jedem zusagen kann... Zu sagen "dein Stil ist schlecht" ist in 99% aller Fälle Unfug.
Zitat von »"TrikkieMikkie"«
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 //----------------------------------------------------------------------------- // GLOBALS //----------------------------------------------------------------------------- long tempLong; long temp1Long; long temp2Long; long temp3Long; long temp4Long; long temp5Long; long temp6Long; long testLong ; long tempColor; long tempColor2; float testFloat; float tempFloat; float temp1Float; float temp2Float; float temp3Float; float temp4Float; float temp5Float; float temp6Float; float temp7Float; float temp8Float; float temp9Float; float temp10Float; float temp11Float; float temp12Float; D3DXMATRIX tempMatrix; D3DXMATRIX tempMatrix1; D3DXMATRIX tempMatrix2; D3DXMATRIX tempMatrix3; D3DXMATRIX tempMatrix4; D3DXVECTOR3 PlayerTempVerschiebungsvektor; D3DXVECTOR3 PlayerTemp2Verschiebungsvektor; D3DXVECTOR3 tempVektor3; D3DXVECTOR3 temp1Vektor3; D3DXVECTOR3 temp2Vektor3; D3DXVECTOR3 temp3Vektor3; D3DXVECTOR3 temp4Vektor3; D3DXVECTOR3 temp5Vektor3; D3DXVECTOR3 tempVelVektor3; // globaler Verschiebungs-(Geschwindigkeits)vektor
Beispielcode aus dem Buch "3D-Effekte für Spieleprogrammierer" von Alexander Rudolph
Sicaine
unregistriert
Werbeanzeige