🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Demo like effects under DirectX?

Started by
1 comment, last by babar_zafar 24 years, 5 months ago
Hi there, I was wondering if anyone can point me to a site were one can find demo effect implemented in DirectX, I know DirectX front and back - but I need something to do with it? Please don''t tell me about alpha blending tutorials - give me some REAL source code... Hey, is there even a demo coding page which deals with DirectX and Win32 not the old an DEAD Dos? Well thanx anyway... // Babar Zafar // Copyright (c) 1982-2000, Parents Inc
// Babar Zafar// Copyright (c) 1982-2000,
Advertisement
I think one of the other GDnet members has some stuff on his homepage, but I can''t remember, who it was.
Did you read the "The water effect explained" - article? It is cool!
Hi,
if you do your rendering on your own, than it''s the same as under DOS. You lock the surface, render your stuff to the surface and it''s the same.

DDSURFACEDESC2 ddsd;ULONG* buffer;ZeroMemory(&ddsd, sizeof(ddsd));ddsd.dwSize = sizeof(ddsd);lpDDSSurface->Lock(NULL, &ddsd, DDLOCK_SURFACEMEMORYPTR / DDLOCK_WAIT, NULL);buffer = (ULONG*)ddsd.lpSurface;for (int y=0; y<480; y++){    for (int x=0; x<640; x++)    {        UCHAR col = 127.5 + 63.5 * sin(PI/180*x) + 63.5 * sin(PI/180*y);        buffer[x + (y * ddsd.lPitch) = RGB32(col, 0, 0);    }}lpDDSSurface->Unlock(NULL); 


And you have your working plasma. Ok, it''s slow as hell and looks like shit, but you''ve got a plasma and you could do it the same way with other effects. Nowadays, many demos use 3d-effects and 3d-engines, so why not write your own using D3D and let a model walk through a cave ? You gotta do many things on your own, much stuff is undocumented and copying others effects sucks.

CU

Graphix Coding @
Skullpture Entertainment
Graphix Coding @Skullpture Entertainmenthttp://www.skullpture.de

This topic is closed to new replies.

Advertisement