Showing only posts tagged code. Show all posts.

Data Recovery

~ 2 Minute Read.

I spent the last three days re­cov­er­ing old projects.

There is this one 2TB ex­ter­nal hard drive I had for ages, bro­ken for six years – yet I nev­er threw it away or tried to for­mat it to maybe be …

back-face culling

I re­cent­ly found a tu­to­ri­al on back-face culling. It means telling OpenGL not to draw in­vis­i­ble faces (faces on the back side ;) ) of a mesh, which does speed up the ren­der­ing a lot.

I was look­ing for some­thing …

Mouselook and SDL - Code

Okay, here is some code for mouselook with SDL

struct {
              int x, y;
              //In this case: the position where the mouse is held at
              bool trap; //flag for holding mouse at one place
          } mouse;

          void MouseMotion(){
              /* Set x and y to the current mouse position */
              int x, y;
              SDL_GetMouseState(&x …