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
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 |
#include <TriBase.h> #include "..\\Buch\\3D Spieleprogrammierung\\Beispiele\\Allgemeines\\InitWindow.h" #include "..\\Buch\\3D Spieleprogrammierung\\Beispiele\\Allgemeines\\Direct3DEnum.h" #include "..\\Buch\\3D Spieleprogrammierung\\Beispiele\\Allgemeines\\InitDirect3D.h" tbResult InitApplication(); tbResult ExitApplication(); tbResult Render(float fNumSecsPassed); tbResult Move(float fNumSecsPassed); float g_fTime = 0.0f; int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd ) { tbResult Result; Result = InitApplication(); if (Result == TB_ERROR) { MessageBox(NULL,"Fehler beim Initialisieren der Anwendung!","Fehler",MB_OK | MB_ICONERROR); return 1; } else if (Result == TB_CANCELED) { return 0; } tbDoMessageLoop(Move,Render); ExitApplication(); return 0; } tbResult InitApplication() { if(tbInit()) { MessageBox(NULL,"Fehler beim Initialisieren der Engine!","Fehler",MB_OK | MB_ICONERROR); } SDirect3DParameters Direct3DParameters; tbResult Result; Result = GetDirect3DParameters(&Direct3DParameters); if (Result == TB_ERROR) { MessageBox(NULL,"Fehler beim abfragen der Direct3D Parameter!","Fehler",MB_OK | MB_ICONERROR); return TB_ERROR; } else if (Result == TB_CANCELED) { tbExit(); return TB_CANCELED; } if (InitWindow(Direct3DParameters.VideoMode.Width,Direct3DParameters.VideoMode.Height, "Testumgebung",NULL)) { MessageBox(NULL,"Fehler beim erstellen des Fensters!","Fehler",MB_OK | MB_ICONERROR); tbExit(); return TB_ERROR; } if (InitDirect3D(&Direct3DParameters,g_hWindow)) { MessageBox(NULL,"Fehler beim Initialisieren von Direct3D!","Fehler",MB_OK | MB_ICONERROR); ExitWindow(); tbExit(); return TB_ERROR; } return TB_OK; } tbResult ExitApplication() { ExitWindow(); ExitDirect3D(); tbExit(); return TB_OK; } tbResult Move(float fNumSecsPassed) { g_fTime += fNumSecsPassed; return TB_OK; } tbResult Render(float fNumSecsPassed) { return TB_OK; } |
Werbeanzeige