Skip to content

SLMT/rust-ogldev

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OGLdev Tutorials in Rust

OGLdev is a very nice serise of tutorials that introduces basic knowledge for writing a OpenGL program. The original tutorials are written in C. However, I want to reproduce the same results in Rust for fun and learning. So that is why I created this repository.

I used glium to use OpenGL in Rust. It is quite different from the one used by the original tutorials. You may see lots of difference (including variable names, function calls... etc.) between those tutorials and my implementations. Just stay calm. Take some time to read carefully. You will find that they are basically the same. At least they try to archive the same goals.

The documents of glium will be very useful when you dig my code.

The Goal of Each Tutorial

The titles below summarize the goals of the tutorials on OGLdev. Each of them links to a Rust implementation of the corresponding tutorial.

  1. To Create A Window
  2. To Draw A Dot
  3. To Draw A Triangle
  4. To Use Shader Programs
  • This one does not have too much difference from the 2nd and 3rd tutorial since I have used shader programs in those tutorials.
  1. To Use Uniform Variables
  2. To Perform Translation Transformation
  3. To Perform Rotation Transformation
  4. To Perform Scaling Transformation
  5. To Interpolate Color inside a Triangle
  6. To Draw with A Index Buffer
  7. To Concatenate Transformations
  8. To Perform Perspective Projection
  9. To Perform View Transformation
  10. To Move The Camera Using Arrow Keys On The Keyboard
  11. To Move The Camera Using Both The Keyboard And The Mouse
  12. To Draw with Textures
  • There is lots of difference between this one and the original tutorial, because glium does many great jobs in Rust and we just need to add a few code to make the same effect.

How to Run It ?

This command should build the whole project and run the n-th tutorial:

> cargo run --bin tutorial_n

For example, to run the first tutorial:

> cargo run --bin tutorial_01

About

A collection of example code in Rust for the tutorials on http://ogldev.atspace.co.uk/ .

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages