RE: poke4 won't accept my 32bit values

new topic     » goto parent     » topic index » view thread      » older message » newer message

Yeah, I agree, this doesn't make any sense whats so ever. The 'C' 
translated code is:

    // Fill the array of TL vertices with untransformed data for the 
cube
    g_pvCube[0] = D3DTLVERTEX( D3DVECTOR(-1,-1,-1 ), 0, 0xffffffff, 0, 
0, 0 );
    g_pvCube[1] = D3DTLVERTEX( D3DVECTOR( 1,-1,-1 ), 0, 0xff00ffff, 0, 
0, 0 );
    g_pvCube[2] = D3DTLVERTEX( D3DVECTOR(-1, 1,-1 ), 0, 0xffff00ff, 0, 
0, 0 );
    g_pvCube[3] = D3DTLVERTEX( D3DVECTOR( 1, 1,-1 ), 0, 0xff0000ff, 0, 
0, 0 );
    g_pvCube[4] = D3DTLVERTEX( D3DVECTOR(-1,-1, 1 ), 0, 0xffffff00, 0, 
0, 0 );
    g_pvCube[5] = D3DTLVERTEX( D3DVECTOR( 1,-1, 1 ), 0, 0xff00ff00, 0, 
0, 0 );
    g_pvCube[6] = D3DTLVERTEX( D3DVECTOR(-1, 1, 1 ), 0, 0xffff0000, 0, 
0, 0 );
    g_pvCube[7] = D3DTLVERTEX( D3DVECTOR( 1, 1, 1 ), 0, 0xff000000, 0, 
0, 0 );

definition of D3DTLVERTEX is:

typedef struct _D3DTLVERTEX { 
    union { 
        D3DVALUE sx; 
        D3DVALUE dvSX; 
    }; 
    union { 
        D3DVALUE sy; 
        D3DVALUE dvSY; 
    }; 
    union { 
        D3DVALUE sz; 
        D3DVALUE dvSZ; 
    }; 
    union { 
        D3DVALUE rhw; 
        D3DVALUE dvRHW; 
    }; 
    union { 
        D3DCOLOR color; 
        D3DCOLOR dcColor; 
    }; 
    union { 
        D3DCOLOR specular; 
        D3DCOLOR dcSpecular; 
    }; 
    union { 
        D3DVALUE tu; 
        D3DVALUE dvTU; 
    }; 
    union { 
        D3DVALUE tv; 
        D3DVALUE dvTV; 
    }; 
} D3DTLVERTEX, *LPD3DTLVERTEX; 

Definition of D3DVECTOR is:

typedef struct _D3DVECTOR { 
    union { 
        D3DVALUE x; 
        D3DVALUE dvX; 
    }; 
    union { 
        D3DVALUE y; 
        D3DVALUE dvY; 
    }; 
    union { 
        D3DVALUE z; 
        D3DVALUE dvZ; 
    }; 
} D3DVECTOR, *LPD3DVECTOR; 



Definition of D3DVALUE is:

typedef float D3DVALUE, *LPD3DVALUE; 

This code in question works fine how I set up "windows" code
to get the Exotica dll working with Euphoira. Chris uses a diferent
method to set up "windows" to get the Exotica dll working in 
Euphoria using his ExoticaX sdk.

