🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

FPL - a single header file platform abstraction library

Started by
36 comments, last by Finalspace 6 years, 2 months ago

Update v0.4.0 alpha:

  • Changed: All FPL_ENABLE_ defines are internal now, the caller must use FPL_NO_ or FPL_YES_ respectivily.
  • Changed: AtomicCompareExchange is now AtomicCompareAndExchange
  • Changed: InitFlags::VideoOpenGL is now InitFlags::Video
  • Added: Software rendering support
  • Added: VideoDriverType enumeration for selecting the active video driver
  • Added: video::GetVideoBackBuffer with [Win32] implementation
  • Added: video::ResizeVideoBackBuffer with [Win32] implementation
  • Added: FPL_PETABYTES macro
  • Added: FPL_EXABYTES macro
  • Added: FPL_ZETTABYTES macro
  • Added: FPL_YOTTABYTES macro
  • Added: FPL_MIN macro
  • Added: FPL_MAX macro
  • Added: MutexCreate with [Win32] implementation
  • Added: MutexDestroy with [Win32] implementation
  • Added: MutexLock with [Win32] implementation
  • Added: MutexUnlock with [Win32] implementation
  • Added: SignalCreate with [Win32] implementation
  • Added: SignalDestroy with [Win32] implementation
  • Added: SignalWait with [Win32] implementation
  • Added: SignalWakeUp with [Win32] implementation
  • Added: GetClipboardAnsiText with [Win32] implementation
  • Added: GetClipboardWideText with [Win32] implementation
  • Added: SetClipboardText with [Win32] implementation for ansi and wide strings
  • Added [MSVC]: AtomicExchangeS32 (Signed integer)
  • Added [MSVC]: AtomicExchangeS64 (Signed integer)
  • Added [MSVC]: AtomicAddS32 (Signed integer)
  • Added [MSVC]: AtomicAddS64 (Signed integer)
  • Added [MSVC]: AtomicCompareExchangeS32 (Signed integer)
  • Added [MSVC]: AtomicCompareExchangeS64 (Signed integer)
  • Fixed [MSVC]: AtomicExchangeU32 was not using unsigned intrinsic
  • Fixed [MSVC]: AtomicExchangeU64 was not using unsigned intrinsic
  • Fixed [MSVC]: AtomicAddU32 was not using unsigned intrinsic
  • Fixed [MSVC]: AtomicAddU64 was not using unsigned intrinsic
  • Fixed [MSVC]: AtomicCompareExchangeU32 was not using unsigned intrinsic
  • Fixed [MSVC]: AtomicCompareExchangeU64 was not using unsigned intrinsic
  • Implemented [Win32]: GetProcessorCoreCount
  • Implemented [Win32]: Main thread infos
  • Performance [Win32]: GetProcessorName (3 loop iterations at max)

State:

Its almost feature complete for Win32, only audio output is missing.

Next i will clean up all the ifdef madness to get a more clean code structure - so i have a single ifdef block for each platform/backend. Also i am thinking about removing the sub namespaces, just because its so much useless typing for no reason.

Advertisement

Update v0.4.1 alpha:

  • Cleanup: Internal cleanup
  • Changed: All the settings constructors removed and replaced by a simple inline function.
  • Added: Added native C++ unit test project to demos solution
  • Fixed: FPL_OFFSETOF was not working
  • Fixed: All file size macros like FPL_MEGABYTES was returning invalid results.
  • Removed: FPL_PETABYTES and higher are removed, just because its useless.

State:

I cleaned up all the internals so i have a single block per platform and fixed some small bugs. Also i decided to continue with the subnamespace style - one nested level is fine. Next big thing will be audio output using directsound or xaudio and implementing the linux platform.

Is this a discussion about this repo of yours? https://github.com/f1nalspace/final_game_tech

Some small remarks:

  • You can create releases via Github (e.g. v0.4.1) which are just Git tags.
  • Why warning level W3 instead of W4?

🧙

7 minutes ago, matt77hias said:

Is this a discussion about this repo of yours? https://github.com/f1nalspace/final_game_tech

Some small remarks:

  • You can create releases via Github (e.g. v0.4.1) which are just Git tags.
  • Why warning level W3 instead of W4?

This thread is for annoncing new releases only, so its appreciated to create a seperate thread for discussions.

But thanks for the tip with the releases, i will try to do that. Seems i have forget about that entirely, since i am using another version control system at work...

