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 |
tbDirect3D& D3D = tbDirect3D::Instance(); D3D.GetDevice()->DrawPrimitiveUP(...); |
Quellcode |
|
1 2 |
tbDirect3D& D3D = tbDirect3D::Instance(); D3D->DrawPrimitiveUP(...); |
Administrator
Administrator
Quellcode |
|
1 2 3 |
tbDirect3D& D3D = tbDirect3D::Instance(); D3D.MethodeDieNichtVonIDirect3DDevice9Stammt(); D3D->MethodeDieVonIDirect3DDevice9Stammt(); |
Administrator
Administrator
Quellcode |
|
1 2 3 4 5 6 7 8 |
class CStaticClass { public: static int iIrgendeineZahl; static float fIrgendeineKommazahl; ... }; |
Quellcode |
|
1 2 3 |
// Statische Variablen deklarieren int CStaticClass::iIrgendeineZahl; float CStaticClass::fIrgendeineKommazahl; |
Quellcode |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
class RA_API RA_D3D { private: RA_D3D (void); static RA_D3D m_Instance;//The one and only :) LPDIRECT3D9 m_pD3D; LPDIRECT3DDEVICE9 m_pD3DDEVICE; HWND hWnd; public: HRESULT InitD3D(); static RA_D3D &getInstance (void) { return (m_Instance); } }; |
Quellcode |
|
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 |
HRESULT RA_D3D::InitD3D() { RA_D3D RA_D3D::m_Instance = NULL; WNDCLASSEX WindowClass = { sizeof(WNDCLASSEX), CS_CLASSDC, WindowProc, 0, 0, GetModuleHandle(NULL), NULL, NULL, NULL, NULL, "Direct3D window", NULL}; if (!RegisterClassEx(&WindowClass)) return(0); if(FAILED(this->hWnd = CreateWindowEx(NULL,"Direct3D window", "DXInit", WS_VISIBLE | WS_OVERLAPPEDWINDOW, GetSystemMetrics(SM_CXSCREEN) / 2 - 800 / 2, GetSystemMetrics(SM_CYSCREEN) / 2 - 600 / 2, 800, 600, NULL, NULL, GetModuleHandle(NULL), NULL))) { ERRORMSG("ERRORWin"); } RA_D3D &D3D = RA_D3D::getInstance(); if(FAILED(this->m_pD3D=Direct3DCreate9(D3D_SDK_VERSION))) { ERRORMSG("ERROR"); } return 0; } |
Quellcode |
|
1 2 |
D:\RaProjekt\RA_D3D.CPP(13) : error C2655: 'm_Instance' : Definition oder Neudeklaration im aktuellen Gueltigkeitsbereich unzulaessig d:\raprojekt\ra_d3d.h(11) : Siehe Deklaration von 'm_Instance' |
Werbeanzeige