dev.gamez.lv Forum Index dev.gamez.lv
Latvian Game Developers Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups 

tiiri sintakses kluudas..

 
dev.gamez.lv Forum Index -> Microsoft DirectX
View previous topic :: View next topic  
Author Message
zutiic
Indago dalībnieks
Indago dalībnieks


Joined: 12 Jan 2004
Posts: 140
Location: Rīga

PostPosted: Sat Oct 15, 2005 11:02 am    Post subject: tiiri sintakses kluudas..

joprojaam nesaprotu, kaados gadiijumos komileejot met shitaadas kluudas? kur ir probleema?
Code:
 D3DPRESENT_PARAMETERS   p_parameters;      // lieto lai iestatiitu ekraana parametrus
   LPDIRECTINPUT8      DX_input_dev;         // lieto lai lietotu "inputu"
   LPDIRECTINPUTDEVICE8   DX_input_dev_keyb;      // "inputa deviice"


un kluudu izklaasti..
Quote:
d:\my documents\zuc\_zucengine\engine_test\zucengine.h(32) : error C2146: syntax error : missing ';' before identifier 'DX_input_dev'
d:\my documents\zuc\_zucengine\engine_test\zucengine.h(32) : error C2501: 'LPDIRECTINPUT8' : missing storage-class or type specifiers
d:\my documents\zuc\_zucengine\engine_test\zucengine.h(32) : fatal error C1004: unexpected end of file found

visur takss esmu kaartiigi salicis semikolus.. kur ir vaina?
Back to top
View user's profile Send e-mail
elvman
Indago Uzvarētājs
Indago Uzvarētājs


Joined: 09 Apr 2003
Posts: 1278
Location: Kuldiga

PostPosted: Sat Oct 15, 2005 11:20 am    Post subject:

Tu neesi izdariijis sekojosho:
#include <dinput.h>
savaa projektaa

Vaina ir nevis semikolos, bet tajaa ka vinsh nepaziist shaadus tipus. Shie tipi ir defineeti dinput.h failaa
_________________
long time; /* know C */
Back to top
View user's profile Visit poster's website
zutiic
Indago dalībnieks
Indago dalībnieks


Joined: 12 Jan 2004
Posts: 140
Location: Rīga

PostPosted: Sat Oct 15, 2005 11:30 am    Post subject:

esmu gan "incluudojis" dinput.h. piemeeram, par taadaam f-cijaam, kaa DirectInput8Create (kura arii skiet defineeta dinput.h) man kluudas nemet, bet nekas joprojaam nestraadaa..
Back to top
View user's profile Send e-mail
elvman
Indago Uzvarētājs
Indago Uzvarētājs


Joined: 09 Apr 2003
Posts: 1278
Location: Kuldiga

PostPosted: Sat Oct 15, 2005 11:33 am    Post subject:

Pirms #include <dinput.h> ileiec:
#define DIRECTINPUT_VERSION 0x0800
Kods:
Code:
#define DIRECTINPUT_VERSION 0x0800
#include <dinput.h>

_________________
long time; /* know C */
Back to top
View user's profile Visit poster's website
zutiic
Indago dalībnieks
Indago dalībnieks


Joined: 12 Jan 2004
Posts: 140
Location: Rīga

PostPosted: Sat Oct 15, 2005 11:41 am    Post subject:

jau izmeeginaaju, bet neliidz. ieprieksh vienkaarshi dariiju shitaa..
Quote:
DirectInput8Create(wc.hInstance, 0x0800, IID_IDirectInput8, (void**)&DX_input_dev, NULL);
Back to top
View user's profile Send e-mail
elvman
Indago Uzvarētājs
Indago Uzvarētājs


Joined: 09 Apr 2003
Posts: 1278
Location: Kuldiga

PostPosted: Sat Oct 15, 2005 11:56 am    Post subject:

Ieej Tools->Options->Directories (VC++). Panjem include files un C:\DXSDK\Include (manaa variantaa) uzbiidi liidz pashai augshai. Probleema ir tajaa, ka tavs c++ izmanto to dinput.h kas ir vinja pasha iclude folderii un tas dinput.h fails ri novecojis.
_________________
long time; /* know C */
Back to top
View user's profile Visit poster's website
zutiic
Indago dalībnieks
Indago dalībnieks


Joined: 12 Jan 2004
Posts: 140
Location: Rīga

