mirror of
https://github.com/AxioDL/boo.git
synced 2025-06-06 22:53:39 +00:00
Merge branch 'master' of https://github.com/AxioDL/libBoo
This commit is contained in:
commit
8e3aa4faa9
@ -30,6 +30,7 @@ static const int ContextAttribs[] =
|
|||||||
{
|
{
|
||||||
GLX_CONTEXT_MAJOR_VERSION_ARB, 3,
|
GLX_CONTEXT_MAJOR_VERSION_ARB, 3,
|
||||||
GLX_CONTEXT_MINOR_VERSION_ARB, 3,
|
GLX_CONTEXT_MINOR_VERSION_ARB, 3,
|
||||||
|
GLX_CONTEXT_FLAGS_ARB, GLX_CONTEXT_CORE_PROFILE_BIT_ARB,
|
||||||
//GLX_CONTEXT_FLAGS_ARB, GLX_CONTEXT_DEBUG_BIT_ARB,
|
//GLX_CONTEXT_FLAGS_ARB, GLX_CONTEXT_DEBUG_BIT_ARB,
|
||||||
//GLX_CONTEXT_FLAGS_ARB, GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB,
|
//GLX_CONTEXT_FLAGS_ARB, GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB,
|
||||||
None
|
None
|
||||||
@ -366,7 +367,7 @@ public:
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct WindowXlib : IWindow
|
class WindowXlib : public IWindow
|
||||||
{
|
{
|
||||||
Display* m_xDisp;
|
Display* m_xDisp;
|
||||||
IWindowCallback* m_callback;
|
IWindowCallback* m_callback;
|
||||||
@ -388,7 +389,8 @@ struct WindowXlib : IWindow
|
|||||||
/* Cached window rectangle (to avoid repeated X queries) */
|
/* Cached window rectangle (to avoid repeated X queries) */
|
||||||
int m_wx, m_wy, m_ww, m_wh;
|
int m_wx, m_wy, m_ww, m_wh;
|
||||||
float m_pixelFactor;
|
float m_pixelFactor;
|
||||||
|
bool m_inFs = false;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
WindowXlib(const std::string& title,
|
WindowXlib(const std::string& title,
|
||||||
@ -569,14 +571,9 @@ public:
|
|||||||
{
|
{
|
||||||
return m_pixelFactor;
|
return m_pixelFactor;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool m_inFs = false;
|
|
||||||
int m_origFrame[4];
|
|
||||||
uint32_t m_decoBits;
|
|
||||||
|
|
||||||
bool isFullscreen() const
|
bool isFullscreen() const
|
||||||
{
|
{
|
||||||
#if 0
|
|
||||||
unsigned long nitems;
|
unsigned long nitems;
|
||||||
Atom actualType;
|
Atom actualType;
|
||||||
int actualFormat;
|
int actualFormat;
|
||||||
@ -597,81 +594,26 @@ public:
|
|||||||
XFree(vals);
|
XFree(vals);
|
||||||
return fullscreen;
|
return fullscreen;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
#endif
|
|
||||||
return m_inFs;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct FSHints
|
|
||||||
{
|
|
||||||
uint32_t flags;
|
|
||||||
uint32_t functions;
|
|
||||||
uint32_t decorations;
|
|
||||||
int32_t inputMode;
|
|
||||||
uint32_t status;
|
|
||||||
};
|
|
||||||
|
|
||||||
void setFullscreen(bool fs)
|
void setFullscreen(bool fs)
|
||||||
{
|
{
|
||||||
#if 0
|
if (fs == m_inFs)
|
||||||
XEvent fsEvent;
|
return;
|
||||||
fsEvent.type = ClientMessage;
|
|
||||||
|
XEvent fsEvent = {0};
|
||||||
|
fsEvent.xclient.type = ClientMessage;
|
||||||
fsEvent.xclient.window = m_windowId;
|
fsEvent.xclient.window = m_windowId;
|
||||||
fsEvent.xclient.message_type = XInternAtom(m_xDisp, "_NET_WM_STATE", False);
|
fsEvent.xclient.message_type = XInternAtom(m_xDisp, "_NET_WM_STATE", False);
|
||||||
fsEvent.xclient.format = 32;
|
fsEvent.xclient.format = 32;
|
||||||
fsEvent.xclient.data.l[0] = fs;
|
fsEvent.xclient.data.l[0] = fs;
|
||||||
fsEvent.xclient.data.l[1] = XInternAtom(m_xDisp, "_NET_WM_STATE_FULLSCREEN", False);
|
fsEvent.xclient.data.l[1] = XInternAtom(m_xDisp, "_NET_WM_STATE_FULLSCREEN", False);
|
||||||
fsEvent.xclient.data.l[2] = 0;
|
fsEvent.xclient.data.l[2] = 0;
|
||||||
XSendEvent(m_xDisp, m_windowId, False,
|
XSendEvent(m_xDisp, DefaultRootWindow(m_xDisp), False,
|
||||||
StructureNotifyMask | SubstructureRedirectMask, (XEvent*)&fsEvent);
|
StructureNotifyMask | SubstructureRedirectMask, (XEvent*)&fsEvent);
|
||||||
#endif
|
m_inFs = fs;
|
||||||
if (!m_inFs)
|
|
||||||
{
|
|
||||||
if (!fs)
|
|
||||||
return;
|
|
||||||
|
|
||||||
XSetWindowAttributes attrs = {};
|
|
||||||
attrs.override_redirect = True;
|
|
||||||
//XChangeWindowAttributes(m_xDisp, m_windowId, CWOverrideRedirect, &attrs);
|
|
||||||
|
|
||||||
FSHints hints = {};
|
|
||||||
hints.flags = 2;
|
|
||||||
hints.decorations = 1;
|
|
||||||
XChangeProperty(m_xDisp, m_windowId, S_ATOMS->m_motifWmHints, S_ATOMS->m_motifWmHints, 32,
|
|
||||||
PropModeReplace, (unsigned char*)&hints, 5);
|
|
||||||
|
|
||||||
getWindowFrame(m_origFrame[0], m_origFrame[1], m_origFrame[2], m_origFrame[3]);
|
|
||||||
Screen* screen = DefaultScreenOfDisplay(m_xDisp);
|
|
||||||
if (m_origFrame[2] < 1 || m_origFrame[3] < 1)
|
|
||||||
genFrameDefault(screen, m_origFrame[0], m_origFrame[1], m_origFrame[2], m_origFrame[3]);
|
|
||||||
fprintf(stderr, "= %d %d %d %d\n", m_origFrame[0], m_origFrame[1], m_origFrame[2], m_origFrame[3]);
|
|
||||||
fprintf(stderr, "%d %d %d %d\n", 0, 0, screen->width, screen->height);
|
|
||||||
setWindowFrame(0, 0, screen->width, screen->height);
|
|
||||||
|
|
||||||
m_inFs = true;
|
|
||||||
fprintf(stderr, "FULLSCREEN\n");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (fs)
|
|
||||||
return;
|
|
||||||
|
|
||||||
fprintf(stderr, "%d %d %d %d\n", m_origFrame[0], m_origFrame[1], m_origFrame[2], m_origFrame[3]);
|
|
||||||
setWindowFrame(m_origFrame[0], m_origFrame[1], m_origFrame[2], m_origFrame[3]);
|
|
||||||
|
|
||||||
XSetWindowAttributes attrs = {};
|
|
||||||
attrs.override_redirect = False;
|
|
||||||
//XChangeWindowAttributes(m_xDisp, m_windowId, CWOverrideRedirect, &attrs);
|
|
||||||
|
|
||||||
FSHints hints = {};
|
|
||||||
hints.flags = 2;
|
|
||||||
hints.decorations = 1;
|
|
||||||
XChangeProperty(m_xDisp, m_windowId, S_ATOMS->m_motifWmHints, S_ATOMS->m_motifWmHints, 32,
|
|
||||||
PropModeReplace, (unsigned char*)&hints, 5);
|
|
||||||
|
|
||||||
m_inFs = false;
|
|
||||||
fprintf(stderr, "WINDOWED\n");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void waitForRetrace()
|
void waitForRetrace()
|
||||||
@ -1072,6 +1014,13 @@ public:
|
|||||||
return m_gfxCtx.getLoadContextDataFactory();
|
return m_gfxCtx.getLoadContextDataFactory();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool _isWindowMapped()
|
||||||
|
{
|
||||||
|
XWindowAttributes attr;
|
||||||
|
XGetWindowAttributes(m_xDisp, m_windowId, &attr);
|
||||||
|
return attr.map_state != IsUnmapped;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
IWindow* _WindowXlibNew(const std::string& title,
|
IWindow* _WindowXlibNew(const std::string& title,
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
#include <boo/graphicsdev/D3D11.hpp>
|
#include <boo/graphicsdev/D3D11.hpp>
|
||||||
#elif _WIN32_WINNT_WIN7
|
#elif _WIN32_WINNT_WIN7
|
||||||
#include <boo/graphicsdev/D3D11.hpp>
|
#include <boo/graphicsdev/D3D11.hpp>
|
||||||
#else
|
#elif _WIN32
|
||||||
#error unsupported windows version
|
#error unsupported windows version
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -34,6 +34,7 @@ class DolphinSmashAdapterCallback : public IDolphinSmashAdapterCallback
|
|||||||
{
|
{
|
||||||
printf("CONTROLLER %u UPDATE %d %d\n", idx, state.m_leftStick[0], state.m_leftStick[1]);
|
printf("CONTROLLER %u UPDATE %d %d\n", idx, state.m_leftStick[0], state.m_leftStick[1]);
|
||||||
printf(" %d %d\n", state.m_rightStick[0], state.m_rightStick[1]);
|
printf(" %d %d\n", state.m_rightStick[0], state.m_rightStick[1]);
|
||||||
|
printf(" %d %d\n", state.m_analogTriggers[0], state.m_analogTriggers[1]);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -422,20 +423,6 @@ struct TestApplicationCallback : IApplicationCallback
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
int wmain(int argc, const wchar_t** argv)
|
|
||||||
#else
|
|
||||||
int main(int argc, const char** argv)
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
LogVisor::RegisterConsoleLogger();
|
|
||||||
boo::TestApplicationCallback appCb;
|
|
||||||
int ret = ApplicationRun(boo::IApplication::PLAT_AUTO,
|
|
||||||
appCb, _S("rwk"), _S("RWK"), argc, argv);
|
|
||||||
printf("IM DYING!!\n");
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if _WIN32
|
#if _WIN32
|
||||||
int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE, LPWSTR lpCmdLine, int)
|
int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE, LPWSTR lpCmdLine, int)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user