the translated code of what is at the very top of this page
in Euphoira is:

   poke( pvCube   ,atom_to_float32(-1.0))
   poke( pvCube+4 ,atom_to_float32(-1.0))
   poke( pvCube+8 ,atom_to_float32(-1.0))
   poke( pvCube+12,atom_to_float32(0.0))
   poke4(pvCube+16,{#FFFFFFFF,0})           -- *DP*  This is where the 
program will crash in the adverse file
   --poke(pvCube+20,0)
   poke( pvCube+24,atom_to_float32(0.0))
   poke( pvCube+28,atom_to_float32(0.0))

   poke( pvCube+32,atom_to_float32( 1.0))
   poke( pvCube+36,atom_to_float32(-1.0))
   poke( pvCube+40,atom_to_float32(-1.0))
   poke( pvCube+44,atom_to_float32(0.0))
   poke4(pvCube+48,{#FF00FFFF,0})
   --poke(pvCube+52,0)
   poke( pvCube+56,atom_to_float32(0.0))
   poke( pvCube+60,atom_to_float32(0.0))

   poke( pvCube+64,atom_to_float32(-1.0))
   poke( pvCube+68,atom_to_float32( 1.0))
   poke( pvCube+72,atom_to_float32(-1.0))
   poke( pvCube+76,atom_to_float32(0.0))
   poke4(pvCube+80,{#FFFF00FF,0})
   --poke(pvCube+84,0)
   poke( pvCube+88,atom_to_float32(0.0))
   poke( pvCube+92,atom_to_float32(0.0))

   poke( pvCube+96,atom_to_float32( 1.0))
   poke( pvCube+100,atom_to_float32( 1.0))
   poke( pvCube+104,atom_to_float32(-1.0))
   poke( pvCube+108,atom_to_float32(0.0))
   poke4(pvCube+112,{#FF0000FF,0})
   --poke(pvCube+116,0)
   poke( pvCube+120,atom_to_float32(0.0))
   poke( pvCube+124,atom_to_float32(0.0))

   poke( pvCube+128,atom_to_float32(-1.0))
   poke( pvCube+132,atom_to_float32(-1.0))
   poke( pvCube+136,atom_to_float32( 1.0))
   poke( pvCube+140,atom_to_float32(0.0))
   poke4(pvCube+144,{#FFFFFF00,0})
   --poke(pvCube+148,0)
   poke( pvCube+152,atom_to_float32(0.0))
   poke( pvCube+156,atom_to_float32(0.0))

   poke( pvCube+160,atom_to_float32( 1.0))
   poke( pvCube+164,atom_to_float32(-1.0))
   poke( pvCube+168,atom_to_float32( 1.0))
   poke( pvCube+172,atom_to_float32(0.0))
   poke4(pvCube+176,{#FF00FF00,0})
   --poke(pvCube+180,0)
   poke( pvCube+184,atom_to_float32(0.0))
   poke( pvCube+188,atom_to_float32(0.0))

   poke( pvCube+192,atom_to_float32(-1.0))
   poke( pvCube+196,atom_to_float32( 1.0))
   poke( pvCube+200,atom_to_float32( 1.0))
   poke( pvCube+204,atom_to_float32(0.0))
   poke4(pvCube+208,{#FFFF0000,0})
   --poke(pvCube+212,0)
   poke( pvCube+216,atom_to_float32(0.0))
   poke( pvCube+220,atom_to_float32(0.0))

   poke( pvCube+224,atom_to_float32( 1.0))
   poke( pvCube+228,atom_to_float32( 1.0))
   poke( pvCube+232,atom_to_float32( 1.0))
   poke( pvCube+236,atom_to_float32(0.0))
   poke4(pvCube+240,{#FF000000,0})
   --poke(pvCube+244,0)
   poke( pvCube+248,atom_to_float32(0.0))
   poke( pvCube+252,atom_to_float32(0.0))


At the *DP* statement is where Euphoria says the error code:

C:\Programming\Exotica_users\chris_b\poke4 bug\Failing Demo.exw:167 in 
procedure FrameMove() 
poke4 is limited to 32-bit numbers 
    vx = 0
    vy = 1
    vz = 0
    dwNumVertices = <no value>
    xp = 0
    yp = 0
    zp = 0
    wp = 0
    vEyePt = {0.02499989504,3,4.999937536}
    vLookatPt = {0.4192286976,2.5,3.977970432}
    vUpVec = {0,1,0}
    mat_seq2 = 
-0.2927047936,5.48124672,1}
    mat1 = {}
    mat2 = {}
    mat3 = {}
    matSet = {}

/snip/

in " poke4(pvCube+16,{#FFFFFFFF,0})" , #FFFFFFFF is a 32bit number.

So why this works in how I handle DirectX applications with Euphoria
and not for how Chris does it, baffles the heck out of me.
As far as what Chris showed me, nothing else is different except
how he calls windows. He's way of doing it simply *should* work.

Sorry Chris, I'm as stoked as you are... I'm looking for some 
asprins at the moment... :\




-------------------------------------
Todd Riggins
-------------------------------------
Exotica DX Game Library For Euphoria
-------------------------------------
Exotica Website:
http://exotica.iwarp.com/exotica.html
-------------------------------------
Exotica Forum:
http://pub19.ezboard.com/bexoticadxgamelibrary
-------------------------------------

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu