engine

game engine on C
git clone git://git.evenfri.pw/engine.git
Log | Files | Refs | README

tech.txt (1670B)


      1 engine
      2 
      3 main language: C
      4 main orientation: 3D
      5 graphics library: OpenGL
      6 oriented os: Linux
      7 author: evenfri (https://evenfri.pw)
      8 
      9 standalone build of game
     10 build/
     11  /engine.so
     12  /game_name.so
     13  /game_name (ELF)
     14  /game_name_data/
     15 
     16 example project in editor:
     17 project/
     18  /project.conf
     19   [project]
     20   name = "example"
     21   [build]
     22   ver = "0.0.0.0"
     23   platforms = linux,win
     24   name = "example"
     25   dir = "$PROJECT/build"
     26   [compile]
     27   cc = "/usr/bin/cc"
     28   source_list = "$PROJECT/source.list"
     29  /source.list
     30   scripts/init.c
     31   scripts/inventory.c
     32   scripts/example.c
     33  /scripts/
     34   /example.c
     35    #include <eng.h> 
     36    /* 
     37     * api engine
     38     * in eng.h
     39     * #define ENG_API_VER 0
     40     *  struct engine_api { 
     41     *   int version;
     42     *   ...
     43     *  };
     44     *  typedef struct engine_api engine_api_t;
     45     */
     46    #include "fns.h"
     47    int start() {
     48     api()->console_log("game started\n");
     49     return 0;
     50    }
     51   /init.c
     52    #include <eng.h>
     53    #include "fns.h"
     54    static engine_api_t *eng_api = NULL;
     55    engine_api_t* api() { return eng_api; }
     56    int game_start(engine_api_t *api_host) {
     57     if (!api_host) return 1;
     58     if (api_host->version != ENG_API_VER) {
     59      return 1;
     60     }
     61     eng_api = api_host;
     62 
     63     start();
     64     inv_init();
     65     return 0;
     66    }
     67    int game_update() {
     68     return 0;
     69    }
     70    int game_close() {
     71     inv_close();
     72     return 0;
     73    }
     74     
     75   /fns.h
     76    #ifndef FNS_H
     77    #define FNS_H
     78    #include <eng.h>
     79    engine_api_t *api();
     80    int start();
     81    int inv_init();
     82    int inv_close();
     83    #endif /* FNS_H */
     84   /inventory.c
     85   /hdr.h
     86    /* generated by engine */
     87    #define APP_NAME "example"
     88    #define VERSION "0.0.0.0"
     89  /build/
     90   /engine.so
     91   /example.so
     92   /example
     93   /example_data/