gb.h: under // Extern Symbols
extern int __DG_DOBORDERLESSWINDOW;
glb-full somewhere under namespace __GLBASIC__ {
int __DG_DOBORDERLESSWINDOW=0;
gb_pc.cpp: under void SETSCREEN(DGNat w, DGNat h, DGNat fs) {
// do you want a borderless window?
__DG_DOBORDERLESSWINDOW=0;
if (fs==2) { __DG_DOBORDERLESSWINDOW=1; fs=0; }
openglrainbows.cpp in the function bool OpenGLRainbows::DoWindowed()
replaec all code between // -------- WIN32 -------- and // update desktop
#elif defined(WIN32)
if (m_WND.fullscreen)
{
::ChangeDisplaySettings(NULL, 0);
restore_desktop();
}
if (__DG_DOBORDERLESSWINDOW==1)
{
::SetWindowLong(m_WND.hwnd, GWL_STYLE, WS_POPUP);
}
else
{
::SetWindowLong(m_WND.hwnd, GWL_EXSTYLE, 0);
::SetWindowLong(m_WND.hwnd, GWL_STYLE, WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX); // | WS_CLIPCHILDREN | WS_CLIPSIBLINGS);
}
::UpdateWindow(m_WND.hwnd);
WINDOWPLACEMENT wpl;
if(0 ) // !::GetWindowPlacement(m_WND.hwnd, &wpl)) // Win98 will fail this here...
{
wpl.rcNormalPosition.top=0;
wpl.rcNormalPosition.right=m_WND.width;
wpl.rcNormalPosition.bottom=m_WND.height;
::OffsetRect(&wpl.rcNormalPosition, (::GetSystemMetrics(SM_CXSCREEN)-m_WND.width)/2, (::GetSystemMetrics(SM_CYSCREEN)-m_WND.width)/2);
}
else
{
RECT rcCenter, rcArea;
::GetWindowRect(m_WND.hwnd, &rcCenter);
HMONITOR hMonitor = MonitorFromRect(&rcCenter, MONITOR_DEFAULTTONEAREST);
if(hMonitor)
{
MONITORINFO MonitorInfo = { sizeof MonitorInfo };
GetMonitorInfo(hMonitor, &MonitorInfo);
rcArea = MonitorInfo.rcWork;
}
else
::SystemParametersInfo(SPI_GETWORKAREA, 0, &rcArea, 0);
wpl.rcNormalPosition.left=0;
wpl.rcNormalPosition.top=0;
wpl.rcNormalPosition.right=m_WND.width +::GetSystemMetrics(SM_CXBORDER)*6;
wpl.rcNormalPosition.bottom=m_WND.height+::GetSystemMetrics(SM_CYCAPTION)+::GetSystemMetrics(SM_CYBORDER)*6;
::OffsetRect(&wpl.rcNormalPosition, ((rcArea.right-rcArea.left)-m_WND.width)/2, ((rcArea.bottom-rcArea.top)-m_WND.height)/2);
}
if (__DG_DOBORDERLESSWINDOW==0)
{
::SetWindowPos(m_WND.hwnd, HWND_NOTOPMOST,
wpl.rcNormalPosition.left,
wpl.rcNormalPosition.top,
wpl.rcNormalPosition.right - wpl.rcNormalPosition.left,
wpl.rcNormalPosition.bottom- wpl.rcNormalPosition.top,
SWP_SHOWWINDOW);
}
else
{
::SetWindowPos(m_WND.hwnd,HWND_NOTOPMOST,wpl.rcNormalPosition.left,wpl.rcNormalPosition.top, m_WND.width, m_WND.height, 0);
}
::ShowWindow(m_WND.hwnd, SW_SHOWNORMAL);
Now you can set a borderless window by just SETSCREEN, X, Y, 2