Hallo zusammen,
habe gerade auch einige Probleme mit dem Fullscreen, soweit ich das sehe müsste aber eigentlich alles klappen.
Beim Ausführen erscheint immer das schwarze Fenster und die zweite Fehlermeldung.
Hier mal die Initialisierungsfunktion:
|
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
|
PDIRECT3D9 g_pD3D = NULL;
PDIRECT3DDEVICE9 g_pD3DDevice = NULL;
//-----------------------------------------------------------------------------------------------
// SeDirect3DInit
//-----------------------------------------------------------------------------------------------
SeReturn SeDirect3DInit()
{
//Globale Direct3D Schnittstelle erstellen
if(!SUCCEEDED(g_pD3D = Direct3DCreate9(D3D_SDK_VERSION)))
{
MessageBox(NULL,"Die Direct3D-Schnittstelle konnte nicht angelegt werden", "Fehler",NULL);
return SE_ERROR;
}
//Darstellungseinstellungen
D3DPRESENT_PARAMETERS PresentParams;
ZeroMemory(&PresentParams, sizeof(D3DPRESENT_PARAMETERS));
PresentParams.BackBufferWidth = 1024;
PresentParams.BackBufferHeight = 768;
PresentParams.BackBufferFormat = D3DFMT_R5G6B5;
PresentParams.BackBufferCount = 1;
PresentParams.MultiSampleType = D3DMULTISAMPLE_NONE;
PresentParams.MultiSampleQuality = 0;
PresentParams.SwapEffect = D3DSWAPEFFECT_DISCARD;
PresentParams.hDeviceWindow = g_hWindow;
PresentParams.Windowed = FALSE;
PresentParams.EnableAutoDepthStencil = TRUE;
PresentParams.AutoDepthStencilFormat = D3DFMT_D24S8;
PresentParams.Flags = D3DPRESENTFLAG_LOCKABLE_BACKBUFFER;
PresentParams.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT;
PresentParams.PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT;
//Anlegen des Direct3D-Device
if(!SUCCEEDED(g_pD3D->CreateDevice(
D3DADAPTER_DEFAULT,
D3DDEVTYPE_HAL,
g_hWindow,
D3DCREATE_MIXED_VERTEXPROCESSING,
&PresentParams,
&g_pD3DDevice)))
{
MessageBox(NULL,"Erstellen des Direct3D-Device fehlgeschlagen", "Fehler",NULL);
return SE_ERROR;
}
return SE_OK;
}
|