librw/skeleton/skeleton.h

121 lines
1.9 KiB
C
Raw Normal View History

extern rw::EngineOpenParams engineOpenParams;
2017-08-09 23:42:33 +01:00
namespace sk {
using namespace rw;
// same as RW skeleton
enum Key
{
// ascii...
KEY_ESC = 128,
KEY_F1 = 129,
KEY_F2 = 130,
KEY_F3 = 131,
KEY_F4 = 132,
KEY_F5 = 133,
KEY_F6 = 134,
KEY_F7 = 135,
KEY_F8 = 136,
KEY_F9 = 137,
KEY_F10 = 138,
KEY_F11 = 139,
KEY_F12 = 140,
KEY_INS = 141,
KEY_DEL = 142,
KEY_HOME = 143,
KEY_END = 144,
KEY_PGUP = 145,
KEY_PGDN = 146,
KEY_UP = 147,
KEY_DOWN = 148,
KEY_LEFT = 149,
KEY_RIGHT = 150,
// some stuff ommitted
KEY_BACKSP = 168,
KEY_TAB = 169,
KEY_CAPSLK = 170,
KEY_ENTER = 171,
KEY_LSHIFT = 172,
KEY_RSHIFT = 173,
KEY_LCTRL = 174,
KEY_RCTRL = 175,
KEY_LALT = 176,
KEY_RALT = 177,
KEY_NULL, // unused
KEY_NUMKEYS,
};
enum EventStatus
{
EVENTERROR,
EVENTPROCESSED,
EVENTNOTPROCESSED
};
enum Event
{
INITIALIZE,
RWINITIALIZE,
RWTERMINATE,
SELECTDEVICE,
PLUGINATTACH,
KEYDOWN,
KEYUP,
2017-12-30 10:43:17 +00:00
CHARINPUT,
MOUSEMOVE,
MOUSEBTN,
2017-10-20 21:38:28 +01:00
RESIZE,
2017-08-09 23:42:33 +01:00
IDLE,
QUIT
};
struct Globals
{
const char *windowtitle;
int32 width;
int32 height;
bool32 quit;
};
extern Globals globals;
2017-12-30 10:43:17 +00:00
// Argument to mouse events
struct MouseState
{
int posx, posy;
int buttons; // bits 0-2 are left, middle, right button down
};
2017-08-23 11:21:23 +01:00
struct Args
{
int argc;
char **argv;
};
extern Args args;
2017-08-09 23:42:33 +01:00
bool InitRW(void);
void TerminateRW(void);
Camera *CameraCreate(int32 width, int32 height, bool32 z);
2021-03-03 01:15:38 +00:00
void CameraDestroy(rw::Camera *cam);
2021-03-03 20:53:06 +00:00
void CameraSize(Camera *cam, Rect *r, float viewWindow = 0.0f, float aspectRatio = 0.0f);
void CameraMove(Camera *cam, V3d *delta);
void CameraPan(Camera *cam, V3d *pos, float angle);
void CameraTilt(Camera *cam, V3d *pos, float angle);
void CameraRotate(Camera *cam, V3d *pos, float angle);
2017-12-30 10:43:17 +00:00
void SetMousePosition(int x, int y);
2017-08-09 23:42:33 +01:00
EventStatus EventHandler(Event e, void *param);
}
sk::EventStatus AppEventHandler(sk::Event e, void *param);
2017-12-30 10:43:17 +00:00
#include "imgui/imgui.h"
#include "imgui/imgui_impl_rw.h"