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

352 commits

Author SHA1 Message Date
Matthew Kilgore cd5e312f5a Revert changes to miniaudio.h, move changes elsewhere
Changing midiaudio.h will make it harder to incorporate new versions
into QB64-PE as they come out. To fix that I have reverted all the
changes to midiaudio.h and moved the few private parts we were using
into a separate 'filepath' API that's part of libqb.
2022-09-08 23:59:19 -04:00
Matthew Kilgore 3e4477521a fix audio midi vtable linking 2022-09-04 23:35:14 -04:00
Matthew Kilgore 2b3403745c Add initial MIDI language support
This adds MIDI support to the language as a new unstable feature. There
are two new metacommands that come with this:

$Unstable: Midi
$MidiSoundFont: [Default|"filename"]

The $Unstable command is required to be able to use any of the other
commands, and just signifies that this is not a full part of the
language yet and may change in breaking ways before the API is
finalized.

The $MidiSoundFont command enables MIDI support in the compiled program,
and also specifies what sound font to use to play MIDI files. "Default"
will make use of the soundfont placed at
'./internal/support/default_soundfont.sf2', and otherwise a filename can
be specified to use any soundfont wanted.

In either case, the selected sound font is compiled into the executable
and then loaded at runtime.

Fixes: #115
2022-09-04 23:35:14 -04:00
Samuel Gomes d3854630cf Fix usage of mem_block type in _MEMSOUND 2022-09-04 05:16:41 +05:30
Matthew Kilgore f03b55808b Remove DPI Awareness on Windows
DPI Awareness allows a program to tell Windows that it will handle
properly scaling itself for the screen's DPI. Thus when a program is DPI
Aware, it will always see the actual screen size. When a program is not
DPI Aware, then Windows will scale the program according to the
selection by the user, and the reported screen size will match the
scaled size rather than the actual screen size.

Commit 189cdb8e added logic to enable DPI Awareness on Windows, but it
was hidden behind a `WINVER` check. This meant it was not actually in
use because at the time QB64 did not set a `WINVER` high enough to
actually enable that code. As such all Windows versions of QB64
including v2.0.2 were not DPI Aware.

Much later-on, Commit 869e361e declared a `_WIN32_WINNT` of `0x0600`,
which seems to have also declared `WINVER` as the same and thus enabled
the DPI Awareness logic. As a consequence, QB64-PE programs no longer
get scaled even though they don't have a way to acquire the current DPI
to do proper scaling themselves.

Since the behavior change was unintentional and proper language support
is not there, we're considering the addition of DPI Awareness a bug. It
will be added back some time later with more language support to allow
it to be properly used.
2022-09-02 23:50:23 -04:00
Samuel Gomes f99eb27717 Remove all _SHR & _SHL changes 2022-09-01 16:15:42 +05:30
Samuel Gomes 5812433b9d Added limits.h to common.h 2022-09-01 07:25:01 +05:30
Samuel Gomes 2ed17f6198 Add _ROR & _ROL support. Fix issues with _SHR & _SHL 2022-09-01 06:51:06 +05:30
Matthew Kilgore 30c0634d20 Fix High-DPI awareness on Windows
We started defining `_WIN32_WINNT` a little while ago to express that we
require Windows Vista or above for support. This enables us to access
some Windows Vista-only APIs. The fact that `WINVER` also needs to be
defined was missed, and it seems that defining one means the other no
longer gets defined automatically as it did before. Thus we're simplying
now also defining `WINVER` the same as `_WIN32_WINNT`.

