Jump to content
  • Advertisement
Sign in to follow this  
compiler

OpenGL Backbuffer and Swap for Software Rasterizer

This topic is 4346 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 guys, i want to write a little software rasterizer and therefore i need functions to write into a backbuffer and copy it into the graphics card memory. so something like this: WriteToBackBuffer(int x, int y, int color) and Swap(); But the problem is I DONT want to use DirectX or OpenGL. What is the easist way to create a backbuffer and copy it into a window or the vram (for fullscreen apps). is there maybe a way with WinApi or GDI or .NET? Thanks!

Share this post


Link to post
Share on other sites
Advertisement
You can create the back buffer using CreateDIBSection. You can perform the copy from the DIB section to the primary surface with GDI's BitBlt.

Share this post


Link to post
Share on other sites
BitBlt is pretty fast. All backbuffer implementations that are purely software-based will have to use BitBlt or a similar block-transfer function to achieve any kind of real speed.

While it isn't the fastest thing out there, it's pretty much the fastest you can use for this particular purpose, and it is certainly possible to make a real-time pure software rasterizer using it (I've done it many times).

Share this post


Link to post
Share on other sites
I'm using DirectDraw in my software renderer. I initially used BitBlt, but when I switched my frame-time improved tremendously.

I forgot the exact numbers, but it was the bottleneck of my engine at that time, and a horrible one at that.

Its not an option in this guy's case, but I'd still consider it a valid software renderer.

BennyW

Share this post


Link to post
Share on other sites
Quote:
Original post by bennyW
Its not an option in this guy's case...

Why not? GDI uses DirectDraw indirectly so it makes no difference.

Share this post


Link to post
Share on other sites
Quote:
Original post by bennyW
I assumed when he stated he didn't want to use DirectX, he wanted to avoid using DirectDraw as well.

I understand, but I sense a difference in what he wants, what he sais, and what he really needs. ;-)

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!