Stilllegung des Forums
Das Forum wurde am 05.06.2023 nach über 20 Jahren stillgelegt (weitere Informationen und ein kleiner Rückblick).
Registrierungen, Anmeldungen und Postings sind nicht mehr möglich. Öffentliche Inhalte sind weiterhin zugänglich.
Das Team von spieleprogrammierer.de bedankt sich bei der Community für die vielen schönen Jahre.
Wenn du eine deutschsprachige Spieleentwickler-Community suchst, schau doch mal im Discord und auf ZFX vorbei!
Werbeanzeige
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
void set_effect_variables(tbEffect* effect) { D3DXMATRIX mView; D3DXMATRIX mProj; D3DXMATRIX mWorld; tbDirect3D::Instance().GetDevice()->GetTransform(D3DTS_VIEW,&mView); tbDirect3D::Instance().GetDevice()->GetTransform(D3DTS_PROJECTION,&mProj); tbDirect3D::Instance().GetDevice()->GetTransform(D3DTS_WORLD,&mWorld); D3DLIGHT9 light; tbDirect3D::Instance().GetDevice()->GetLight(0,&light); effect->GetEffect()->SetValue("World",mWorld,sizeof(D3DXMATRIX)); effect->GetEffect()->SetValue("View",mView,sizeof(D3DXMATRIX)); effect->GetEffect()->SetValue("Projection",mProj,sizeof(D3DXMATRIX)); effect->GetEffect()->SetVector("Ambient",(D3DXVECTOR4*)&light.Ambient); effect->GetEffect()->SetVector("Diffuse",(D3DXVECTOR4*)&light.Diffuse); } |
Quellcode |
|
1 2 3 4 5 6 |
float4x4 World : WORLD;// das : WORLD ist nur wegen dem FX composer float4x4 View : VIEW; float4x4 Projection : PROJECTION; float4 Diffuse; float4 Ambient; |
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
// Setup scene for parallel projection void ParallaxTest::SetupParallelProjection() { glShadeModel(GL_SMOOTH); glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(TEXTURE_SIZE / 2, TEXTURE_SIZE / 2, TEXTURE_SIZE / 2, TEXTURE_SIZE / 2, 0.1f, 1000.0f); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glTranslatef(0.0f, 0.0f, -1.0f); } |
Werbeanzeige