![]() Finally, we decided to skip the dedicated server and mission pack files, as they wouldn’t be hard to translate but were also not necessary for our demonstration. ![]() We instead just translated the OpenGL1 renderer library and forced the game to use it instead of the default renderer. While we could add custom build script support for embedding the GLSL code into Rust strings after we transpile, there’s not a good automatic way to transpile these autogenerated, temporary files 1. glsl shader files which the build system embeds as literal strings in C source code. It would be possible to translate the OpenGL2 renderer as well, but we chose to skip it as it makes significant use of. We focused on the UI, game, client, OpenGL1 renderer and main binary for our translation. ![]() Translating just the VM into Rust and using the QVM versions would have been significantly simpler but we wanted to thoroughly test out C2Rust. We opted to use the native versions of these libraries for our project. Of these libraries, the UI, client, and server libraries can be built as either Quake VM assembly or native X86 shared libraries. └── renderer_opengl2_x86_64.so # opengl2 renderer ├── renderer_opengl1_x86_64.so # opengl1 renderer ├── ioq3ded.x86_64 # dedicated server binary The ioquake3 build produces a few different libraries and executables: $ tree -prune -I missionpack -P "*.so|*x86_64" It is a community fork of Quake 3 that is still maintained and builds on modern platforms.Īs a starting point, we made sure we could build the project as is: $ make release After a couple of days, we were likely the first people to ever play Quake3 in Rust! Setting the stage: Quake 3 sourcesĪfter looking at the original Quake 3 source code and various forks, we settled on ioquake3. Testing on small CLI programs gets old eventually, so we decided to try translating Quake 3 into Rust. First, however, we have to build a rock-solid translator that gets people up and running in Rust. Our goal is to make safety improvements to the translated Rust automatically where we can, and help the programmer do the same where we cannot. The Rust-loving team at Immunant has been hard at work on C2Rust, a migration framework that takes the drudgery out of migrating to Rust.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |