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
Phili
unregistriert
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 |
#include "Engine/PH3DModel.h" #include "Engine/PH3DEffekt.h" #include "Engine/PH3DTextur.h" #include "Engine/PH3DMaterial.h" #include "Engine/PH3DKamera.h" #include "Engine/PH3DZeit.h" ofstream ofs("Protokoll.txt"); bool PH3DInit(int ResolutionX, int ResolutionY, D3DMULTISAMPLE_TYPE Multisampling, HINSTANCE hInstance,IDirect3DDevice9 **D3DDev) { ofs<<"Starte Initialisierung\n"; ofs<<"\tVariablen deklarieren\n"; WNDCLASSEX wndclassex; D3DPRESENT_PARAMETERS pp; HWND hwnd; IDirect3D9 *D3D; ofs<<"\t\tVariablen deklariert\n"; ofs<<"\tFenster initialisieren\n"; wndclassex.cbClsExtra= NULL; wndclassex.cbSize= sizeof(WNDCLASSEX); wndclassex.cbWndExtra= NULL; wndclassex.hbrBackground= NULL; wndclassex.hCursor= NULL; wndclassex.hIcon= NULL; wndclassex.hIconSm= NULL; wndclassex.hInstance= hInstance; wndclassex.lpfnWndProc= DefWindowProc; wndclassex.lpszClassName= LPCWSTR("Philip"); wndclassex.lpszMenuName= NULL; wndclassex.style= CS_CLASSDC; ofs<<"\t\tFenster initialisiert\n"; ofs<<"\tFenster registrieren\n"; RegisterClassEx(&wndclassex); ofs<<"\t\tFenster registriert\n"; ofs<<"\tFenster öffnen\n"; if(FAILED( hwnd = CreateWindowEx(NULL, LPCWSTR("Philip"), LPCWSTR("Philip"), WS_VISIBLE|WS_OVERLAPPEDWINDOW, 0, 0, 10, 10, NULL, NULL, hInstance, NULL))) ofs<<"\t\tFehler beim öffnen\n"; ofs<<"\t\tFenster geöffnet\n"; ofs<<"\tD3D Erstellen\n"; D3D = Direct3DCreate9(D3D_SDK_VERSION); ofs<<"\t\tD3D Erstellt\n"; ofs<<"\tPräsentationsparameter füllen\n"; ZeroMemory(&pp, sizeof(D3DPRESENT_PARAMETERS)); pp.BackBufferWidth = ResolutionX; pp.BackBufferHeight = ResolutionX; pp.BackBufferFormat = D3DFMT_A8R8G8B8; pp.BackBufferCount = 1; pp.MultiSampleType = Multisampling; pp.MultiSampleQuality = 0; pp.hDeviceWindow = hwnd; pp.Windowed = TRUE; pp.SwapEffect = D3DSWAPEFFECT_DISCARD; pp.FullScreen_RefreshRateInHz = 0; pp.PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT; pp.EnableAutoDepthStencil = 1; pp.AutoDepthStencilFormat = D3DFMT_D32; ofs<<"\t\tPräsentationsparameter gefüllt\n"; ofs<<"\tDevice Erstellen\n"; if(FAILED( D3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hwnd, D3DCREATE_HARDWARE_VERTEXPROCESSING, &pp, D3DDev))) ofs<<"\t\tFehler beim Erstellen\n"; ofs<<"\t\tDevice Erstellt\n"; ofs.close(); (*D3DDev)->SetFVF(D3DFVF_XYZ|D3DFVF_TEX1|D3DFVF_NORMAL); return 0; } void PH3DExit(IDirect3DDevice9 **D3DDev) { for(int i=0; i<TexturPool.TexturMenge; i++) TexturPool.Textur[i]->Release(); for(int i=0; i<ModelPool.ModelMenge; i++) ModelPool.Buffer[i]->Release(); (*D3DDev)->Release(); } |
C-/C++-Quelltext |
|
1 2 3 4 |
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) { IDirect3DDevice9 *D3DDev; PH3DInit(1024, 768, D3DMULTISAMPLE_NONE, hInstance, &D3DDev); |
Anonymous
unregistriert
Phili
unregistriert
Anonymous
unregistriert
Phili
unregistriert
Anonymous
unregistriert
Phili
unregistriert
C-/C++-Quelltext |
|
1 2 3 4 5 6 |
if (MessageBox (NULL, "Fenstermodus?", "Frage:", MB_YESNO) == IDYES) { // Ja, er will Fenstermodus! Variable dafür und den Style ändern! windowed = true; style = WS_OVERLAPPEDWINDOW; } |
Phili
unregistriert
Phili
unregistriert
Phili
unregistriert
Werbeanzeige