1
1
Fork 0
mirror of https://github.com/QB64Official/qb64.git synced 2024-07-03 03:01:22 +00:00

Change to the Console Font routine.

CFont uses a few function calls which aren't supported by anything older than Windows Vista, while QB64 otherwise works all the way back to Windows XP.  Since there's no desire to make us lose functionality with older systems and obsolute them to oblivion, the code has been commented out and replaced with a stub as default.  Users of older machines can simply use it "as is", as can folks who don't care about console functionality.  Users with versions of Windows from Vista up, can simply uncomment the code (comment out the placeholder stub), and then purge libqb so we automatically rebuild our library to make use of the routine.

It seemed the easiest way to keep it in there, more or less, so that people who wanted to use it can, while not bothering the rest of the user base.  There just needs to be  a short note wrote up in the documention on how to "enable the command", but it's not a hard process (uncomment a few lines, comment a few others, and run a batch file -- if a programmer can't handle that much, then they don't need the command to start with...).
This commit is contained in:
SteveMcNeill 2019-11-29 04:01:22 -05:00
parent c1142e67ce
commit 472bf29d99

View file

@ -29588,6 +29588,23 @@ void reinit_glut_callbacks(){
keybd_event (VK_SCROLL, 0x45, 3, 0);
}
//CFont commented out as it requires more modern versions of Windows to run and work.
//Adding it into QB64 would mean that we would no longer run on Windows XP and such,
//and at this time, it's been decided that we dont actually want to drop compatability with those older operating systems.
//I'll leave the code in here, in case it's decided later that we're no longer to stick
//to Windows XP compatability.
//For now, the easiest solution to this dilemma seems to be to just leave the code here,
//and place a stub which does nothing in place of it.
//If people with newer operating systems want to make use of it, all they'd need to do is
//comment out the stub and uncomment the actual working code, and then purge_libqb.bat to rebuild the library we link to.
void CFont(qbs* FontName, int FontSize){
return; //you can't get much stubbier than this! LOL!
}
/*
void CFont(qbs* FontName, int FontSize){
SECURITY_ATTRIBUTES SecAttribs = {sizeof(SECURITY_ATTRIBUTES), 0, 1};
HANDLE cl_conout = CreateFileA("CONOUT$", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, & SecAttribs, OPEN_EXISTING, 0, 0);
@ -29610,6 +29627,7 @@ void reinit_glut_callbacks(){
SetCurrentConsoleFontEx(cl_conout, NULL, &info);
}
*/
void sub__console_cursor(int32 visible, int32 cursorsize, int32 passed){
HANDLE consoleHandle = GetStdHandle(STD_OUTPUT_HANDLE);