What do you mean with warning level 3 instead of 4? (Visual Studio Project configuration?)

15 minutes ago, Finalspace said:

What do you mean with warning level 3 instead of 4? (Visual Studio Project configuration?)

Yes. (This is of course not an issue for your users, just noticed it in the Visual Studio files.)

16 minutes ago, Finalspace said:

This thread is for annoncing new releases only, so its appreciated to create a seperate thread for discussions.

My apologies. Didn't know.

🧙

Update v0.4.2 alpha:

  • Added: [Linux] Started linux implementation
  • Added: [Linux] Memory allocations
  • Added: [Linux] Atomic operations
  • Added: Check for C++/11 compiler and fail if not supported
  • Added: Nasty vstudio 2015+ workaround to detect C++/11
  • Added: &= operator overloading for enums
  • Changed: AtomicCompareAndExchange argument "comparand" and "exchange" flipped.
  • Changed: constexpr is now fpl_constant to make clear what is a constant
  • Removed: [Win32] CreateDIBSection is not needed for a software backbuffer
  • Fixed: [Win32] Software rendering was not working properly.
  • Fixed: Some AtomicCompareAndExchange signatures was still AtomicAndCompareExchange

State/Planned:

  • [Linux] Implement all non-window based functions
  • [Win32] Use dynamic library for all the things, so you simple just link to kernel32.lib and thats it
  • [Win32] DirectSound/XAudio2 audio output + api

Still unsure:

  • I dont like callers requiring C++/11 just for constexpr and enums, should i go back to C++ 1997/11?
  • I still dont like the nested namespaces, its just a couple of functions and types, one namespace is enough and this i could make optional if i want to. But i dont know...

Update v0.4.3 alpha (Big one):

  • New: Introduced IsAtomicCompareAndExchange
  • Added: [Linux] Implemented IsAtomicCompareAndExchange for all 32 and 64 bit integer types
  • Added: [Win32] Implemented IsAtomicCompareAndExchange for all 32 and 64 bit integer types
  • Added: [Win32] Loading gdi32.dll dynamically for ChoosePixelFormat, etc.
  • Added: [Win32] Loading opengl32.dll dynamically for wglGetProcAddress, wglMakeCurrent, etc.
  • Fixed: [Win32] Adding memory fence for AtomicReadWriteFence on non-x64 architectures
  • Fixed: [Win32] Adding memory fence for AtomicReadFence on non-x64 architectures
  • Fixed: [Win32] Adding memory fence for AtomicWriteFence on non-x64 architectures
  • Fixed: Solidified descriptions for all Atomic*Fence
  • Changed: Enabled FPL_FORCE_ASSERTIONS will ensure that C asserts are never used, because it may be compiled out.
  • Changed: Removed all FPL_WIN32_ kernel32 macros and replaced it with normal calls.
  • Changed: [Win32] Changed a lof ot the internals
     

State/Planned:

  • [Linux] Implement all non-window based functions
  • [Win32] Use dynamic library for all the things, so you simple just link to kernel32.lib and thats it (Partially done)
  • [Win32] DirectSound/XAudio2 audio output + api

Update v0.4.4 alpha:

  • New: [Win32] Implemented argument parsing for WinMain and wWinMain
  • Fixed: Corrected small things for doxygen
  • Changed: Renamed CopyAFile to FileCopy
  • Changed: Renamed DeleteAFile to FileDelete

Note:

Next update while take a while, because i want to get the linux implementation to the same level as the win32 implementation.

Update:
Finally i removed the requirement to link against user32.lib and shell32.lib - all the functions are dynamically loaded properly. But you still have to link against kernel32.lib thou for calling LoadLibrary.

Also i changed the command line parsing to use "CommandLineToArgvW" instead of my implementation and fixed some critical bugs in other parts.

Including to that i added a working ffmpeg demo which i plan to make a simple player out of it - for testing the entire library ;)

v0.4.7 alpha:

  • Changed: [Win32] Load all user32 and shell32 functions dynamically
  • Changed: FPL_ENUM_AS_FLAGS_OPERATORS_INTERNAL requires a int type as well
  • Fixed: MemoryAlignedAllocate and MemoryAlignedFree was broken
  • Added: FPL_IS_ALIGNED macro
     

v0.4.6 alpha:

  • Fixed: [Win32] Crash when window is not set in the InitFlags but FPL_USE_WINDOW is set.


