Giter Site home page Giter Site logo

triangle-from-scratch's People

Contributors

lokathor avatar mathspy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

triangle-from-scratch's Issues

Full quantified names for constants

It’d be nice to mention the full quantified name for C constants when they’re mentioned for the first time, i.e CS_OWNDC is Class Style OWNed Device Context

GL Loader System

Separate from initializing a GL context (very platform specific) is the issue of making that GL context even slightly easy to use (fairly platform neutral).

Basically you usually end up with a function like:

fn gl_get_proc_address(name: &[u8]) -> *mut c_void;

And from there you fill in a struct of pointers or you fill in some global static values.

// global fn style
glClearColor(1.0, 1.0, 0.5, 1.0);

// struct style
gl.Clear(GL_COLOR_BUFFER_BIT);

The global functions style is a hair easier to use, but the struct style connects the fns more closely to their context (which is essentially "more correct").

So we should have a lesson about how you do all this. We don't have to do the full thing necessarily, since our actual GL usage is very modest. We can just show people what they would do and then say "now go use the crate".

using curses

this is a unix-y subject. you can use pdcurses on windows, but the point is more about having a little practice with man pages.

Reading a C constant definition?

https://rust-tutorials.github.io/triangle-from-scratch/opening_a_window/win32.html#creating-the-window introduces constants derived from C #defines. Earlier asides such as Reading a C struct declaration seem to imply the audience isn't assumed to know C - so it might be worth briefly noting what these look like in the original C headers (e.g. #define WS_OVERLAPPED ... / enum { ... }) and how the exact type these match to in Rust can be somewhat ambiguous / down to the author's own personal guesswork.

using WebGL

For WebGL, and general "web stuff", I think we could cave and use wasm_pack, and the associated proc_macro and such.

Win32 examples don't show the title

The win32 examples that handle the WM_NCCREATE event without using DefWindowProcW don't have their non-client area drawn properly, which means that they don't get the title text drawn.

Setup CI for the code

Currently the only CI is a github pages run when a commit goes to the main branch.

It would be better for bug catching if there was also CI to build examples and run tests. The only major complication would be that not all examples build on all platforms. Possibly we could narrow the scope of lib testing and example building on each platform so that win32 bins are only built on windows and so on.

discuss windows_subsystem

In our tutorials, we set the windows subsystem:

#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]

but with no explanation why, or what's going on with that.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.