DirectX Help!

  Alright....What I need is a really fast way to place pixels on the screen using DirectX. (Windowed or Fullscreen)  And I mean as fast as humanly possible.  Any means possible is ok, as long as it compiles under my copy of Visual C++ 6.0

   It would also be totally helpful if you could include it in a program to show me how it works!

   Thanks in advance guys!
 

   
FirefunkAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

FirefunkAuthor Commented:
Edited text of question.
0
PIGCommented:
One simple advice. Get Direct Media Kit from MS or Direct Show SDK. There have many many examples and they work "as fast as humanly". It is seriously. And there have not to many bad help.
0
FirefunkAuthor Commented:
That isn't an answer, that's a comment.
Thanks for the advice though.
0
Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

lif081199Commented:
You will find a very easy tutorial here :

http://eburg.com/~baxters/dx.html

To set a given pixel, just modify the
LockAndLoad function :

void LockAndLoad(int x,int y, int color)
{
DDSURFACEDESC ddsd;   // this will receive the surface's properties  
ddsd.dwSize = sizeof(ddsd);  
// lock the front buffer and grab the surface memory pointer  
assert(SUCCEEDED(front->Lock(0, &ddsd, DDLOCK_WAIT | DDLOCK_SURFACEMEMORYPTR, 0)));  

unsigned char* surface = reinterpret_cast<unsigned char*>(ddsd.lpSurface);   // ddsd.lpSurface is of type void*  

// now draw the pixel
surface[x + y * ddsd.lPitch] = color;
front->Unlock(ddsd.lpSurface);    
// unlock the surface
}

Be careful :
If you have a lot of pixels to draw, lock the surface, draw all your pixels, and then unlock the surface.
Perform as less as lock/unlock operation as possible.

When you will bo ok with this sample, it sould be easy to extend it, that is for resolution > to 8 bits.

Just ask for any detail.

Good luck,
Lionel.











0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
lif081199Commented:
Oops, and rename void LockAndLoad(int x,int y, int color)
to
void DxSetPixel(int x,int y, int color)

This sample is for the version 5 of DX. Don't forget to link you program with those libs :

ddraw.lib, dxguid.lib

Lionel.
0
FirefunkAuthor Commented:
That's so awesome..
Just a couple of questions before I give you the points :)

1) This will compile w/ DirectX 7 right?

2) This is a fast method?

Thanks so so much!
0
lif081199Commented:
1) For DirectX 7, of course !!!!

All DX interfaces are backward compatible.

This code works with DX5, 6, 6.1 & 7 and more future versions !

2) This method a very fast one. But be very careful ! You have to do a proper work ! A good reading is the Performance Guidlines from the DX doc.

Good work,
Lionel.
0
FirefunkAuthor Commented:
That's so awesome..
Just a couple of questions before I give you the points :)

1) This will compile w/ DirectX 7 right?

2) This is a fast method?

Thanks so so much!
0
FirefunkAuthor Commented:
Thank you SO much!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C++

From novice to tech pro — start learning today.