Getting the SCREEN mode
#14
(09-30-2022, 02:30 AM)TerryRitchie Wrote: I working on Lesson 20: Libraries and was thinking about having the user go through the process of making one. My idea was to make custom text inputs, popups, message boxes, etc... However, the library would need to know which SCREEN mode it was in first for dimensions, available colors, current colors, etc.
For a site called "QB64 Game Programming" it might be better to make a recommendation to use "_NEWIMAGE" instead of "SCREEN" for new programs. "SCREEN" prevails, though for a generic tutorial which must accept importing programs from M$QB or QBasic. You could tell the students of the tutorial about "SCREEN", probably about the "historic" parameters it has which are confusing ("don't touch that second parameter or you'll be sorry LOL"), and then tell them why it's more limited than the means available in the programming system of choice. Also emphasize how "SCREEN()" is different and is quite good for "SCREEN 0", and for a graphics screen not going much further than "PRINT" to generate output. Finally consider telling the students about "$CONSOLE" mode which is a whole different world which has nothing to do with graphics, and the functions vary widely between "cmd.exe" on Windows and the Linux and MacOS terminals.

Somebody who doesn't care what M$ did to BASIC, but does know something about BASIC programming and is willing to dive into QB64PE, should be taught to use "_NEWIMAGE". Talking about "SCREEN" statement anyhow would only introduce confusion and would bring about questions like, "But Freebasic could use it" while that other programming system has an alternate way to set graphics screens and a structure to get and set the properties of the screen. As I've already said, using "_NEWIMAGE" comes down to saving width, height, color depth etc. into variables to be recalled when need be, run from a function to set those properties, and another function to acquire those properties.

EDIT: B+ wrote a good function above but it doesn't have to be interactive, just save into variables what could make one windowed screen different from another in QB64PE before using "_NEWIMAGE".
Reply


Messages In This Thread
Getting the SCREEN mode - by TerryRitchie - 09-29-2022, 04:04 PM
RE: Getting the SCREEN mode - by Pete - 09-29-2022, 08:25 PM
RE: Getting the SCREEN mode - by TerryRitchie - 09-29-2022, 08:36 PM
RE: Getting the SCREEN mode - by Pete - 09-29-2022, 08:45 PM
RE: Getting the SCREEN mode - by RhoSigma - 09-29-2022, 09:00 PM
RE: Getting the SCREEN mode - by mnrvovrfc - 09-29-2022, 11:06 PM
RE: Getting the SCREEN mode - by Pete - 09-30-2022, 12:04 AM
RE: Getting the SCREEN mode - by TerryRitchie - 09-30-2022, 02:30 AM
RE: Getting the SCREEN mode - by mnrvovrfc - 09-30-2022, 03:15 AM
RE: Getting the SCREEN mode - by TerryRitchie - 09-30-2022, 03:12 PM
RE: Getting the SCREEN mode - by mnrvovrfc - 09-30-2022, 04:21 PM
RE: Getting the SCREEN mode - by TerryRitchie - 09-30-2022, 04:38 PM
RE: Getting the SCREEN mode - by mnrvovrfc - 09-30-2022, 05:46 PM
RE: Getting the SCREEN mode - by RhoSigma - 09-30-2022, 08:15 AM
RE: Getting the SCREEN mode - by TerryRitchie - 09-30-2022, 03:05 PM
RE: Getting the SCREEN mode - by Pete - 09-30-2022, 02:37 AM
RE: Getting the SCREEN mode - by bplus - 09-30-2022, 02:38 AM
RE: Getting the SCREEN mode - by bplus - 09-30-2022, 02:57 AM
RE: Getting the SCREEN mode - by Pete - 09-30-2022, 03:01 AM
RE: Getting the SCREEN mode - by bplus - 09-30-2022, 03:10 AM
RE: Getting the SCREEN mode - by Pete - 09-30-2022, 03:21 PM
RE: Getting the SCREEN mode - by Pete - 09-30-2022, 04:24 PM
RE: Getting the SCREEN mode - by Pete - 09-30-2022, 04:47 PM
RE: Getting the SCREEN mode - by TerryRitchie - 09-30-2022, 04:51 PM
RE: Getting the SCREEN mode - by Pete - 09-30-2022, 05:00 PM
RE: Getting the SCREEN mode - by Pete - 09-30-2022, 05:58 PM
RE: Getting the SCREEN mode - by mnrvovrfc - 09-30-2022, 05:59 PM
RE: Getting the SCREEN mode - by TempodiBasic - 10-03-2022, 11:13 PM
RE: Getting the SCREEN mode - by TempodiBasic - 10-04-2022, 11:22 PM
RE: Getting the SCREEN mode - by SMcNeill - 10-07-2022, 09:56 AM
RE: Getting the SCREEN mode - by TempodiBasic - 10-08-2022, 02:57 AM
RE: Getting the SCREEN mode - by Kernelpanic - 10-07-2022, 03:14 PM
RE: Getting the SCREEN mode - by TempodiBasic - 10-08-2022, 03:01 AM



Users browsing this thread: 6 Guest(s)