2007-04-11 04:58:32 -07:00
|
|
|
#ifndef MAIN_H
|
|
|
|
#define MAIN_H
|
|
|
|
|
2008-05-24 22:15:21 -07:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "config.h"
|
|
|
|
#endif
|
|
|
|
|
2007-04-11 04:58:32 -07:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
2011-04-28 02:44:29 -07:00
|
|
|
#include <unistd.h>
|
2007-04-11 04:58:32 -07:00
|
|
|
#include <math.h>
|
|
|
|
#include <time.h>
|
|
|
|
|
2012-10-24 07:14:25 -07:00
|
|
|
#if defined (HAVE_EVAS_SOFTWARE_XLIB) || defined (HAVE_EVAS_XRENDER_X11) ||defined (HAVE_EVAS_OPENGL_X11)
|
2012-08-10 02:19:05 -07:00
|
|
|
#include <X11/Xlib.h>
|
|
|
|
#endif
|
|
|
|
|
2010-04-10 05:37:13 -07:00
|
|
|
#ifndef _MSC_VER
|
|
|
|
# include <sys/time.h>
|
|
|
|
#endif
|
|
|
|
|
2007-08-17 02:39:18 -07:00
|
|
|
#ifdef _WIN32
|
|
|
|
# include <windows.h>
|
|
|
|
#endif
|
|
|
|
|
2008-10-27 01:06:01 -07:00
|
|
|
#ifdef HAVE_EVIL
|
|
|
|
# include <Evil.h>
|
|
|
|
#endif
|
|
|
|
|
2007-04-11 04:58:32 -07:00
|
|
|
#include <Evas.h>
|
2014-08-21 15:47:19 -07:00
|
|
|
#include <Ecore.h>
|
2008-05-24 22:15:21 -07:00
|
|
|
|
2008-12-20 06:46:54 -08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
#endif
|
|
|
|
|
2007-04-11 04:58:32 -07:00
|
|
|
#include "ui.h"
|
|
|
|
#include "about.h"
|
|
|
|
|
2010-05-21 00:10:45 -07:00
|
|
|
#define EVAS_FRAME_QUEUING // for test
|
|
|
|
|
2007-04-11 04:58:32 -07:00
|
|
|
#define OBNUM 128
|
2008-11-28 03:17:40 -08:00
|
|
|
#define LOOPS 128
|
2007-04-11 04:58:32 -07:00
|
|
|
|
|
|
|
extern Evas *evas;
|
|
|
|
extern int win_w, win_h;
|
2009-10-01 02:04:02 -07:00
|
|
|
extern int loops;
|
2014-10-21 23:49:25 -07:00
|
|
|
extern int one_test;
|
2014-08-21 15:47:19 -07:00
|
|
|
extern const char *choosen_engine;
|
|
|
|
extern Eina_Bool fullscreen;
|
|
|
|
extern Eina_Bool cmp_report;
|
2015-06-25 09:30:26 -07:00
|
|
|
extern char *output;
|
2007-04-11 04:58:32 -07:00
|
|
|
|
2010-02-24 10:25:18 -08:00
|
|
|
typedef struct _Expedite_Resolution Expedite_Resolution;
|
|
|
|
typedef struct _Expedite_Engine Expedite_Engine;
|
|
|
|
|
|
|
|
struct _Expedite_Resolution
|
|
|
|
{
|
|
|
|
const char *name;
|
|
|
|
int width;
|
|
|
|
int height;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _Expedite_Engine
|
|
|
|
{
|
|
|
|
const char *name;
|
|
|
|
Eina_Bool (*init)(const char *engine, int width, int height);
|
|
|
|
void (*loop)(void);
|
|
|
|
void (*shutdown)(void);
|
|
|
|
};
|
|
|
|
|
2008-05-24 22:15:21 -07:00
|
|
|
void srnd(void);
|
2007-04-11 04:58:32 -07:00
|
|
|
unsigned int rnd(void);
|
2008-05-24 22:15:21 -07:00
|
|
|
double get_time(void);
|
|
|
|
const char *build_path(const char *filename);
|
|
|
|
void engine_loop(void);
|
|
|
|
int engine_abort(void);
|
2007-04-11 04:58:32 -07:00
|
|
|
|
2008-12-20 06:46:54 -08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2007-04-11 04:58:32 -07:00
|
|
|
#define KEY_STD \
|
|
|
|
if ((!strcmp(key, "Escape")) || (!strcmp(key, "q")) || (!strcmp(key, "Q")) || (!strcmp(key, "Return"))) \
|
|
|
|
{ \
|
|
|
|
_cleanup(); \
|
|
|
|
ui_menu(); \
|
|
|
|
}
|
|
|
|
|
2015-06-25 09:30:26 -07:00
|
|
|
#define FPS_STD(x) \
|
|
|
|
if (!output && (f >= loops) && (!done)) \
|
|
|
|
{ \
|
|
|
|
double fps; \
|
|
|
|
fps = (double)f / t; \
|
|
|
|
printf("%4.2f , %s\n", fps, x); \
|
|
|
|
ui_fps(fps); \
|
|
|
|
done = 1; \
|
|
|
|
}
|
2007-04-11 04:58:32 -07:00
|
|
|
|
|
|
|
#define SLOW 5.0
|
|
|
|
|
|
|
|
#endif
|