Simple software rasterizer in a single C++11 header file
1–10 of 23 posts
Re: Simple software rasterizer in a single C++11 header file
#2Re: Simple software rasterizer in a single C++11 header file
#3What exactly is the difference between this and for example a simple ray tracer? Seems like it takes a lot of the same steps.
Re: Simple software rasterizer in a single C++11 header file
#4Re: Simple software rasterizer in a single C++11 header file
#5I'm not a C++11 developer, I've done a little C++ in the past. What is the pride in putting all the code in the header file? Shouldn't the declarations be there, and the definitions be pulled out into a .cpp file? Is it somehow smaller, faster, more convenient to have it all in a header file?
Re: Simple software rasterizer in a single C++11 header file
#6I'm not a C++11 developer, I've done a little C++ in the past. What is the pride in putting all the code in the header file? Shouldn't the declarations be there, and the definitions be pulled out into a .cpp file? Is it somehow smaller, faster, more convenient to have it all in a header file?
Re: Simple software rasterizer in a single C++11 header file
#7Re: Simple software rasterizer in a single C++11 header file
#8I'm not a C++11 developer, I've done a little C++ in the past. What is the pride in putting all the code in the header file? Shouldn't the declarations be there, and the definitions be pulled out into a .cpp file? Is it somehow smaller, faster, more convenient to have it all in a header file?
Header libraries are easier to add to your project because there are no build scripts to figure out or cross-compiling to do or whatever. A lot of Boost is header-only, for example. GLM (OpenGL Mathematics), too, is header-only. OTOH if you end up modifying a header that's included in a whole bunch of places, woe unto you.
Re: Simple software rasterizer in a single C++11 header file
#9What exactly is the difference between this and for example a simple ray tracer? Seems like it takes a lot of the same steps.
This loops over the triangles and converts them to screen pixels. A ray tracer loops over screen pixels and checks if there are any triangles that overlap it.