/* This file was automatically generated.  Do not edit! */
#include <ctype.h>
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "stb_ds.h"
#include "sokol_app.h"
#include "sokol_gfx.h"
#include "sokol_glue.h"
#include "sokol_time.h"
#include "sokol_gl.h"
#include "sokol_log.h"
#include "fontstash.h"
#include "sokol_fontstash.h"
#include "cmixer.h"
#include "minimp3.h"
#include "lua.h"
#include "lualib.h"
#include "lauxlib.h"
#include "libtess.h"
#if !defined(DISTRIBUTION_BUILD)
#include "triangle.h"
#include "xatlas_c.h"
#endif
#include "gfx.h"
#include "vector.h"
#include "resource.h"
#include "defaultShader.glsl.h"
#include "forwardRender.glsl.h"
sapp_desc sokol_main(int argc,char **argv);
void cleanup(void);
void stdFree(void *userData,void *ptr);
typedef struct { unsigned int width; unsigned int height; }size;
void *stdAlloc(void *userData,unsigned int size);
void setVsync(bool sync);
void setWindowSize(int w,int h);
sg_swapchain getSwapchain();
void drawFons(int thread);
typedef struct Window Window;
typedef union int2 int2;
union int2 {
  struct {int x, y; };
  struct {int width, height; };
};
struct Window {
  struct  {
    Shader defaultShader;
    Shader forwardRender;
  } shaders;

  char * title;
  float dpi_scale;
  int thread;
  int monitor;
  int set_monitor;
  double frame_time;

  bool close;
  bool resized;
  bool fullscreen;                    
  bool vsync;
  bool set_size;
  bool set_pos;

  int2 position;        
  int2 new_pos;
  int2 size;

  struct {
    int x,y;
    int dx,dy;
    int px,py;
    int pressed,released;
  } mouse;

  size display;                       
  size screen;                        
  size fbo;                    
  size render;                          
  size new_size;

};
void reset_sgl(Window *window);
void toggleFullscreen(Window *window);
int getMaxTextureSize();
int getCurrentMonitor(Window *window);
void drawText(int thread,float x,float y,const char *string,int align,double color[5]);
void setFontColor(int thread,int r,int g,int b,int a);
void setFontSize(int thread,int size);
void setFontFace(int thread,int face);
extern void *unused2;
extern void *unused1;
Image getInterfaceImage(char *name);
Texture texFromFile(const char *file,bool internal);
Image loadImageData(const char *fileName,bool internal);
unsigned char *loadFileData(const char *fileName,unsigned int *bytesRead,bool internal);
const char *TextToLower(const char *text);
const char *GetFileExtension(const char *fileName);
bool TextIsEqual(const char *text1,const char *text2);
bool lineSegmentIntersection(double Ax,double Ay,double Bx,double By,double Cx,double Cy,double Dx,double Dy,double *X,double *Y);
images_t getInterfaceImages();
Window *getWindow(int id);
extern double globalTime;
extern bool pass;
extern double tick;
extern double previousTime;
typedef struct Thread Thread;
typedef bool ma_engine;
struct Thread {
  Window window;
  float rx, ry;
  
  sg_backend backend; 

  FONScontext* fons;
  lua_State* lState;
  ma_engine audio;

  struct {
    int inconsolata;
    int interfont;
  } fonts;

};
typedef struct { 
  bool enabled;
}frameTween;
typedef struct { 
  bool blank;       
  bool isKey;       
  bool released;
  u16 index;
  u16 length; 
  u16 ox;
  u16 oy;            
  u16 strokes;
  u16 width;           
  u16 height;           
  u32 lastDrawn;
  u32 lastSave;
  u32 id;          
  frameTween tween;       
}frame_t;
typedef struct Rectangle Rectangle;
struct Rectangle {
    float x;
    float y;
    float width;
    float height;
};
#define INTERFACE 0
