Help - Search - Members - Calendar
Full Version: How To Port Xbox Push Buffer Code To Windows?
Scenyx Entertainment Community > Xbox1 Forums > Software Forums > Homebrew & Ported Games
fox suit
Hi I've got a block of code that was originally written for xbox and I'm trying to make it work on windows. From what I understand these are direct GPU commands for the xbox and directx 9 doesn't have any way to do the same thing. Can someone help me modify the code to come up with a pc equivalent? Or is there any guide for porting between windows and xbox d3d that covers push buffers??

CODE


//BeginPush()

p_push[0]    = D3DPUSH_ENCODE( D3DPUSH_SET_TRANSFORM_CONSTANT_LOAD, 1 );

p_push[1]    = 96 + 16;

p_push[2]    = D3DPUSH_ENCODE( D3DPUSH_SET_TRANSFORM_CONSTANT, 8 );

p_push[3]    = *((DWORD*)&r[0] );
p_push[4]    = *((DWORD*)&r[1] );
p_push[5]    = *((DWORD*)&r[2] );
p_push[6]    = *((DWORD*)&r[3] );

p_push[7]    = *((DWORD*)&t );
p_push[8]    = *((DWORD*)&color_interpolator );
p_push        += 11;

p_push[0]    = D3DPUSH_ENCODE( D3DPUSH_SET_BEGIN_END, 1 );
p_push[1]    = D3DPT_QUADLIST;
p_push        += 2;

p_push[0]    = D3DPUSH_ENCODE( D3DPUSH_NOINCREMENT_FLAG | D3DPUSH_INLINE_ARRAY, 12 );
++p_push;

p_push[0]    = *((DWORD*)&col0 );
p_push[1]    = *((DWORD*)&col1 );
p_push[2]    = 0x00000000UL;

p_push[3]    = *((DWORD*)&col0 );
p_push[4]    = *((DWORD*)&col1 );
p_push[5]    = 0x00010001UL;

p_push[6]    = *((DWORD*)&col0 );
p_push[7]    = *((DWORD*)&col1 );
p_push[8]    = 0x00020002UL;
                
p_push[9]    = *((DWORD*)&col0 );
p_push[10]    = *((DWORD*)&col1 );
p_push[11]    = 0x00030003UL;

p_push        += 12;

p_push[0] = D3DPUSH_ENCODE( D3DPUSH_SET_BEGIN_END, 1 );
p_push[1] = 0;
p_push += 2;


EndPush(p_push)

Pulsemasta
You might have better luck posting in the Dev forums with this one.
sirlemonhead
Depends.. but you'll likely want to look at dynamic vertex buffers in d3d9.

What does that function draw? If you give me more information I'll try help
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.