v0.4.5 alpha:

  • Changed: [Win32] Use CommandLineToArgvW for command line parsing

Milestone Update!

I finally finished a huge milestone -> Audio playback! Hurray!
Also i extended the api a little bit and fixed some major bugs.
Now i can really start to focus on the next platform -> Linux X11/GLX/ALSA.

In addition i added a FFMPEG demo for testing out several features of the library, especially the multithreading and the audio system. At its current state the demo can already decode/render audio and video independently, including some caching of raw packets and decoded data. Works great, even though the ffmpeg api is a nightmare.

My main focus is get the ffmpeg to a usable state and then continue implementing the linux platform.

Also i decided to change the library a bit to not require C++/11 at all. Enum class and constexpr is nice, but there is no real reason to use that. So the next version will be C++/98 complaint.

See the full changelog for details.

Last important note:

The asyncronous audio playback system is a stripped port from "mini_al.h" -> A awesome single header file library written by David Reid. So if you need more audio features than fpl provides, i recommend using "mini_al.h" directly.

Here is the full changelists:

## v0.5.1 beta:
- New: audio::GetAudioNativeFormat()
- New: audio::SetAudioClientReadCallback()
- Fixed: InitFlags::Audio was never tested before InitAudio() was being called.
- Changed: Renamed ThreadStop to ThreadDestroy


## v0.5.0 beta:
- Added: [Win32] DirectSound playback support
- Added: Asyncronous audio playback

## v0.4.11 alpha:
- Fixed: [Win32] For now, load all user32 functions always, even when window is not used (This is to prepare for audio playback)
- Fixed: [Win32] ThreadStop was not releasing the thread handle
- Added: [Win32] ThreadWaitForAny
- Added: [Win32] SignalWaitForAll
- Added: [Win32] SignalWaitForAny
- Added: [Win32] SignalReset
- Added: FPL_NO_VIDEO
- Changed: ThreadWaitForSingle renamed to ThreadWaitForOne
- Changed: ThreadWaitForMultiple renamed to ThreadWaitForAll
- Changed: SignalWait renamed to SignalWaitForOne

## v0.4.10 alpha:
- Removed: Removed all _internal _INTERNAL postfixes from types, functions and macros
- Changed: Proper identitation for compiler directives based on context
- Added: [Win32] Dynamically loading ole32 functions (CoCreateInstance, CoInitializeEx, etc.)
- Fixed: [Win32] GetCursor was not using the dynamic loaded function
- Fixed: [Win32] Missing *Clipboard* dynamic functions

## v0.4.9 alpha:
- Removed: Removed all audio code for now
- Changed: A total cleanup of all internal stuff, so its much easier to add in new features

## v0.4.8 alpha:
- New: AtomicLoadU32, AtomicLoadU64, AtomicLoadS32, AtomicLoadS64, AtomicLoadPtr
- New: AtomicStoreU32, AtomicStoreU64, AtomicStoreS32, AtomicStoreS64, AtomicStorePtr
- New: AtomicExchangePtr, AtomicCompareAndExchangePtr, IsAtomicCompareAndExchangePtr
- New: [Win32] Implementation for AtomicLoadU32, AtomicLoadU64, AtomicLoadS32, AtomicLoadS64, AtomicLoadPtr
- New: [Win32] Implementation for AtomicStoreU32, AtomicStoreU64, AtomicStoreS32, AtomicStoreS64, AtomicStorePtr
- New: [Linux] Implementation for AtomicLoadU32, AtomicLoadU64, AtomicLoadS32, AtomicLoadS64, AtomicLoadPtr
- New: [Linux] Implementation for AtomicStoreU32, AtomicStoreU64, AtomicStoreS32, AtomicStoreS64, AtomicStorePtr
- New: [Win32] Loading of DirectSound (Prepare for audio output support)
- Draft: Added first audio output api
- Fixed: Threading context determination
- Fixed: [Win32] Fixed all thread implementations
- Fixed: [Win32] SetWindowLongPtrA does not exists on X86
- Fixed: [Win32] Missing call convention in SHGetFolderPathA and SHGetFolderPathW
- Changed: Improved header documentation (More examples, better descriptions, proper markdown syntax, etc.)
- Changed: All threading functions uses pointer instead of reference
- Changed: [Linux] Atomic* uses __sync instead of __atomic
- Changed: A bit of internal cleanup

This topic is closed to new replies.

Advertisement