3 ms·
That's a lot of code. I'm pretty sure I can use SDL to open a window and paint a triangle with a C-coded rasterizer in few than 500 line.
by phkahler 12y ago
That's a lot of code. I'm pretty sure I can use SDL to open a window and paint a triangle with a C-coded rasterizer in few than 500 line.
- mastax 12y agoYou're missing the point. BASIC can print "hello world" much easier than assembler can, but that doesn't make BASIC a better thing to write an operating system in.
- alricb 12y agoTons of it is just boilerplate, because Mantle has no default. For instance, createTargetStates() is a ~50 lines function to set the MSAA, viewport, color blending, raster and depth stencil states, which mostly have default values in OpenGL. The API is relatively straightforward, but you have to do almost everything yourself: you need to put your commands in command buffers, you have to allocate memory yourself, and you need to create your pipeline and use descriptor sets to bind your resources (triangles, textures) to it. So it's not like old-school OpenGL where you could glBegin() and start doing stuff immediately, but it's only really painful at the start; you'll soon abstract away most of the boilerplate, and the main hurdle will be to have to manage your memory and bindings yourself. I'm sure once Vulkan is released there will soon be libraries that take care of the boilerplate for you and offer some help to manage memory, bindings and command buffers.
- geon 12y agoI expect wrapper libraries such as SFML will implement very easy-to-use init APIs for you.