Graphics Tutorials

Lode’s Computer Graphics Tutorial

That’s a good resource for information about various graphics rendering concepts including Raycasting. I was looking at his code and noticed he used the “Scalar” keyword to define variables. Turns out it’s an SDL thing. A scalar can either be a float or a double. This allows you to switch between the two without changing your code to see how it affects the rendering.

Rather than using the SDL keyword I’m just going to use a #define to see how the performance of TMRGE is affected by a lesser precision variable type. The other thing I can do is change the plotpixel method to go directly to video memory. The way it works now is that the background is rendered, the walls are rendered, the sprites are rendered and then the whole thing is copied one pixel at a time to video memory.

What would be better is to simply pass in a pointer to the Wolf5K class to the video memory and draw directly to that. That should speed up the framerate quite a bit. Hopefully I can do that without making the code too SDL specific. The idea is to make it easily portable to any platform.

Leave a comment

You must be logged in to post a comment.

ss_blog_claim=70b9168863fc97c91e6d88b40542a327 ss_blog_claim=70b9168863fc97c91e6d88b40542a327