raze-gles/source/build/src/baselayer.cpp
Christoph Oelckers 21ac5e87b5 - added blend table translucency estimation instead of using a lame default.
- draw fullscreen blends below the console.
- moved all mouse event processing out of the SDL backend to D_PostEvent.
- removed all remaining code for dealing with mouse buttons directly.
2019-11-10 15:15:14 +01:00

79 lines
1.6 KiB
C++

#include "compat.h"
#include "osd.h"
#include "build.h"
#include "baselayer.h"
#include "renderlayer.h"
#include "a.h"
#include "polymost.h"
#include "cache1d.h"
#include "inputstate.h"
#include "d_event.h"
#include "../../glbackend/glbackend.h"
// video
#ifdef _WIN32
extern "C"
{
__declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 0x00000001;
__declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001;
}
#endif // _WIN32
int32_t g_borderless=2;
int GUICapture = false;
// input
char inputdevices = 0;
bool g_mouseEnabled;
bool g_mouseGrabbed;
bool g_mouseInsideWindow = 1;
bool g_mouseLockedToWindow = 1;
controllerinput_t joystick;
void joySetCallback(void (*callback)(int32_t, int32_t)) { joystick.pCallback = callback; }
void joyReadButtons(int32_t *pResult) { *pResult = appactive ? joystick.bits : 0; }
// Calculate ylookup[] and call setvlinebpl()
void calc_ylookup(int32_t bpl, int32_t lastyidx)
{
int32_t i, j=0;
static int32_t ylookupsiz;
Bassert(lastyidx <= MAXYDIM);
lastyidx++;
if (lastyidx > ylookupsiz)
{
Xaligned_free(ylookup);
ylookup = (intptr_t *)Xaligned_alloc(16, lastyidx * sizeof(intptr_t));
ylookupsiz = lastyidx;
}
for (i=0; i<=lastyidx-4; i+=4)
{
ylookup[i] = j;
ylookup[i + 1] = j + bpl;
ylookup[i + 2] = j + (bpl << 1);
ylookup[i + 3] = j + (bpl * 3);
j += (bpl << 2);
}
for (; i<lastyidx; i++)
{
ylookup[i] = j;
j += bpl;
}
setvlinebpl(bpl);
}
int32_t g_logFlushWindow = 1;