mirror of
https://github.com/QB64-Phoenix-Edition/QB64pe.git
synced 2024-08-05 14:40:26 +00:00
Fix to _SCREENMOVE using the glut commands. Should work in both WIN and LINUX.
This commit is contained in:
parent
ef083bb4af
commit
379984d860
5 changed files with 7877 additions and 7779 deletions
|
@ -1,2 +1,3 @@
|
||||||
#include "Steve Stuff/convert_angle.cpp"
|
#include "Steve Stuff/convert_angle.cpp"
|
||||||
#include "Steve Stuff/pi.cpp"
|
#include "Steve Stuff/pi.cpp"
|
||||||
|
#include "Steve Stuff/screeninfo.cpp"
|
||||||
|
|
|
@ -14,3 +14,5 @@ extern double func_rad2grad(double degree);
|
||||||
extern double func_grad2deg(double degree);
|
extern double func_grad2deg(double degree);
|
||||||
extern double func_grad2rad(double degree);
|
extern double func_grad2rad(double degree);
|
||||||
extern double func_pi();
|
extern double func_pi();
|
||||||
|
extern int32 func_screenwidth();
|
||||||
|
extern int32 func_screenheight();
|
|
@ -26900,45 +26900,20 @@ int32 func__printwidth(qbs* text, int32 screenhandle, int32 passed){
|
||||||
if (passed==3) goto error;
|
if (passed==3) goto error;
|
||||||
if (full_screen) return;
|
if (full_screen) return;
|
||||||
|
|
||||||
#ifndef NO_S_D_L
|
if (passed==2){
|
||||||
|
glutPositionWindow (x,y);}
|
||||||
#ifdef QB64_WINDOWS
|
else{
|
||||||
static SDL_SysWMinfo info;
|
int32 SW, SH, WW, WH;
|
||||||
static HWND win,win2;
|
SW = glutGet(GLUT_SCREEN_WIDTH);
|
||||||
static RECT r,r2,r3;
|
SH = glutGet(GLUT_SCREEN_HEIGHT);
|
||||||
static int32 x2,y2,x3,y3,x4,y4;
|
WW = glutGet(GLUT_WINDOW_WIDTH);
|
||||||
SDL_VERSION(&info.version);
|
WH = glutGet(GLUT_WINDOW_HEIGHT);
|
||||||
if (SDL_GetWMInfo(&info)){
|
x = (SW - WW)/2;
|
||||||
win=info.window;
|
y = (SH - WH)/2;
|
||||||
Sleep(100);//IMPORTANT: Release CPU so SDL/OS can fully create window or following calls may not work
|
glutPositionWindow (x,y);
|
||||||
if (passed&2){
|
|
||||||
SetWindowPos(win,NULL,x,y,NULL,NULL,SWP_NOSIZE);
|
|
||||||
}else{
|
|
||||||
//_MIDDLE method
|
|
||||||
win2=GetDesktopWindow();
|
|
||||||
retry:
|
|
||||||
GetWindowRect(win, &r);
|
|
||||||
GetClientRect(win, &r3);
|
|
||||||
//find the additional size of the window frame
|
|
||||||
x2=r.right-r.left; y2=r.bottom-r.top;
|
|
||||||
x2=x2-(r3.right-r3.left); y2=y2-(r3.bottom-r3.top);
|
|
||||||
if ((x2<0)||(y2<0)) goto retry;//OS was in process of creating window
|
|
||||||
//find the offsets to apply so that border & title bar are not included in the centering process
|
|
||||||
x3=x2/2; y3=y2-x3;
|
|
||||||
//find the size of our display page
|
|
||||||
x=display_page->width; y=display_page->height;
|
|
||||||
if (display_page->text){x*=fontwidth[display_page->font]; y*=fontheight[display_page->font];}
|
|
||||||
GetWindowRect(win2, &r2);
|
|
||||||
x=((r2.right-r2.left)/2)-(x/2)-x3;
|
|
||||||
y=((r2.bottom-r2.top)/2)-(y/2)-y3;
|
|
||||||
SetWindowPos(win,NULL,x,y,NULL,NULL,SWP_NOSIZE);
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif //NO_S_D_L
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
error(5);
|
error(5);
|
||||||
}
|
}
|
||||||
|
|
|
@ -159,3 +159,36 @@ id.args = 0
|
||||||
id.ret = DOUBLETYPE - ISPOINTER
|
id.ret = DOUBLETYPE - ISPOINTER
|
||||||
regid
|
regid
|
||||||
|
|
||||||
|
clearid
|
||||||
|
id.n = "_SCREENHEIGHT"
|
||||||
|
id.subfunc = 1
|
||||||
|
id.callname = "func_screenheight"
|
||||||
|
id.args = 0
|
||||||
|
id.ret = LONGTYPE - ISPOINTER
|
||||||
|
regid
|
||||||
|
|
||||||
|
clearid
|
||||||
|
id.n = "_SCREENWIDTH"
|
||||||
|
id.subfunc = 1
|
||||||
|
id.callname = "func_screenwidth"
|
||||||
|
id.args = 0
|
||||||
|
id.ret = LONGTYPE - ISPOINTER
|
||||||
|
regid
|
||||||
|
|
||||||
|
clearid
|
||||||
|
id.n = "_SHOWWINDOW"
|
||||||
|
id.subfunc = 2
|
||||||
|
id.callname = "glutShowWindow"
|
||||||
|
regid
|
||||||
|
|
||||||
|
clearid
|
||||||
|
id.n = "_HIDEWINDOW"
|
||||||
|
id.subfunc = 2
|
||||||
|
id.callname = "glutHideWindow"
|
||||||
|
regid
|
||||||
|
|
||||||
|
clearid
|
||||||
|
id.n = "_ICONIFYWINDOW"
|
||||||
|
id.subfunc = 2
|
||||||
|
id.callname = "glutIconifyWindow"
|
||||||
|
regid
|
||||||
|
|
15567
internal/source/main.txt
15567
internal/source/main.txt
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue