1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-12 20:25:14 +00:00
Commit graph

2838 commits

Author SHA1 Message Date
github-actions[bot] 0c28341eb9 Automatic update of ./internal/source 2022-12-19 15:39:35 +00:00
Matt Kilgore 78b09c1ea2
Merge pull request #275 from flukiluke/main
Reduce the number of times nm is invoked
2022-12-19 10:17:05 -05:00
Luke Ceddia 4086cda00d
Clean up nm commands 2022-12-19 22:36:58 +11:00
Luke Ceddia ed0b6b12a5 Use tmpdir$ instead of internal/temp/ when invoking nm 2022-12-18 21:45:06 +11:00
Luke Ceddia ab0c2b189d Only run nm once per library 2022-12-18 20:45:58 +11:00
github-actions[bot] 6aea9b3a65 Automatic update of ./internal/source 2022-12-03 17:00:49 +00:00
Matt Kilgore acf918bafd
Merge pull request #270 from mkilgore/glut-fix
Only call GLUT functions from the GLUT thread.
2022-12-03 11:41:15 -05:00
Matthew Kilgore 7ac2eefcb8 Fix slowdown of _ScreenX and _ScreenY
The commands _ScreenX and _ScreenY got significantly slower due to the
need to wait for the GLUT thread to wake up and execute the glutGet()
command for them. We've already seen a few programs (including the IDE)
where this behavior completely grinds the program to a halt, so we
definitely can't keep it.

The simple solution here is to not call glutGet() on every _ScreenX/Y
command. Instead every time the idle/timer function runs we get the
current values for the relevant glutGet() variables and store them.
libqb_glut_get() then checks if the value being read is one of the ones
we read in the idle/timer functionand if so just returns the last read
value. By doing it this way the commands no longer has to wait on the
GLUT thread for the result.
2022-11-30 17:33:17 -05:00
Matthew Kilgore f7fabda198 Fix random seg faults on exit
Fairly straightfowrad, programs were randomly seg faulting on exit. This
was happening due to GLUT registering a cleanup function via atexit(),
which then gets called when exit() is called.

The issue happens when exit() is called on a thread other than the GLUT
thread, which leads to the exit() call then attempting to cleanup GLUT
while the other thread is still using it, which randomly leads to seg
faults.

Fixing this is slightly annoying. We cannot stop the GLUT thread, as
the basic GLUT API (which is used on Mac OS) simply does not offer a way
to exit the glutMainLoop() call. Thus the simplest solution is to simply
make sure we call exit() on the GLUT thread, which we can fairly easily
due via the message queue.

That being the case, a new libqb_exit() API was added, which simply
regsiters the GLUT exit message and then waits for the program to end.
The atexit() handler then runs on the GLUT thread and everything works
out fine.

In the future we probably should redo the exit logic a bit so that all
the threads are actually stopped/joined to ensure the exit process is
consistent, however this is good enough for now. Also, there's plenty of
error states which call exit() which I did not address.
2022-11-29 20:04:54 -05:00
Matthew Kilgore 6c288ecb6f Don't compile libqb.cpp as Objective-C on Mac OS
With the recent changes to libqb.cpp to pull out some of the GLUT logic,
the only actual Objective-C in libqb.cpp was pulled out. That being the
case, it's no longer necessary to have libqb.mm for compiling libqb.cpp,
so we're removing it to simplify the compliation logic a bit.
2022-11-29 20:04:54 -05:00
Matthew Kilgore 72193e34e5 Add GLUT command queue, processed on GLUT thread
This fixes all the code so that all the calls to glut functions
happen on the same thread that is running GLUT.

We achieve this by creating a queue of GLUT commands to execute.
Commands can be added to the queue anywhere in the code, and then the
queue is processed on the GLUT thread via it's idle func or timer func.
The command is run and if necessary the result is provided in the
message queue object. Each object contains a completion which can be
waited on to block until the GLUT thread has processed the command.

