burito / dpb

Files that have kept popping up in my projects. Consolidated here to ease managing them.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dpb

These files have been popping up in most of my projects, so this is the best way I can think of to consolidate them, to help prevent instances of me having differing versions of them across my projects. The "dpb" are my initials, in the vein of Sean Barrett's "stb" libraries, although I wouldn't claim these are anywhere near as polished as his work. Hopefully having them in one place like this may spur me on to change that. Something has changed, but not much.

library ver description
dpb_path.h 1.0 gets the correct path that a game should use to store saved games

Tests

gfx_null

Creates the window, with no graphics functionality at all. For testing the window creation & management. Handles input and fullscreen, in the platform appropriate way. All of the programs use this as the base.

  • Fullscreen
    • F11 on Windows & Linux
    • ⌃⌘F on Mac
  • Quitting
    • Alt+F4 on Windows (provided by OS)
    • ⌘Q on Mac
    • Does Linux have a standard quit keycombo?

gfx_gl

Initialises OpenGL, clears the window with Green, draws a blue square that is half the size of the window, and a red square around the mouse cursor.

path_test

Bare bones test of dpb_path.h.

OS Output
Windows 10 C:\Users\Username\Saved Games
Windows XP (32-bit) C:\Documents and Settings\Username\Application Data
Windows 98 + IE5 C:\WINDOWS\Application Data
Windows 95 + IE4.72 C:\WINDOWS\Application Data
Windows 3.11 This program cannot be run in DOS mode.
Mac OS X ~/Library/Application Support
Linux ~/.local/share

Yes, the version of Internet Explorer matters with Win9x. If you want to be clever and just paste this table into your program, remember that windows doesn't have to install to C:, nor does it have to install into the Windows Directory, all of this can be changed in the registry, and most strings are translated to the local language. It should also work on NT4+IE4, and all versions of windows that are newer.

Build Environment

Windows

pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-imagemagick mingw-w64-x86_64-clang mingw-w64-x86_64-clang-tools-extra mingw-w64-x86_64-glslang make vim man-pages-posix mingw-w64-x86_64-lldb --disable-download-timeout
  • Add the following to your path...
    • C:\msys64\mingw64\bin
    • C:\msys64\usr\bin

Linux

  • Install current GPU drivers and compiler
    • add-apt-repository ppa:graphics-drivers/ppa
    • apt-get update
    • apt-get install nvidia-410 vulkan-utils build-essential clang imagemagick libx11-dev libxi-dev

MacOS

  • Install XCode

Submodules / Credits

Thanks

For everything else, I am to blame.

About

Files that have kept popping up in my projects. Consolidated here to ease managing them.

License:zlib License


Languages

Language:C 96.3%Language:Makefile 3.3%Language:Objective-C 0.4%