#pragma once

#define GL_CONSTANT_COLOR 0x8001

#ifndef MK_XBUTTON1
#define	MK_XBUTTON1		0x0020
#define	MK_XBUTTON2		0x0040
#endif

#include "gl_GLExt.h"
#include "gl_mtex.h"
#include "gl_VARS.h"
#include "gl_gamma.h"
#include "gl_scr_effect.h"
#include "gl_bloom.h"
#include "gl_bump.h"
#include "gl_Buffer.h"
#include "in_raw.h"
#include "snd_api.h"

//for gl_jk_alias.c
static void R_RotateForEntity2(entity_t *e);
void R_DrawAliasModel (entity_t *e);
void R_DrawViewModel (void);
int* R_LightPointColour (vec3_t p);

void VID_ChangeMenuSize(void);

//for aliaslerp
//extern cvar_t r_nolerp_list;

#define MOD_NOLERP		256             //don't lerp when animating
#define MOD_NOSHADOW    512             //don't cast a shadow

#define LERP_MOVESTEP   (1<<0) //this is a MOVETYPE_STEP entity, enable movement lerp
#define LERP_RESETANIM  (1<<1) //disable anim lerping until next anim frame
#define LERP_RESETANIM2 (1<<2) //set this and previous flag to disable anim lerping for two anim frames
#define LERP_RESETMOVE  (1<<3) //disable movement lerping until next origin/angles change
#define LERP_FINISH		(1<<4) //use lerpfinish time from server update instead of assuming interval of 0.1
//This is from Protocol.h
#define U_LERPFINISH    (1<<20) // 1 byte, 0.0-1.0 maps to 0-255, not sent if exactly 0.1, this is ent->v.nextthink - sv.time, used for lerping
#define CLAMP(min, x, max) ((x) < (min) ? (min) : (x) > (max) ? (max) : (x)) //johnfitz
#define Q_rint(x) ((x) > 0 ? (int)((x) + 0.5) : (int)((x) - 0.5)) //johnfitz -- from joequake


#define MOD_GUNNAME		20
extern char	activegunname[MOD_GUNNAME];

// wgl function pointer for vsync
//typedef boolean (APIENTRY *PFNWGLSWAPINTERVALEXTPROC)        (int interval);
//extern PFNWGLSWAPINTERVALEXTPROC wglSwapIntervalEXT;

void LoadPuzzleStrings(void);

//mouse function
void IN_ClearRawState (void);