polyadvent

A game engine from scratch in C
git clone git://jb55.com/polyadvent
Log | Files | Refs | README

window.c (723B)


      1 
      2 
      3 #include "gl.h"
      4 #include "mat4.h"
      5 #include "window.h"
      6 #include "game.h"
      7 #include "update.h"
      8 
      9 
     10 void
     11 handle_resize(struct game *game, int width, int height) {
     12   /* printf("resizing %d %d\n", width, height); */
     13   glViewport( 0, 0, width, height );
     14   mat4_perspective(75 /* fov */, (float)width / height, 0.1, 10000.0,
     15                    game->test_resources.proj_persp);
     16 
     17   resize_fbos(get_entity(&game->test_resources.player_id),
     18               &game->test_resources.shadow_buffer,
     19               game->test_resources.proj_ortho,
     20               width, height);
     21 
     22   /* glMatrixMode( GL_PROJECTION ); //Switch to setting the camera perspective */
     23   /* Set the camera perspective */
     24   /* glLoadIdentity(); //reset the camera */
     25 }