PDA

View Full Version : Trouble compiling v1.5


Dima
04-17-2004, 11:26 PM
Hey, im having trouble compiling the new 1.5 version, the 1.3 had no problems, but the new release gives a bunch of errors...

c:\Documents and Settings\Dima\Desktop\tbdxw_15\tbdxw\TBDXW\SpriteE ngine.cpp(479): error C2039: 'GetTransform' : is not a member of 'ID3DXSprite'
c:\Documents and Settings\Dima\Desktop\tbdxw_15\tbdxw\TBDXW\SpriteE ngine.cpp(90): error C2660: 'D3DXCreateFont' : function does not take 12 parameters
c:\Documents and Settings\Dima\Desktop\tbdxw_15\tbdxw\TBDXW\SpriteE ngine.cpp(157): error C2660: 'ID3DXFont::DrawTextA' : function does not take 6 parameters
c:\Documents and Settings\Dima\Desktop\tbdxw_15\tbdxw\TBDXW\SpriteE ngine.cpp(480): error C2039: 'SetTransform' : is not a member of 'ID3DXSprite'
c:\Documents and Settings\Dima\Desktop\tbdxw_15\tbdxw\TBDXW\SpriteE ngine.cpp(482): error C2660: 'ID3DXSprite::Draw' : function does not take 5 parameters
c:\Documents and Settings\Dima\Desktop\tbdxw_15\tbdxw\TBDXW\SpriteE ngine.cpp(488): error C2039: 'SetTransform' : is not a member of 'ID3DXSprite'
c:\Documents and Settings\Dima\Desktop\tbdxw_15\tbdxw\TBDXW\Graphic s.cpp(823): error C2065: 'D3DXSPRITE_ALPHABLEND' : undeclared identifier
c:\Documents and Settings\Dima\Desktop\tbdxw_15\tbdxw\TBDXW\Graphic s.cpp(823): error C2065: 'D3DXSPRITE_SORT_TEXTURE' : undeclared identifier
c:\Documents and Settings\Dima\Desktop\tbdxw_15\tbdxw\TBDXW\Graphic s.cpp(823): error C2296: '|' : illegal, left operand has type ''unknown-type''
c:\Documents and Settings\Dima\Desktop\tbdxw_15\tbdxw\TBDXW\Graphic s.cpp(823): error C2297: '|' : illegal, right operand has type ''unknown-type''
c:\Documents and Settings\Dima\Desktop\tbdxw_15\tbdxw\TBDXW\Graphic s.cpp(827): error C2065: 'D3DXSPRITE_SORT_DEPTH_FRONTTOBACK' : undeclared identifier
c:\Documents and Settings\Dima\Desktop\tbdxw_15\tbdxw\TBDXW\Graphic s.cpp(827): error C2440: '=' : cannot convert from ''unknown-type'' to 'DWORD'
c:\Documents and Settings\Dima\Desktop\tbdxw_15\tbdxw\TBDXW\Graphic s.cpp(830): error C2065: 'D3DXSPRITE_OBJECTSPACE' : undeclared identifier
c:\Documents and Settings\Dima\Desktop\tbdxw_15\tbdxw\TBDXW\Graphic s.cpp(830): error C2440: '=' : cannot convert from ''unknown-type'' to 'DWORD'
c:\Documents and Settings\Dima\Desktop\tbdxw_15\tbdxw\TBDXW\Graphic s.cpp(833): error C2065: 'D3DXSPRITE_BILLBOARD' : undeclared identifier
c:\Documents and Settings\Dima\Desktop\tbdxw_15\tbdxw\TBDXW\Graphic s.cpp(833): error C2440: '=' : cannot convert from ''unknown-type'' to 'DWORD'
c:\Documents and Settings\Dima\Desktop\tbdxw_15\tbdxw\TBDXW\Graphic s.cpp(838): error C2297: '|=' : illegal, right operand has type ''unknown-type''
c:\Documents and Settings\Dima\Desktop\tbdxw_15\tbdxw\TBDXW\Graphic s.cpp(841): error C2297: '|=' : illegal, right operand has type ''unknown-type''
c:\Documents and Settings\Dima\Desktop\tbdxw_15\tbdxw\TBDXW\Graphic s.cpp(843): error C2065: 'D3DXSPRITE_SORT_DEPTH_BACKTOFRONT' : undeclared identifier
c:\Documents and Settings\Dima\Desktop\tbdxw_15\tbdxw\TBDXW\Graphic s.cpp(843): error C2297: '|=' : illegal, right operand has type ''unknown-type''
c:\Documents and Settings\Dima\Desktop\tbdxw_15\tbdxw\TBDXW\Graphic s.cpp(847): error C2297: '|=' : illegal, right operand has type ''unknown-type''
c:\Documents and Settings\Dima\Desktop\tbdxw_15\tbdxw\TBDXW\Graphic s.cpp(850): error C2660: 'ID3DXSprite::Begin' : function does not take 1 parameters
c:\Documents and Settings\Dima\Desktop\tbdxw_15\tbdxw\TBDXW\Graphic s.cpp(1094): error C2039: 'SetWorldViewLH' : is not a member of 'ID3DXSprite'
C:\Program Files\Microsoft Visual Studio .NET\Vc7\include\xhash(38): error C2440: 'type cast' : cannot convert from 'const std::string' to 'size_t'
C:\Program Files\Microsoft Visual Studio .NET\Vc7\include\xhash(38): error C2440: 'type cast' : cannot convert from 'const std::string' to 'size_t'


