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
Administrator
Quellcode |
|
1 2 3 4 5 6 7 8 9 10 |
// Struktur für globale Variablen struct GlobalVars { HWND Window; HINSTANCE Instance; LPDIRECTINPUT8 DInput; LPDIRECTINPUTDEVICE8 Keyboard; LPDIRECTINPUTDEVICE8 Mouse; LPDIRECTINPUTDEVICE8 Joystick; }; |
Quellcode |
|
1 2 3 4 |
#include "Global.h" // Hier wird die Variable deklariert GlobalVars MyGlobalVars; |
Quellcode |
|
1 2 3 4 5 |
#include "Global.h" // Die Variable "MyGlobalVars" darf nicht nochmal deklariert werden! // Wir verschaffen uns mit "extern" Zugriff darauf! extern GlobalVars MyGlobalVars; |
Administrator
Administrator
Quellcode |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
// ask if windowed or fullscreen mode? if (MessageBox(win_.hWnd, "Start in windowed mode?", "ZFX Tutorial", MB_YESNO|MB_ICONINFORMATION) == IDNO) win_.bWindowed = false; else win_.bWindowed = true; [b] hr = MyDI.InitDI(); if (FAILED(hr )) { g_.bDone = true; }[/b] // try to start the engine if ( FAILED( MyApp.Init(win_) )) { MessageBox(g_.hWnd, "Initializing Application_C failed.", "ZFX Tutorial Report", MB_OK | MB_ICONERROR); fprintf(win_.pLog, "error: no compatible graphics adapter \n"); fflush(win_.pLog); win_.bDone = true; } |
Werbeanzeige