
#pragma once

namespace VR
{
///////////////////////////////////////////////////////////////////////
// Common definitions
//


#define WM_START                (WM_USER + 1)
#define WM_STOP                 (WM_USER + 2)
#define WM_STEP                 (WM_USER + 3)


// Used with WM_NOTIFY to control testing process
#define NOTIFY_START            10001
#define NOTIFY_STOP             10002
#define NOTIFY_STEP             10003


const int
    IS_FPU_MMX                  = 0,
    IS_FPU_EMMX                 = 1,
    IS_SSE                      = 2,
    IS_SSE2                     = 3,
    IS_CUSTOM                   = 100;

const int
    RENDER_SHADOWS              = 0x00000001,
    RENDER_SHADOWS_SUPER        = 0x00000002,
    RENDER_TEXTURE              = 0x00000010,
    RENDER_OFFSCREEN            = 0x00010000;

#pragma pack(push, 4)

typedef struct _DISPLAYINFO
{
    DWORD depth;
    DWORD width;
    DWORD height;
    DWORD frequency;
} DISPLAYINFO, *LPDISPLAYINFO;

typedef struct _RENDERPARAMS
{
    DISPLAYINFO di;             // display info
    SIZE        vp;             // viewport
    int         is;             // instruction set
    int         win;            // windowed
    DWORD       flag;           // teture, shadows, etc..
    int         camera;         // free camera enabled
    DWORD       reserved[2];    // reserved (space padding)
} RENDERPARAMS, *LPRENDERPARAMS;

typedef struct _TESTPARAMS
{
    SIZE        ttp;            // test time period (start/stop, etc…)
    int         tis;            // test instruction set
    int         tts;            // test time step
    int         tin;            // test iterations number
    LPCTSTR     model;          // model name
    DWORD       reserved[2];    // reserved (space padding)
} TESTPARAMS, *LPTESTPARAMS;

typedef struct _RESULTS
{
    __int64     solvingtickcount;
    __int64     prerenderingtickcount;
    __int64     renderingtickcount;
    __int64     framesqu;
} RESULTS, *LPRESULTS;

typedef struct
{
    RENDERPARAMS rp;
    TESTPARAMS tp;
} DATABUNDLE, *LPDATABUNDLE;

#pragma pack(pop)


DECLARE_INTERFACE(IObject)  // an abstract class in C++
{
    // connects to other subsystems, e.g. MS DirectX
    STDMETHOD(Connect)(HWND) PURE; 
    STDMETHOD(Disconnect)(void) PURE;		// 

    // allocates memory, init internal data,
    // either defaults or those ones set by SetData() (see below)
    STDMETHOD(Initialize)(void) PURE;
    // stops process, deallocates memory..
    STDMETHOD(Terminate)(void) PURE; 

    // sets data bunch.. the exact structure is discussible
    STDMETHOD(SetData)(void* data) PURE;	
    // supply a bunch of results.. 
    // the exact structure is discussible as well..
    STDMETHOD(GetData)(void* data) PURE;	

    // redirects Windows messages, or sends custom commands (e.g. Ping())
    STDMETHOD(ProcessMessage)(HWND, UINT, WPARAM, LPARAM, LRESULT*) PURE;
};

typedef IObject* LPIObject;
typedef IObject* (WINAPI TCreateObject)(void);
typedef TCreateObject *PTCreateObject;

};  // namespace VR

using namespace VR;