am I doing something wrong? i have DXSDK 9.0 installed

thanks for any help in advance,
Dima

bladder
04-18-2004, 07:14 AM
All the errors except for the last two are occuring because it seems like you dont have the latest dx9 sdk installed.

They released an updated version of the dx9 sdk quite a while back. And they're actually releasing another update to the dx9 sdk really soon, again. Anyway, download the latest sdk and those errors should go away.

The last two errors are because of a bug in the stl that comes with visual studio. To fix it, open up the file xhash and change this


size_t operator()(const _Kty& _Keyval) const
{
return ((size_t)_Keyval);
}


to this:


size_t operator()(const _Kty& _Keyval) const
{
return comp(_Keyval);
}


Also FYI , the next release dosn't use hash maps. Let me know if you have any more problems.

Dima
04-18-2004, 11:08 AM
Thanks for the info, I kinda thought that it couldbe caused by the SDK, i'll download the new version asap, can't wait to use the console functions, hehe

kee up the good work,
Dima

Dima
04-18-2004, 10:11 PM
I just installed the new SDK 9.0b Summer Update, and fixed the hash line, it compiles perfectly now. I like how the info is displayed and being able to switch resolutions at runtime is awesome, very easy to set up and very functional.

One problem though, cant use console.. when I press F12 i get errors:

"Unhandled exception at 0x77f7f570 in TBDXW.exe: User breakpoint"

then when i click break it shows this:
"There is no source code available for the current location."

then when i click disassembly it points to a line in the middle of the Disassembly file: "77F7F570 int 3"

However if I click continue and not break, program runs again and shows/hides console.. every time i press F12 though, it gives that error.. any idea what it could be? I am very unaware of what could cause this, me = noob.

thanks again for the help

Dima
04-18-2004, 10:14 PM
hmm, just tried running the exe from the folder and not by pressing F5 in the IDE, and no problems.. hmm weird

bladder
04-19-2004, 01:01 AM
that is indeed very strange...

It's even stranger then when you press break it dosnt show anything. Try this, when you hit the break point and go to the dissasembly. Then in the output window, check the tabs under it and you should see a tab that says "Call Stack" click that tab and you'll get a list of the functions the exe had called before it hit the break point. Click on the functions and see the path the exe takes through them.

Hopefully, we can find out where the problem is occuring at least,

Dima
04-19-2004, 09:58 PM
Hi, im having another problem...

Maybe im tired or something but I cant figure out what's up.. I set up a camera and create light, material, and a sphere from D3DX. When I press ALT+ENTER to change fullscreen mode and back the sphere disapears. This is my code:


#include "tbdxw.h"

