4 ms·
Implementing Hello Triangle with Mantle
- xtrumanx 12y agoA Black Triangle Moment[0] for Mantle programming? [0] https://web.archive.org/web/20050306071700/http://www.rampantgames.com/blog/2004/10/black-triangle.html https://web.archive.org/web/20050306071700/http://www.rampan...
- phkahler 12y agoThat'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.
- alricb 12y agoThis has been more helpful than most of the presentations and guides I've seen so far.
- Fiahil 12y agoFrom the article: > If you like Rust, you should also check out this project[1], which aims to be the first wrapper for Mantle! Wow, I surely would like to develop games in rust. 1. https://github.com/tomaka/mantle-demo https://github.com/tomaka/mantle-demo
- eddyb 12y agoI did find it a bit surprising that Rust is showing up on the scene that fast. Another interesting project is https://github.com/gfx-rs/gfx-rs https://github.com/gfx-rs/gfx-rs - their abstractions may seem too much for wrapping OpenGL, until you realize they're ready for a Mantle/Vulkan backend, just need someone to write it. Personally, I wish I could use Mantle on Linux, but the eventual support is probably going to skip that stage and go directly for Vulkan. From reading more online, it seems possible that at least one of Intel, AMD and Nvidia will release a SteamOS-compatible (and thus, Linux in general) Vulkan driver later this year.