PostPosted: Sat Oct 15, 2005 1:52 pm    Post subject:

oppaa - kaut kas notiek! paldies, elvman! atklaajaas, ka bija noraadiits nepareizs sdk folderis (kkad paarkaartoju kompi un paarnesu sdk no c uz d disku).
tagad paraadaas jaunas probleemas "linkingaa":
Quote:
First-chance exception in engine_test.exe: 0xC0000005: Access Violation.

noraada uz sekojosho rindinju programmas ciklaa:
Code:
DX_input_dev_keyb->GetDeviceState(sizeof(keys), keys);

, kur bool keys[256]; un LPDIRECTINPUTDEVICE8 DX_input_dev_keyb;
Back to top
View user's profile Send e-mail
elvman
Indago Uzvarētājs
Indago Uzvarētājs


Joined: 09 Apr 2003
Posts: 1278
Location: Kuldiga

PostPosted: Sat Oct 15, 2005 1:59 pm    Post subject:

Raksti labaak taa:
Code:
BYTE diks[256];
ZeroMemory( diks, 256 );
DX_input_dev_keyb->GetDeviceState( 256, diks );

Un kljuuda ir tajaa, ka tu izmanto sizeof(keys) - tas buus 4 baiti, jo shajaa gadiijumaa tas atgriezh pointera lielumu nevis visa array lielumu
_________________
long time; /* know C */
Back to top
View user's profile Visit poster's website
Guest






PostPosted: Sat Oct 15, 2005 2:38 pm    Post subject:

Code:
  BYTE keys[256];  // piespiestaas pogas
  ...
  ZeroMemory(keys, 256);                    // atjauno piespieso pogu saturu
  DX_input_dev_keyb->GetDeviceState(256, keys);

nekas neliidz. kluudas nemet tikai tad , kad nav GetDeviceState.
meeginaaju arii DX_input_dev_keyb->GetDeviceState(256, &keys); un DX_input_dev_keyb->GetDeviceState(256,(LPVOID)&keys);, bet nekaa:(
Back to top
zutiic
Indago dalībnieks
Indago dalībnieks


Joined: 12 Jan 2004
Posts: 140
Location: Rīga

PostPosted: Sat Oct 15, 2005 2:39 pm    Post subject:

bll... aizmirsu ielogoties
Back to top
View user's profile Send e-mail
elvman
Indago Uzvarētājs
Indago Uzvarētājs


Joined: 09 Apr 2003
Posts: 1278
Location: Kuldiga

PostPosted: Sat Oct 15, 2005 2:48 pm    Post subject:

Code:
DirectInput8Create( GetModuleHandle(NULL), DIRECTINPUT_VERSION,
    IID_IDirectInput8, (VOID**)&m_pDI, NULL );
   
m_pDI->CreateDevice( GUID_SysMouse, &m_pMouse, NULL );

m_pDI->CreateDevice( GUID_SysKeyboard, &m_pKeyboard, NULL )))

m_pMouse->SetDataFormat( &c_dfDIMouse2 );         
m_pKeyboard->SetDataFormat( &c_dfDIKeyboard );

DIPROPDWORD dipdw;
dipdw.diph.dwSize       = sizeof(DIPROPDWORD);
dipdw.diph.dwHeaderSize = sizeof(DIPROPHEADER);
dipdw.diph.dwObj        = 0;
dipdw.diph.dwHow        = DIPH_DEVICE;
dipdw.dwData            = INPUT_BUFFER_SIZE; // Arbitary buffer size

m_pMouse->SetProperty( DIPROP_BUFFERSIZE, &dipdw.diph );         
m_pKeyboard->SetProperty( DIPROP_BUFFERSIZE, &dipdw.diph );

m_pMouse->Acquire();
m_pKeyboard->Acquire();

Ja izmantosi shito kodu, kljuudaam nevajadzeetu buut.
_________________
long time; /* know C */
Back to top
View user's profile Visit poster's website
zutiic
Indago dalībnieks
Indago dalībnieks


Joined: 12 Jan 2004
Posts: 140
Location: Rīga

PostPosted: Sat Oct 15, 2005 3:50 pm    Post subject:

viss sanaaca. plds veelrez:D
Back to top
View user's profile Send e-mail
Display posts from previous:   
dev.gamez.lv Forum Index -> Microsoft DirectX All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group