main.c 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #include <stdio.h>
  2. #include "../RasterIver/headers/rasteriver.h"
  3. #include <time.h>
  4. #include <stdlib.h>
  5. int width = 800;
  6. int height = 800;
  7. int main(){
  8. srand(time(NULL));
  9. RI_SetFlag(RI_FLAG_DEBUG, 1);
  10. RI_SetFlag(RI_FLAG_DEBUG_VERBOSE, 1);
  11. RI_SetFlag(RI_FLAG_DEBUG_FPS, 0);
  12. RI_SetFlag(RI_FLAG_SHOW_FPS, 1);
  13. RI_SetFlag(RI_FLAG_SHOW_Z_BUFFER, 0);
  14. RI_SetFlag(RI_FLAG_CLEAN_POLYGONS, 1);
  15. RI_SetFlag(RI_FLAG_POPULATE_POLYGONS, 0);
  16. RI_SetFlag(RI_FLAG_BE_MASTER_RENDERER, 1);
  17. RI_SetFpsCap(120);
  18. if (RI_Init(width, height, "Rasteriver Test") == RI_ERROR){
  19. return 1;
  20. }
  21. RI_newObject object_buffer[5] = {
  22. {400, 400, 400, 0, 0, 0, 100, 100, 100, "gourd.obj", "texture.png"},
  23. {400, 400, 400, 0, 0, 0, 200, 200, 200, "obj_file.obj", "texture.png"},
  24. {400, 400, 400, 0, 0, 0, 100, 100, 100, "obj_file.obj", "texture.png"},
  25. {400, 400, 400, 0, 0, 0, 100, 100, 100, "obj_file.obj", "texture.png"},
  26. {400, 400, 400, 0, 0, 0, 100, 100, 100, "obj_file.obj", "texture.png"},
  27. };
  28. RI_RequestObjects(object_buffer, 1);
  29. while (RI_IsRunning() == RI_RUNNING){
  30. RI_Tick();
  31. }
  32. RI_Stop();
  33. }