Skip to content

Commit

Permalink
Adding support for full screen
Browse files Browse the repository at this point in the history
  • Loading branch information
captainys committed Jan 25, 2022
1 parent 8f9264b commit 766f154
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/fssimplewindow/src/windows/fswin32wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,14 +290,24 @@ void FsCloseWindow(void)

void FsMaximizeWindow(void)
{
auto style=GetWindowLong(fsWin32Internal.hWnd,GWL_STYLE);
style=(style|WS_THICKFRAME|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX|WS_MAXIMIZEBOX);
SetWindowLong(fsWin32Internal.hWnd,GWL_STYLE,style);
ShowWindow(fsWin32Internal.hWnd,SW_MAXIMIZE);
}
void FsUnmaximizeWindow(void)
{
auto style=GetWindowLong(fsWin32Internal.hWnd,GWL_STYLE);
style=(style|WS_THICKFRAME|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX|WS_MAXIMIZEBOX);
SetWindowLong(fsWin32Internal.hWnd,GWL_STYLE,style);
ShowWindow(fsWin32Internal.hWnd,SW_RESTORE);
}
void FsMakeFullScreen(void)
{
auto style=GetWindowLong(fsWin32Internal.hWnd,GWL_STYLE);
style=(style&~(WS_THICKFRAME|WS_BORDER|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX|WS_MAXIMIZEBOX));
SetWindowLong(fsWin32Internal.hWnd,GWL_STYLE,style);
ShowWindow(fsWin32Internal.hWnd,SW_MAXIMIZE);
}

void FsGetWindowSize(int &wid,int &hei)
Expand Down
6 changes: 6 additions & 0 deletions src/ysbitmap/src/ysbitmaptemplate.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@ class YsBitmapTemplate
*/
YSRESULT CutOut(YsBitmapTemplate <ComponentType,NumComponentPerPixel> &destination,int thisX0,int thisY0,int wid,int hei,ComponentType clearColor) const
{
if(0==wid || 0==hei)
{
destination.CleanUp();
return YSOK;
}

destination.Create(wid,hei);

int destY=0;
Expand Down

0 comments on commit 766f154

Please sign in to comment.