Jump to content
  • Advertisement
Sign in to follow this  
LiVe3

Software rasterizer

This topic is 4819 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all. I am trying to write a software rasterizer as my first project just so that i can learn the basics of a 3D engine before i move on to DirectX. Can someone advise me on the best method of accessing buffers and writing to the screen without having to use DirectX? or should i just use directx for buffers and writing to the screen and implement the rest in software? Thanks

Share this post


Link to post
Share on other sites
Advertisement
About the only way you're going to get direct access to the screen is through DirectDraw. You can use DirectDraw to give you a pointer to your screen and implement everything else in software. This is the approach taken in "Tricks of the 3D Game Programming Gurus - Advanced 3D Graphics and Rasterization."

edit - Doh! Too slow.

Share this post


Link to post
Share on other sites
You don't need direct access to the screen. You can use the Win32 API to resize the screen, and make a window the same size with no border or title bar, and use the Windows GDI to draw and blit bitmaps to the screen. Not the optimal solution, but it works without touching DirectX.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Dont get Tricks of the 3DWPG, it has a chapter on Win32 and DirectDraw and the rest is maths which in almost every chapter he writes "you cant expect me to teach you 4+ years of college, get a maths book"!

Share this post


Link to post
Share on other sites
Seeing as how DirectDraw has been outdated for a long time and GDI is way too slow for this, I'm going to suggest Direct3D.

It would actually be fairly simple to edit the backbuffer or frontbuffer.

Just create an array to hold the pixels(so a 32-bit 640x480 screen would be: ulong Pixels[640x480];). Then call D3DXLoadSurfaceFromMemory on it and a surface, and then copy that surface to the backbuffer/frontbuffer. It's what I'm using for my GBA emulator, it's a fast and easy way to edit pixels "directly".

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!