Hallo, ich hab mich entschlossen, mal etwas ganz ohne TriBase zu machen, also nur mit d3dx und so. Aber als mit dem Vollbildmodus klappt's nicht so richtig. Man scheint immer noch mit der Startleiste agieren zu können. Wenn ich kan unten klicke, wird das Programm minimiert. Und die Startleiste flimmert auch so komisch hervor.
Ich hab mal etwas Code hier:
|
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
|
HRESULT InitD3D( HWND hWnd )
{
if( NULL == ( g_pD3D = Direct3DCreate9( D3D_SDK_VERSION ) ) )
return E_FAIL;
D3DPRESENT_PARAMETERS pp;
ZeroMemory(&pp,sizeof(D3DPRESENT_PARAMETERS));
pp.BackBufferCount= 1; //We only need a single back buffer
pp.MultiSampleType=D3DMULTISAMPLE_NONE; //No multi-sampling
pp.MultiSampleQuality=0; //No multi-sampling
pp.SwapEffect = D3DSWAPEFFECT_DISCARD; // Throw away previous frames, we don't need them
pp.hDeviceWindow=hWnd; //This is our main (and only) window
pp.Flags=0; //No flags to set
pp.FullScreen_RefreshRateInHz=75; //Default Refresh Rate
pp.PresentationInterval=D3DPRESENT_INTERVAL_ONE;
//Default Presentation rate
pp.BackBufferFormat=D3DFMT_X8R8G8B8; //Display format
pp.EnableAutoDepthStencil=TRUE; //No depth/stencil buffer
pp.AutoDepthStencilFormat = D3DFMT_D24X8;
pp.Windowed = FALSE;
pp.BackBufferWidth = 800;
pp.BackBufferHeight = 600;
if( FAILED( g_pD3D->CreateDevice( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd,
D3DCREATE_HARDWARE_VERTEXPROCESSING,
&pp, &g_pD3DDevice ) ) )
{
return E_FAIL;
}
ShowCursor(FALSE);
// Turn on the zbuffer
g_pD3DDevice->SetRenderState( D3DRS_ZENABLE, TRUE );
// Turn on ambient lighting
g_pD3DDevice->SetRenderState( D3DRS_AMBIENT, 0xffffffff );
return S_OK;
}
|