Fixes: #66
2022-11-29 20:04:54 -05:00
Matthew Kilgore d678be717c Move GLUT initialization logic into separate .cpp file 2022-11-29 20:04:53 -05:00
Matthew Kilgore 3e03cef652 Install Xvfb on Linux build agent
Xvfb is being used to give us an X server implementation on the Linux
build agents. A running X server is necessary for graphics to function
(which we have so far avoided testing).
2022-11-29 20:04:53 -05:00
Matthew Kilgore a79c943d36 Add GLUT initialization tests
These tests cover all the commands that generally interact with GLUT.
The ensure that these functions can be used at the very beginning of a
program with no issues. Additionally they verify the behavior of these
functions in the presence of `$SCREENHIDE`, and also `_ScreenHide`.
2022-11-29 20:04:53 -05:00
github-actions[bot] e12b13eebf Automatic update of ./internal/source 2022-11-27 21:41:39 +00:00
Steve McNeill 585a0cf31a
Merge pull request #264 from SteveMcNeill/main
Minor IDE tweaks
2022-11-27 16:23:50 -05:00
Steve McNeill 7894b8eec3
Merge branch 'main' into main 2022-11-27 14:50:00 -05:00
github-actions[bot] 6547bed5e0 Automatic update of ./internal/source 2022-11-27 19:32:17 +00:00
Matt Kilgore 2fb7080808
Merge pull request #267 from mkilgore/fix-ide-printing
Fix the 'Beginning C++' message to stop being printed when using the IDE
2022-11-27 14:13:56 -05:00
Matthew Kilgore 816126be08 Fix the Beginning C++ message being printed when using the IDE
This was overlooked in #258, previously this printing was being skipped
over via a check of idemode, but after changing where it was located so
it only prints once it now runs when using the IDE, which screwed up the
drawing of the IDE screen.

The simple fix is to check for idemode before doing the printing, which
is effectively what it was doing before anyway.

Fixes: #266
2022-11-27 12:41:07 -05:00
Steve McNeill d3f12be83b
Merge branch 'main' into main 2022-11-27 02:38:15 -05:00
SteveMcNeill 4e08c25057 Restore a little too much cut from last update. :P 2022-11-27 01:13:54 -05:00
SteveMcNeill 093396d538 Remove some redundancy in color dialog code 2022-11-27 01:06:25 -05:00
SteveMcNeill d0c7b5abb2 Bump to IDE size
As talked about in the Discord Chat, a bump up to 120x40 for the IDE size, if the user hasn't set something custom.
2022-11-27 00:33:48 -05:00
SteveMcNeill 4a078a1595 Add IDEErrorColor setting to config file 2022-11-27 00:26:46 -05:00
github-actions[bot] dbd18aeae1 Automatic update of ./internal/source 2022-11-27 04:55:10 +00:00
Matt Kilgore ebc6426b5d
Merge pull request #260 from mkilgore/fix-glut-init-logic
Fix GLUT initilization logic to initialize GLUT before the main program code starts.
2022-11-26 23:36:33 -05:00
Matt Kilgore 8185234792
Merge branch 'main' into fix-glut-init-logic 2022-11-26 22:42:46 -05:00
github-actions[bot] 715bfd3682 Automatic update of ./internal/source 2022-11-27 03:36:50 +00:00
Matt Kilgore a9b5c635ee
Merge pull request #258 from mkilgore/fix-output-flag-startdir
Fix QB64-PE dependency list, _StartDir$ relative compile with no -o, and command line output.
2022-11-26 22:17:47 -05:00
Matthew Kilgore 77c5e6c39c -x should create executable relative to _StartDir$ when -o is not provided
Starting with #201, source files relative to `_StartDir$` are allowed to
be passed to `-x` and compile as expected. Additionally as part of that
change, when the `-x` parameter is relative to `_StartDir$`, the `-o`
argument is _also_ treated relative to `_StartDir$`. This is simply the
behavior everyone using the compiler would expect - that the source file
and `-o` are relative to the same location.

An overlooked behavior was the executable location when `-o` is not
provided. It still writes to compiler directory, but it really should be
writing to `_Startdir$` since the output executable is intended to be
relative to the same location the source file is relative too. Overall
this is fairly straight forward to fix as the logic is the same, we just
need to make use of it when the `-o` flag is not provided.

Fixes: #257
2022-11-26 21:25:33 -05:00
Matthew Kilgore ae6602ecaf Prevent commands like NoPrefix duplicating commandline output
Some commands like NoPrefix trigger a complete "recompile" due to how
they work. This has the accidental effect of duplicating the command
line output, which should still only be printed once. Moving the
printing logic up a bit is a simple solution.

Fixes: #256
2022-11-26 21:25:33 -05:00
Matthew Kilgore ac999d8f4b Add DEP_HTTP to the dependency list for QB64-PE
Fairly straight forward, QB64-PE's dependency list has to be built into
the Makefile for when we're building straight from ./internal/source.
Recently it gained a HTTP dependency, so that now needs to be included.