This fixes High-DPI awareness and a few other things that were gated
behind WINVER checks.
2022-08-28 21:44:07 -04:00
Samuel Gomes 26391445ee Updated comments 2022-08-28 02:16:56 -04:00
Samuel Gomes 124251f8f8 Fixed Linux compile issue - extra space in #include. Doh! 2022-08-28 02:16:56 -04:00
Samuel Gomes 9ed193346a Update QB64-PE image library to convert images to 8bpp 2022-08-28 02:16:56 -04:00
Samuel Gomes d3da6da2fa Simplified image library. Added PCX support using dr_pcx 2022-08-28 02:16:56 -04:00
Matthew Kilgore c989be69f6 Disable MIDI support
This will be added back soon with with functionality to be able to
optionally enable it.
2022-08-27 14:27:55 -04:00
Matthew Kilgore 48208e2eda Change miniaudio build logic to always clean all files 2022-08-27 14:27:55 -04:00
Matthew Kilgore 41cc1e6569 Integrate the miniaudio backend into the build
This integrates the miniaudio backend, using a new `DEP_AUDIO_MINIAUDIO`
flag to enable it. This will allow consumers to choose which backend to
use.
2022-08-27 14:27:55 -04:00
Matthew Kilgore 481906977e Add a740g's miniaudio backend
This is a single commit adding all of a740g's audio backend. Later
commits will connect it together with QB64PE itself.
2022-08-27 14:27:55 -04:00
Roland Heyder 2ec897b75d Step 10: Update remaining stuff
- checks all remaining occurrences of the term 'qb64', some remain untouched, some are renamed according to context
- also added new logo for README.md
- this step does finalize the 'Phoenix Edition' re-branding
2022-08-12 02:54:12 +02:00
Roland Heyder e68582b6f2 Step 7: Rename qb64.exe to qb64pe.exe
- Includes related LNX/OSX files
- Excludes mentions in the help (*.txt) files
2022-08-11 18:07:57 +02:00
Roland Heyder 96fc1eb3a9 Step 5: Update embedded images in libqb.cpp
- replaced default icon image data, which is used, if _ICON is used w/o parameter, but no $EXEICON is specified either (see also Step 1)
- this step completes icon related changes
2022-08-10 20:02:00 +02:00
Matthew Kilgore 94c2b56b69 Use mutex guard in completion implementation 2022-06-14 23:58:04 -04:00
Matthew Kilgore 298331e490 posix mutex shouldn't allow NULL
We shouldn't allow mutex lock/unlock to silently do nothing if NULL is
passed, as that is very likely a bug. Beyond that the Windows version
doesn't do this, so it's inconsistent as well.
2022-06-14 23:56:17 -04:00
Matthew Kilgore 869e361ee4 Move QB64 compiler settings to libqb-common.h
This moves a lot of the preprocessor flags for what compiler/platform
we're using into a libqb-common.h header inside the libqb/include
folder. This gets included at the top of every libqb .cpp file, and is
intended to be fairly small, providing only necessary things like
_WIN32_WINNT (which needs to be defined before including <windows.h> or
friends).
2022-06-12 00:28:16 -04:00
Matthew Kilgore cde7afef30 Use libqb_mutex in libqb.cpp
libqb_mutex can replace the existing Mutex handling we do in libqb.cpp
2022-06-11 22:47:06 -04:00
Matthew Kilgore 4052b8cc19 Add append-only buffer API
The Buffer API implements an append-only buffer, where you can write to
the end or read from the beginning. Data that is read is discarded from
the buffer, and you can query the buffer to get the current amount of
data inside.

Internally the buffer API is implemented as a chain of separate buffers.
This is done to avoid having to resize the existing buffer, which is
expensive. We keep track of where the reading currently is, and discard
the internal buffers after all the data in them is read.
2022-06-11 22:47:06 -04:00
Matthew Kilgore ecfc71ef95 Add completion API
Completions are basically a oneshot flag, which provide a `wait()` call
that blocks until 'finish()' has been called on the completion.

The nice aspect of completions is that because it is a oneshot the order
does not matter - if 'finish()' is called before 'wait()' then 'wait()'
returns immediately. It makes the logic for waiting until a thread is
done finishing up some work easy to implement.
2022-06-11 22:47:06 -04:00
Matthew Kilgore 7ef15653fd Add generic thread, mutex, and condvar API
This adds generic APIs to libqb for handling thread's, mutex's, and
condition variables. On Linux and OSX these are implemented via the ones
provided by pthreads. On Windows they're implemented via the ones
provided by the Win32 API.

For compiling, the code itself is not conditional, but the Makefile
includes logic to decide which implementation to pick.

Note that it would have been nice to simply use std::thread and friends
from C++11, however using them on MinGW appears to be a bit messy. Since
using the Windows ones directly isn't that hard this was an easy compromise.
2022-06-11 22:47:06 -04:00
Matthew Kilgore eb815c4220 Prepare for separate libqb, define C++ standard
This sets up a few different flags we'll need for the conditional
compiling, and also sets the C++ standard to gnu++11, which effectively
just matches what we were implicitly using before.
2022-06-11 22:47:05 -04:00
Matthew Kilgore 76c437288a Remove leftover build file 2022-06-11 20:42:23 -04:00
Matthew Kilgore f99407f251 Revert existing libqb split 2022-06-11 20:42:23 -04:00
Matthew Kilgore 62ec4ebdbd Fix compilation with DEP_DEVICEINPUT
The Makefile changes broke compiling with device input support. This got
missed because no test case for DEP_DEVICEINPUT got added.

