| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- #ifndef RASTERIVER_H
- #define RASTERIVER_H
- #include "functions.h"
- #include "values.h"
- #include "custom_types.h"
- #include "math.h"
- #include <SDL2/SDL.h>
- typedef struct {
- // rendering (non SDL)
- RI_texture *frame_buffer;
- double *z_buffer;
-
- int window_width;
- int window_height;
- char *window_title;
- // SDL specific
- SDL_Window *window;
- SDL_Renderer *renderer;
- SDL_Texture *texture;
- SDL_Event event;
-
- // RasterIver
- RI_vector_3f *loaded_mesh_vetex_positions; // original vertex positions from a loaded mesh
- RI_vector_3f *normals; // original normal vectors from a loaded mesh
- RI_vector_2f *uvs; // UV coords from a loaded mesh
-
- RI_vector_3f *transformed_vertex_positions; // vertex positions after trasformations (mesh & camera rotation & position changes, scale, etc)
- RI_vector_3f *transformed_normals; // normal vectors after rotation transformations (otherwise a normal's space would constantly be in local space instead of world space)
- RI_mesh *loaded_meshes;
- RI_texture *loaded_textures;
- RI_material *materials;
- RI_actor *actors;
- RI_texture error_texture;
- RI_texture error_bump_map;
- RI_texture error_normal_map;
- RI_material error_material;
- RI_mesh error_mesh;
- // miscellaneous
- int loaded_mesh_count;
- int loaded_texture_count;
- int material_count;
- int actor_count;
- int running;
- int frame;
- char* prefix;
- // memory manager
- RI_memory_allocation* allocation_table;
- int debug_memory;
- int allocation_search_limit;
- int current_allocation_index;
- int allocation_table_length;
- } RasterIver;
- RasterIver* RI_get_ri();
- #endif
|