Fixes: #255
2022-11-26 21:25:33 -05:00
github-actions[bot] a8cc180307 Automatic update of ./internal/source 2022-11-27 02:24:41 +00:00
Steve McNeill d4cd4f6af8
Merge pull request #262 from SteveMcNeill/main
Fix to Issue #233 with $IF and VERSION
2022-11-26 21:06:32 -05:00
Steve McNeill 8bb2aefcb6
Merge branch 'main' into main 2022-11-26 20:33:48 -05:00
github-actions[bot] 3cba0d4265 Automatic update of ./internal/source 2022-11-27 00:30:08 +00:00
Roland Heyder b8936de288
Merge pull request #263 from QB64-Phoenix-Edition/refactoring
Simplify #include
2022-11-27 01:12:06 +01:00
Roland Heyder ec6e648007 Simplify #include
Solving #119
2022-11-27 00:11:04 +01:00
SteveMcNeill 62cafd7a14 Redo and expand Version Compare Logic 2022-11-26 15:59:49 -05:00
Steve McNeill 660fa711c9
Merge branch 'main' into main 2022-11-26 13:05:51 -05:00
SteveMcNeill 7576dc46fe Fix to Issue #233 with $IF and VERSION
https://github.com/QB64-Phoenix-Edition/QB64pe/issues/233

This should fix the comparisons with $IF and VERSION.   A few things of note here, which might affect future version labeling:

This expects to find version numbers which follow our current style -- ##.##.##   -- 3 numbers, separated by periods.

Adding in alphabetic characters will basically get ignored, and versions with less than 3 values will generate FALSE results in all comparisons.
2022-11-26 05:18:29 -05:00
github-actions[bot] 28dc80b551 Automatic update of ./internal/source 2022-11-26 09:13:26 +00:00
Steve McNeill f9b7da4777
Merge pull request #261 from SteveMcNeill/main
Change to Open File Dialog
2022-11-26 03:53:11 -05:00
SteveMcNeill 6cc0432a99 Merge branch 'main' of https://github.com/SteveMcNeill/QB64pe-fork 2022-11-26 03:07:09 -05:00
SteveMcNeill b32059f155 Change to Open File Dialog
Change to open file dialog so that it initially opens in the user's StartDir$, and then from whatever folder they navigate to after that.
2022-11-26 03:06:36 -05:00
Matthew Kilgore d2aa572a94 Fix GLUT initialization logic
The current GLUT initialization logic is flawed because it allows the
QB64 code portion of the program to start on a separate thread at the
same time that the GLUT code is starting. This results in a race where
some commands won't work for a brief period at the beginning of the
program (with "won't work" being very inconsistent, some return invalid
values, some have a chance at seg faulting).

The same issue also leads to us adding many `while (!window_exists)`
checks in an attempt to solve this race for some of the commands.
Unfortunately this solution is very inconsistently applied leading to
some deadlock situations, and really it's a silly solution when this
race is entirely our creation anyway.

To fix this, the logic was changed such that we perform all of the GLUT
initialization besides calling `glutMainLoop()` before we ever start the
thread that runs the actual QB64 code. By doing it this way we ensure
that the GLUT initialization has already taken place before the code
runs and thus the race is gone.

Things get a bit more interesting with $SCREENHIDE, because that simply
delays the execution of the GLUT initialization indefinitely until
_ScreenShow is done. This was previously very buggy since some commands
rely on FreeGLUT being up and will simply hang the entire program if
run. Other commands have logic to catch this and simply return zero.

The above issue is solved with the `NEEDS_GLUT()` and `OPTIONAL_GLUT()`
macros. Both of them simply check if the GLUT initialization has taken
place and exit the current function if it has not. The difference
between the two is that `NEEDS_GLUT()` throws an 'illegal function call'
error while `OPTIONAL_GLUT()` simply exits with no error. The choice of
behavior of each function was based upon its previous behavior - if it
checked `screen_hide` and exited with no error previously, then
`OPTIONAL_GLUT()` was used. If it deadlocked or similar then
`NEEDS_GLUT()` was used (so instead of deadlocking, it now produces an
error). In this way, programs can now never get stuck due to the use of
`$SCREENHIDE` and all the commands have consistent behavior that can be
relied upon.

Fixes: #234
2022-11-26 01:33:32 -05:00
Steve McNeill 15f0f86534
Merge pull request #254 from SteveMcNeill/main
Bugfix to _FONT
2022-11-25 05:03:33 -05:00
SteveMcNeill ca7d6ee289 fix comment
Whoops!  Not enough coffee, I guess.  ;)
2022-11-25 00:52:29 -05:00
SteveMcNeill 0d76a7bbed Simplify multi-line logic to single line. 2022-11-24 15:00:54 -05:00