Fixes: #100
2022-06-09 21:30:37 -04:00
Matthew Kilgore 437cfc3ab7 Remove old build system
Mostly old build scripts and helper files that are now covered by the
Makefile.

A notable deletion is the glew dll and lib files. These are unnecessary
because we compile `glew.c` directly rather than link against the dll or
lib copies we have.
2022-05-19 09:17:13 -04:00
Matthew Kilgore e0ef818522 Change purge scripts to use make clean 2022-05-19 09:17:13 -04:00
SteveMcNeill ecfa18a109 change numerics to more descriptive constants 2022-05-17 05:04:41 -04:00
SteveMcNeill 8574c1f921 Change to _screenwidth and _screenheight
Having windows call GetSystemMetrics without relying on glutGet, gets rid of the seg fault that can occur at program start up.  screenicon was restored to it's previous state so that larger issues with it can be addressed at a future date.
2022-05-16 11:37:58 -04:00
SteveMcNeill acbeca81b9 Fix to _desktopwidth, _desktopheight, _screenicon
Fixes the issue as brought up on the forums here: https://qb64phoenix.com/forum/showthread.php?tid=408

Also added a small set of logic so we don't end up inside an endless loop if the screen is hidden (via _SCREENHIDE), or if it doesn't exist for whatever reason.
2022-05-16 07:55:08 -04:00
Matthew Kilgore 7a5ca0c49c Cleanup unused Makefile stuff 2022-05-14 12:13:00 -04:00
Matthew Kilgore 5c4dcdc8aa Use dlfcn.h on OSX 2022-05-12 00:21:02 -04:00
Matthew Kilgore c1639b3979 Add basic make build system 2022-05-12 00:21:02 -04:00
Matthew Kilgore fcec53e55b Fix text wrapping on last column with variable width fonts
Currently there is a bug where if a variable width font is in use and
text printed would exactly fit to the end of the row, it is instead
wrapped and printed on the next line.

Ex. You're printing a character that is 10 pixels wide, starting
from position 90 on an image that is 100 pixels wide. This should fix,
but instead your character will be printed on the next line.

The reason this happens is an off by one error, cursor_x (effectively
the X value passed to LOCATE) is one based even when using a variable
width font where cursor_x represents a pixel location. The location that
check if the next character can fit on the screen never handles the base
one, so it ends up treating the ending Y coordinate as one past where it
will actually end, which makes the code thing the print will go past the
edge of the screen.

To fix we simply subtract one before doing the comparison to give us the
actual ending pixel column.
2022-05-06 17:50:07 -04:00
Matthew Kilgore 55da5f4ce3 Format other various source files 2022-05-06 13:20:30 -04:00
Matthew Kilgore 1aa8d7a42f Run clang-format on ./internal/c/*cpp files 2022-05-06 13:20:30 -04:00
SteveMcNeill 50eb90f885 Update LodePNG library
from 2012 version to 2022 version, which has been quite improved and sped up.
2022-05-03 02:33:45 -04:00
Matthew Kilgore 77aced1b1c Rewrite distribution logic, download mingw*.exe 2022-04-28 17:21:56 -04:00
Matthew Kilgore 9315646e76 setup_win.bat: create internal/c/c_compiler
internal/c/c_compiler no longer contains anything, so git will not
create it. This change makes setup_win.bat create the directory if it's
not already there.
2022-04-28 17:15:35 -04:00
Matthew Kilgore 97240a0b46 Add standalone mingw32 and mingw64 installers 2022-04-28 13:43:09 -04:00
Matthew Kilgore fbc580c9c5 Delete Mingw32 and Mingw64 2022-04-28 13:42:59 -04:00
phillvancejr 8f0c08e2ec Added global scope operator :: to the socket bind call to prevent clashes with <functional> std::bind in some builds 2021-11-01 10:21:16 -04:00
Roland Heyder c48bf6776e Fixed LOC function for files
Will correctly return zero (0) now for just opened but yet untouched files.
2021-10-22 23:51:48 +02:00
Fellippe Heitor 0fac593dd6 Update libqb.cpp to allow manual compilation in WinXP
Oh, well... there's still life for XP.
2021-10-17 03:56:54 -03:00