D3D-Chams Problem

12/15/2009 19:35 gametester123#1
Hi Leute,
jetzt hab ich wieder mal ein Problem mit meinem D3D-Hook. Mein Crosshairhack funktioniert auch wunderbar, aber meine Chams gar nicht :( . Leider weiß ich auch nicht an was das es liegen könnte. Den richtigen Stride für Css hab ich auch schon gefunden, mit einem Stride logger vom Internet.
Hier der Source:

Code:
#include <windows.h>
#include <cstdio>
#include <d3d9.h>
#include <d3dx9.h>
#include <iostream>

#pragma comment (lib, "user32.lib")	
#pragma comment (lib, "d3d9.lib")
#pragma comment (lib, "d3dx9.lib")



//LPDIRECT3DDEVICE9 pDevice;
const D3DCOLOR txtPink = D3DCOLOR_ARGB(255, 0, 0, 255); // Alpha, Rot, Grün, Blau
const D3DCOLOR txtBlue = D3DCOLOR_ARGB(255, 0, 25, 255);
const D3DCOLOR txtBlack = D3DCOLOR_ARGB(255,0,0,0);
const D3DCOLOR txtOrange = D3DCOLOR_ARGB(200,255,128,0);
LPDIRECT3DTEXTURE9 Pink;
LPDIRECT3DTEXTURE9 Red;
LPDIRECT3DTEXTURE9 Green;
void InitHook();
void *DetourFunc(BYTE *src, const BYTE *dst, const int len);
typedef HRESULT(__stdcall* EndScene_t)(LPDIRECT3DDEVICE9);
void DrawRect (LPDIRECT3DDEVICE9 Device_t, int X, int Y, int L, int H, D3DCOLOR color);
EndScene_t pEndScene;
typedef HRESULT (__stdcall* SetStreamSource_t)(LPDIRECT3DDEVICE9 pDevice,UINT StreamNumber,IDirect3DVertexBuffer9* pStreamData,UINT OffsetInBytes,UINT Stride);
typedef HRESULT (__stdcall* DrawIndexedPrimitive_t)(LPDIRECT3DDEVICE9 pDevice,D3DPRIMITIVETYPE Type,INT BaseVertexIndex,UINT MinVertexIndex,UINT NumVertices,UINT startIndex,UINT primCount);
SetStreamSource_t pSetStreamSource;
DrawIndexedPrimitive_t pDrawIndexedPrimitive;
ID3DXFont *pFont;
ID3DXFont *pFont2;

DWORD dwEndScene;
unsigned int myStride=NULL;
bool truecheck=true;
bool truecheck2=true;
bool chams=false;
bool crosshair=false;
bool draw=true;
bool test=true;


void DrawFont (int X, int Y, D3DCOLOR Color, char *format, ...)
{
char buffer[256];
va_list args; // deswegen: #include <cstdio>
va_start (args, format);
vsprintf (buffer,format, args);
RECT FontRect = { X, Y, X + 120, Y + 16 };
pFont->DrawText( NULL, buffer, -1, &FontRect, DT_NOCLIP , Color ); // Zeichnen
va_end (args);
}

void DrawFont2 (int X, int Y, D3DCOLOR Color, char *format, ...)
{
char buffer[256];
va_list args; 
va_start (args, format);
vsprintf (buffer,format, args);
RECT FontRect = { X, Y, X + 120, Y + 16 };
pFont2->DrawText( NULL, buffer, -1, &FontRect, DT_NOCLIP , Color ); // Zeichnen
va_end (args);
}

   
HRESULT GenerateTexture(IDirect3DDevice9 *pD3Ddev, IDirect3DTexture9 **ppD3Dtex, DWORD colour32){
if( FAILED(pD3Ddev->CreateTexture(8, 8, 1, 0, D3DFMT_A4R4G4B4, D3DPOOL_MANAGED,
ppD3Dtex, NULL)) )
return E_FAIL;
WORD colour16 = ((WORD)((colour32>>28)&0xF)<<12)
|(WORD)(((colour32>>20)&0xF)<<8)
|(WORD)(((colour32>>12)&0xF)<<4)
|(WORD)(((colour32>>4)&0xF)<<0);
D3DLOCKED_RECT d3dlr;
(*ppD3Dtex)->LockRect(0, &d3dlr, 0, 0);
WORD *pDst16 = (WORD*)d3dlr.pBits;
for(int xy=0; xy < 8*8; xy++)
*pDst16++ = colour16;
(*ppD3Dtex)->UnlockRect(0);
return S_OK;
}

HRESULT __stdcall hkEndScene(LPDIRECT3DDEVICE9 pDevice)
{
	if(truecheck2){
		D3DXCreateFont(pDevice, 29, 0, FW_BOLD, 1, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, ANTIALIASED_QUALITY, DEFAULT_PITCH | FF_DONTCARE, "IrisUPC", &pFont );
		D3DXCreateFont(pDevice, 15, 0, FW_NORMAL, 1, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, ANTIALIASED_QUALITY, DEFAULT_PITCH | FF_DONTCARE, "Arial", &pFont2 );
		truecheck2=false;
	}

if(draw){
DrawRect (pDevice, 10, 10, 205, 75, txtBlue);
DrawRect (pDevice, 15,35,195,2, txtOrange);

DrawFont(15,10,txtBlack,"SiZeXtreme VIP-Hook v0.1a");
DrawFont2(15, 43, txtBlack, "WallHack (Chams)");
DrawFont2(150,43,txtBlack, "False");
DrawFont2(15, 58, txtBlack, "Crosshair-Hack");
DrawFont2(150,58, txtBlack, "Crosshair1");
}
if(GetAsyncKeyState(VK_INSERT)){
	draw=!draw;
	Sleep(100);
}

return pEndScene(pDevice);
}


HRESULT __stdcall hkDrawIndexedPrimitive(LPDIRECT3DDEVICE9 pDevice,D3DPRIMITIVETYPE Type,INT BaseVertexIndex,UINT MinVertexIndex,UINT NumVertices,UINT startIndex,UINT primCount){
	if(truecheck){
	GenerateTexture(pDevice, &Green,D3DCOLOR_ARGB (255 , 0 , 255 , 0 ));
	GenerateTexture(pDevice, &Red, D3DCOLOR_ARGB (255 , 255 , 0 , 0 ));
	truecheck=false;
	}

	HRESULT hRet = pDrawIndexedPrimitive(pDevice, Type, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
	
	if(myStride==64){
		pDevice->SetRenderState(D3DRS_ZENABLE,false);
		pDevice->SetRenderState(D3DRS_FILLMODE,D3DFILL_SOLID);
		pDevice->SetTexture(0,Green);
		pDevice->DrawIndexedPrimitive(Type,BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
		pDevice->SetRenderState(D3DRS_ZENABLE,true);
		pDevice->SetRenderState(D3DRS_FILLMODE,D3DFILL_SOLID);
		pDevice->SetTexture(0,Red);
		//pDevice->SetRenderState(D3DRS_FOGENABLE, FALSE); NoFog
}
	

	//return S_OK;
	//return pDrawIndexedPrimitive(pDevice, Type,BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
	return hRet;
}


HRESULT __stdcall hkSetStreamSource(LPDIRECT3DDEVICE9 pDevice,UINT StreamNumber,IDirect3DVertexBuffer9* pStreamData,UINT OffsetInBytes,UINT Stride){

	if(StreamNumber == 0){
		myStride = Stride;
	}

return pSetStreamSource(pDevice, StreamNumber, pStreamData,OffsetInBytes, Stride);
}


int WINAPI DllMain(HINSTANCE hInst,DWORD reason,LPVOID reserved)
{
        switch(reason)
        {
        case DLL_PROCESS_ATTACH:
                // Hier kommt unser Code rein
			CreateThread(0, 0, (LPTHREAD_START_ROUTINE) InitHook, 0, 0, 0);
        break;
        }
        return true;
}


bool bDataCompare(const BYTE* pData, const BYTE* bMask, const char* szMask)
{
for(;*szMask;++szMask,++pData,++bMask)
if(*szMask=='x' && *pData!=*bMask )
return false;
return (*szMask) == NULL;
}


DWORD dwFindPattern(DWORD dwAddress,DWORD dwLen,BYTE *bMask,char * szMask)
{
for(DWORD i=0; i < dwLen; i++)
if( bDataCompare( (BYTE*)( dwAddress+i ),bMask,szMask) )
return (DWORD)(dwAddress+i);
return 0;
}


void InitHook()
{       HMODULE hModule = NULL;
        while( !hModule )
        {
                hModule = GetModuleHandleA( "d3d9.dll" ); // Handle zur DLL holen
                Sleep( 100 ); // 100ms warten
        }

		DWORD dwDrawIndexedPrimitive;
		DWORD dwSetStreamSource;
		DWORD* VTableStart = 0;
		DWORD FoundByGordon = dwFindPattern((DWORD)hModule, 0x128000,
		(PBYTE)"\xC7\x06\x00\x00\x00\x00\x89\x86\x00\x00\x00\x00\x89\x86", "xx????xx????xx");
		memcpy(&VTableStart, (void*)(FoundByGordon+2), 4);
		dwDrawIndexedPrimitive = (DWORD)VTableStart[82]; // für mehr: blick in die d3d9.h werfen!
		dwEndScene = (DWORD)VTableStart[42];
		dwSetStreamSource =(DWORD)VTableStart[100];
		

		pEndScene = ( EndScene_t )DetourFunc((PBYTE)dwEndScene,(PBYTE)hkEndScene, 5);  		//0x74A447AF|0x43A47AF
		pDrawIndexedPrimitive = ( DrawIndexedPrimitive_t )DetourFunc((PBYTE)dwDrawIndexedPrimitive, (PBYTE)hkDrawIndexedPrimitive,5);
		pSetStreamSource = ( SetStreamSource_t )DetourFunc((PBYTE)dwSetStreamSource,(PBYTE)hkSetStreamSource,5);
			
}


void DrawRect (LPDIRECT3DDEVICE9 Device_t, int X, int Y, int L, int H, D3DCOLOR color)
{
D3DRECT rect = {X, Y, X+L, Y+H};
Device_t->Clear(1, &rect, D3DCLEAR_TARGET, color, 0,  0);
}


void *DetourFunc(BYTE *src, const BYTE *dst, const int len) // credits to gamedeception
{
BYTE *jmp = (BYTE*)malloc(len+5);
DWORD dwback;
VirtualProtect(src, len, PAGE_READWRITE, &dwback);
memcpy(jmp, src, len); jmp += len;
jmp[0] = 0xE9;
*(DWORD*)(jmp+1) = (DWORD)(src+len - jmp) - 5;
src[0] = 0xE9;
*(DWORD*)(src+1) = (DWORD)(dst - src) - 5;
VirtualProtect(src, len, dwback, &dwback);
return (jmp-5);
}
Ich hoffe ihr könnt mir helfen.

Mfg Gametester
12/15/2009 20:35 MoepMeep#2
Liegt vermutlich an c&p.
12/15/2009 21:57 gametester123#3
Nicht alles ist C&P! Ich habs nach Diamonds Tutorial gemacht, am Anfang hatte ich schon Probleme mit der EndScene Adresse, die habe ich jedoch noch lösen können, aber nun weiß ich echt nicht mehr weiter..
12/16/2009 13:51 KingClem™#4
sieht sehr stark nach C&P aus

aber naja

Ich will jetz nich "deine" ganze base durchsucehn und nen fehler suchen hier mal häufige Fehler:

-Stride Funktion nicht eingebaut
-Falschen Stride
-Zu blöd um Stride Funktion zu benutzen

how to fix:
~Stride Funktion einbauen
~Stride logger machen (nich schwer)
~Buy a Brain!
12/16/2009 20:32 gametester123#5
Ein Stridelogger zum schreiben ist ja nicht schwer. Man braucht nur eine Variable, die man per Tastendruck verändern kann und dann mit Stride gleich setzt ("if(myStride=myVariable){...}. Das nützt mir aber nichts, wenn die Texturen im DrawIndexedPrimitiv nicht gezeichnet werden.

Kann mir den keiner helfen? :confused:
12/18/2009 23:24 gametester123#6
So, bin einbisschen weiter gekommen:
[Only registered and activated users can see links. Click Here To Register...]

Es wird nur durch die Wand gezeichnet, wenn ich per Insert m_Stride auf 64 setzte. Es ist aber dann der ganze "Bilschirm" so gezeichnet, es sollte aber eig. nur der Stride 64 so gezeichnet werden. Achja und ich hab
Code:
pDevice->DrawIndexedPrimitive(Type,BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
zu
Code:
pDrawIndexedPrimitive(pDevice, Type,BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
geändert.
Ich vermute das nichts in m_Stride geschrieben wird, dadurch müsste was an meiner SetStreamSource Funktion etwas nicht stimmen.

Ich hoffe jemand kann mir helfen, diesen kleine Fehler zu beheben.
Freue mich schon auf eure Antworten

Mfg Gametester
12/19/2009 16:16 Bot_interesierter#7
PHP Code:
#include <windows.h>
#include <cstdio>
#include <d3d9.h>
#include <d3dx9.h>
#include <iostream>

#pragma comment (lib, "user32.lib")    
#pragma comment (lib, "d3d9.lib")
#pragma comment (lib, "d3dx9.lib")



//LPDIRECT3DDEVICE9 pDevice;
const D3DCOLOR txtPink D3DCOLOR_ARGB(25500255); // Alpha, Rot, Grün, Blau
const D3DCOLOR txtBlue D3DCOLOR_ARGB(255025255);
const 
D3DCOLOR txtBlack D3DCOLOR_ARGB(255,0,0,0);
const 
D3DCOLOR txtOrange D3DCOLOR_ARGB(200,255,128,0);
LPDIRECT3DTEXTURE9 Pink;
LPDIRECT3DTEXTURE9 Red;
LPDIRECT3DTEXTURE9 Green;
void InitHook();
void *DetourFunc(BYTE *src, const BYTE *dst, const int len);
typedef HRESULT(__stdcallEndScene_t)(LPDIRECT3DDEVICE9);
void DrawRect (LPDIRECT3DDEVICE9 Device_tint Xint Yint Lint HD3DCOLOR color);
EndScene_t pEndScene;
typedef HRESULT (__stdcallSetStreamSource_t)(LPDIRECT3DDEVICE9 pDevice,UINT StreamNumber,IDirect3DVertexBuffer9pStreamData,UINT OffsetInBytes,UINT Stride);
typedef HRESULT (__stdcallDrawIndexedPrimitive_t)(LPDIRECT3DDEVICE9 pDevice,D3DPRIMITIVETYPE Type,INT BaseVertexIndex,UINT MinVertexIndex,UINT NumVertices,UINT startIndex,UINT primCount);
SetStreamSource_t pSetStreamSource;
DrawIndexedPrimitive_t pDrawIndexedPrimitive;
ID3DXFont *pFont;
ID3DXFont *pFont2;

DWORD dwEndScene;
unsigned int myStride=NULL;
bool truecheck=true;
bool truecheck2=true;
bool chams=false;
bool crosshair=false;
bool draw=true;
bool test=true;


void DrawFont (int Xint YD3DCOLOR Colorchar *format, ...)
{
char buffer[256];
va_list args// deswegen: #include <cstdio>
va_start (argsformat);
vsprintf (buffer,formatargs);
RECT FontRect = { XY12016 };
pFont->DrawTextNULLbuffer, -1, &FontRectDT_NOCLIP Color ); // Zeichnen
va_end (args);
}

void DrawFont2 (int Xint YD3DCOLOR Colorchar *format, ...)
{
char buffer[256];
va_list args
va_start (argsformat);
vsprintf (buffer,formatargs);
RECT FontRect = { XY12016 };
pFont2->DrawTextNULLbuffer, -1, &FontRectDT_NOCLIP Color ); // Zeichnen
va_end (args);
}

   
HRESULT GenerateTexture(IDirect3DDevice9 *pD3DdevIDirect3DTexture9 **ppD3DtexDWORD colour32){
if( 
FAILED(pD3Ddev->CreateTexture(8810D3DFMT_A4R4G4B4D3DPOOL_MANAGED,
ppD3DtexNULL)) )
return 
E_FAIL;
WORD colour16 = ((WORD)((colour32>>28)&0xF)<<12)
|(
WORD)(((colour32>>20)&0xF)<<8)
|(
WORD)(((colour32>>12)&0xF)<<4)
|(
WORD)(((colour32>>4)&0xF)<<0);
D3DLOCKED_RECT d3dlr;
(*
ppD3Dtex)->LockRect(0, &d3dlr00);
WORD *pDst16 = (WORD*)d3dlr.pBits;
for(
int xy=0xy 8*8xy++)
*
pDst16++ = colour16;
(*
ppD3Dtex)->UnlockRect(0);
return 
S_OK;
}

HRESULT __stdcall hkEndScene(LPDIRECT3DDEVICE9 pDevice)
{
    if(
truecheck2){
        
D3DXCreateFont(pDevice290FW_BOLD10DEFAULT_CHARSETOUT_DEFAULT_PRECISANTIALIASED_QUALITYDEFAULT_PITCH FF_DONTCARE"IrisUPC", &pFont );
        
D3DXCreateFont(pDevice150FW_NORMAL10DEFAULT_CHARSETOUT_DEFAULT_PRECISANTIALIASED_QUALITYDEFAULT_PITCH FF_DONTCARE"Arial", &pFont2 );
        
truecheck2=false;
    }

if(
draw){
DrawRect (pDevice101020575txtBlue);
DrawRect (pDevice15,35,195,2txtOrange);

DrawFont(15,10,txtBlack,"SiZeXtreme VIP-Hook v0.1a");
DrawFont2(1543txtBlack"WallHack (Chams)");
DrawFont2(150,43,txtBlack"False");
DrawFont2(1558txtBlack"Crosshair-Hack");
DrawFont2(150,58txtBlack"Crosshair1");
}
if(
GetAsyncKeyState(VK_INSERT)){
    
draw=!draw;
    
Sleep(100);
}

return 
pEndScene(pDevice);
}


HRESULT __stdcall hkDrawIndexedPrimitive(LPDIRECT3DDEVICE9 pDevice,D3DPRIMITIVETYPE Type,INT BaseVertexIndex,UINT MinVertexIndex,UINT NumVertices,UINT startIndex,UINT primCount){
    if(
truecheck){
    
GenerateTexture(pDevice, &Green,D3DCOLOR_ARGB (255 255 ));
    
GenerateTexture(pDevice, &RedD3DCOLOR_ARGB (255 255 ));
    
truecheck=false;
    }

    
    
HRESULT hRet;
    if(
myStride==64){
        
pDevice->SetRenderState(D3DRS_ZENABLE,false);
        
pDevice->SetRenderState(D3DRS_FILLMODE,D3DFILL_SOLID);
        
pDevice->SetTexture(0,Green);
        
hRet pDrawIndexedPrimitive(pDeviceTypeBaseVertexIndexMinVertexIndexNumVerticesstartIndexprimCount);
        
pDevice->SetRenderState(D3DRS_ZENABLE,true);
        
pDevice->SetRenderState(D3DRS_FILLMODE,D3DFILL_SOLID);
        
pDevice->SetTexture(0,Red);
        
//pDevice->SetRenderState(D3DRS_FOGENABLE, FALSE); NoFog
}
else{
                
hRet pDrawIndexedPrimitive(pDeviceTypeBaseVertexIndexMinVertexIndexNumVerticesstartIndexprimCount);

    

    
//return S_OK;
    //return pDrawIndexedPrimitive(pDevice, Type,BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
    
return hRet;
}


HRESULT __stdcall hkSetStreamSource(LPDIRECT3DDEVICE9 pDevice,UINT StreamNumber,IDirect3DVertexBuffer9pStreamData,UINT OffsetInBytes,UINT Stride){

    if(
StreamNumber == 0){
        
myStride Stride;
    }

return 
pSetStreamSource(pDeviceStreamNumberpStreamData,OffsetInBytesStride);
}


int WINAPI DllMain(HINSTANCE hInst,DWORD reason,LPVOID reserved)
{
        switch(
reason)
        {
        case 
DLL_PROCESS_ATTACH:
                
// Hier kommt unser Code rein
            
CreateThread(00, (LPTHREAD_START_ROUTINEInitHook000);
        break;
        }
        return 
true;
}


bool bDataCompare(const BYTEpData, const BYTEbMask, const charszMask)
{
for(;*
szMask;++szMask,++pData,++bMask)
if(*
szMask=='x' && *pData!=*bMask )
return 
false;
return (*
szMask) == NULL;
}


DWORD dwFindPattern(DWORD dwAddress,DWORD dwLen,BYTE *bMask,char szMask)
{
for(
DWORD i=0dwLeni++)
if( 
bDataCompare( (BYTE*)( dwAddress+),bMask,szMask) )
return (
DWORD)(dwAddress+i);
return 
0;
}


void InitHook()
{       
HMODULE hModule NULL;
        while( !
hModule )
        {
                
hModule GetModuleHandleA"d3d9.dll" ); // Handle zur DLL holen
                
Sleep100 ); // 100ms warten
        
}

        
DWORD dwDrawIndexedPrimitive;
        
DWORD dwSetStreamSource;
        
DWORDVTableStart 0;
        
DWORD FoundByGordon dwFindPattern((DWORD)hModule0x128000,
        (
PBYTE)"\xC7\x06\x00\x00\x00\x00\x89\x86\x00\x00\x00\x00\x89\x86""xx????xx????xx");
        
memcpy(&VTableStart, (void*)(FoundByGordon+2), 4);
        
dwDrawIndexedPrimitive = (DWORD)VTableStart[82]; // für mehr: blick in die d3d9.h werfen!
        
dwEndScene = (DWORD)VTableStart[42];
        
dwSetStreamSource =(DWORD)VTableStart[100];
        

        
pEndScene = ( EndScene_t )DetourFunc((PBYTE)dwEndScene,(PBYTE)hkEndScene5);          //0x74A447AF|0x43A47AF
        
pDrawIndexedPrimitive = ( DrawIndexedPrimitive_t )DetourFunc((PBYTE)dwDrawIndexedPrimitive, (PBYTE)hkDrawIndexedPrimitive,5);
        
pSetStreamSource = ( SetStreamSource_t )DetourFunc((PBYTE)dwSetStreamSource,(PBYTE)hkSetStreamSource,5);
            
}


void DrawRect (LPDIRECT3DDEVICE9 Device_tint Xint Yint Lint HD3DCOLOR color)
{
D3DRECT rect = {XYX+LY+H};
Device_t->Clear(1, &rectD3DCLEAR_TARGETcolor0,  0);
}


void *DetourFunc(BYTE *src, const BYTE *dst, const int len// credits to gamedeception
{
BYTE *jmp = (BYTE*)malloc(len+5);
DWORD dwback;
VirtualProtect(srclenPAGE_READWRITE, &dwback);
memcpy(jmpsrclen); jmp += len;
jmp[0] = 0xE9;
*(
DWORD*)(jmp+1) = (DWORD)(src+len jmp) - 5;
src[0] = 0xE9;
*(
DWORD*)(src+1) = (DWORD)(dst src) - 5;
VirtualProtect(srclendwback, &dwback);
return (
jmp-5);

Versuchs mal damit
12/19/2009 17:36 gametester123#8
Funktioniert leider auch nicht, das Problem muss an SetStreamSource liegen. Trotzdem danke..
12/19/2009 18:59 Atheuz#9
Quote:
Originally Posted by gametester123 View Post
So, bin einbisschen weiter gekommen:
[Only registered and activated users can see links. Click Here To Register...]

Es wird nur durch die Wand gezeichnet, wenn ich per Insert m_Stride auf 64 setzte. Es ist aber dann der ganze "Bilschirm" so gezeichnet, es sollte aber eig. nur der Stride 64 so gezeichnet werden. Achja und ich hab
Code:
pDevice->DrawIndexedPrimitive(Type,BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
zu
Code:
pDrawIndexedPrimitive(pDevice, Type,BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
geändert.
Ich vermute das nichts in m_Stride geschrieben wird, dadurch müsste was an meiner SetStreamSource Funktion etwas nicht stimmen.

Ich hoffe jemand kann mir helfen, diesen kleine Fehler zu beheben.
Freue mich schon auf eure Antworten

Mfg Gametester
Du musst die Vertex loggen und nicht alleine den Stride.
Das ist bei CSS so.
12/19/2009 20:18 gametester123#10
Das weiß ich schon, aber ich wollt halt erstmal den Stride loggen, Vertex hab ich auch schon, aber was nützen mir die, wenn in my_Stride nix geschrieben wird. Und dann in DrawIndexedPrimitiv nicht aufgerufen werden if(my_Stride==64)..
12/20/2009 18:32 Atheuz#11
Quote:
Originally Posted by gametester123 View Post
Das weiß ich schon, aber ich wollt halt erstmal den Stride loggen, Vertex hab ich auch schon, aber was nützen mir die, wenn in my_Stride nix geschrieben wird. Und dann in DrawIndexedPrimitiv nicht aufgerufen werden if(my_Stride==64)..
Wenn du es weißt, wo ist dann das Problem? Du willst trotzdem es mithilfe der Stride machen, lass die Stride weg und fertig. Ich weiß nicht wo dein Problem ist.
12/20/2009 20:02 gametester123#12
Wenn ichs nur mit numvertices mache, wird alles angedrawt, was genau die anzahl an polygonen hat, also brauche ich ne Abfrage bezüglich der Strides..


Könnte man den Stride auch aus GetStreamSource abfragen, wenn ja, wie?
01/08/2010 20:44 Dark Raider#13
Ja man kann ihn über GetStreamSource abfragen.

Einfach in DrawIndexedPrimitive:
Code:
pDevice->GetStreamSource(0, &pStreamData, &pOffsetInBytes, &myStride)
Die hier musst du aber halt noch vorher definieren:
Code:
IDirect3DVertexBuffer9 *pStreamData;
UINT pOffsetInBytes;
UINT myStride; //Das ist dann der Stride