class MyClass : public DXW::Core
{
DXW::Camera cam;
DXW::Font fnt;

LPD3DXMESH pSphere;

bool Init()
{
SetWindowName( "Safrosoft RoX" );
SetFullscreenMode( false );
SetWndWidth( 640 );
SetWndHeight( 480 );
SetWidthHeight( 1024, 768 );
EnableFullscreenCursor( false );
EnableVSync( false );

ShowInfoFPS( true );
ShowInfoCamDir( true );
ShowInfoBBFmt( true );
ShowInfoDSFmt( true );
ShowInfoWH( true );

ShowInfo( true );

pSphere = NULL;

return true;
}

void Kill()
{
}

bool CreateManaged()
{
cam.Point ( 0.0f, 0.0f, -30.0f, 0.0f, 0.0f, 0.0f );
cam.Update();

fnt.Init ( GetGfxPtr(),18,"Impact",false, false );

GetGfxPtr()->SetCamera ( &cam );

return true;
}

void KillManaged()
{
}

bool CreateUnmanaged()
{

// Create sphere and cone meshes to represent the lights
if (FAILED( D3DXCreateSphere(GetGfxPtr()->DeviceCom(), 5.25f, 20, 20, &pSphere, NULL) ) )
return false;

// Setup a material
D3DMATERIAL9 mtrl;

ZeroMemory( &mtrl, sizeof(D3DMATERIAL9) );
mtrl.Diffuse.a = mtrl.Ambient.a = 1.0f;
mtrl.Diffuse.r = mtrl.Ambient.r = 1.0f;
mtrl.Diffuse.g = mtrl.Ambient.g = 1.0f;
mtrl.Diffuse.b = mtrl.Ambient.b = 1.0f;

GetGfxPtr()->DeviceCom()->SetMaterial( &mtrl );

D3DLIGHT9 light;

D3DXVECTOR3 vecLightDirUnnormalized( 1.0f, -1.0f , 2.0f );
ZeroMemory( &light, sizeof(D3DLIGHT9) );

light.Type = D3DLIGHT_DIRECTIONAL;
light.Diffuse.r = 1.0f;
light.Diffuse.g = 1.0f;
light.Diffuse.b = 1.0f;
D3DXVec3Normalize( (D3DXVECTOR3*)&light.Direction, &vecLightDirUnnormalized );
light.Position.x = -1.0f;
light.Position.y = -1.0f;
light.Position.z = -2.0f;
light.Range = 1000.0f;

GetGfxPtr()->DeviceCom()->SetLight( 0, &light );
GetGfxPtr()->DeviceCom()->LightEnable( 0, TRUE );

GetGfxPtr()->SetRenderState( D3DRS_LIGHTING, TRUE );

GetGfxPtr()->SetRenderState( D3DRS_NORMALIZENORMALS,TRUE );

GetGfxPtr()->DeviceCom()->SetSamplerState(0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR);
GetGfxPtr()->DeviceCom()->SetSamplerState(0, D3DSAMP_MINFILTER, D3DTEXF_LINEAR);
GetGfxPtr()->DeviceCom()->SetSamplerState(0, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR);


return true;
}


void KillUnmanaged()
{
SAFE_RELEASE(pSphere);
}

bool Update( const int ms )
{

return true;
}

bool Render()
{

GetGfxPtr()->SpriteBegin( GetGfxPtr()->SPRITE_FONT );
fnt.Draw ("Muahahaha", 10, 100, D3DXCOLOR( 1.0f, 0.0f, 0.0f, 1.0f ));
GetGfxPtr()->SpriteEnd();

pSphere->DrawSubset(0);

return true;
}


};

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Application entry point ///
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE, LPSTR, int )
{
MyClass m;
m.Run( hInstance );
return 0;
}


everything seems to be in the right place, not sure though, very simple code, thanks for the help. Awesoem wrapper, functions perfect

Dima
04-19-2004, 10:36 PM
omg, stupid me...

moved the GetGfxPtr()->SetCamera ( &cam ); function to CreateUnmanaged, everything works :)

should have thought about it before posting, thanks anyways

bladder
04-20-2004, 02:31 AM
So is the console working now? Or is it still crashing?

Dima
04-20-2004, 08:21 AM
the console stil crashed.. nothng in the code that can cause this, because it is fine when I run the EXE from the folders... weird stufff...

Descartes
07-02-2004, 09:29 AM
:( Dear Dima, Can you help Me please? I have the same errors with compiling version 1.6 as you. I have DirectX 9.0b SDK. But it dont work.
The same errors are there. The sprite functions are not the same.
What have you done to fix the error's downloading something else from MS Dx?

regards Descartes,

bladder
07-02-2004, 08:21 PM
What have you done to fix the error's downloading something else from MS Dx?
He just downloaded the latest DX SDK to fix those errors.


Are they the *exact* same errors? And when is the last time you updated your dx sdk if they are.

Descartes
07-03-2004, 01:15 AM
:( Yes the Error's are the same, when i am using DX SDK 9.0 no trouble, i have download the DX 9.0b version in the end of 2003.
The trouble are the sprite functions. Can you tell me the URL where to download the version u are using? Do you have version 1.6 or 1.5? maybe 1.6 have change the sprite functions? On the internet i have read something about DX 9.0b summer version. This is summer 2003 is this the latest version?
ps: i am using version 1.6 from triplebuffer.

thanks for helping me, Henk :blush:

Descartes
07-03-2004, 02:10 AM
:yes: It works. Yes, I have download the Summer 2003 SDK UpDate version from MS, Install this compiling in VC .NET 2003 and VC 6.0 SP5 and yes it works fine.
Thanks to all for helping me out.

Regards Descartes, Happy Coding,,,, :rolleyes: