Gamp v0.0.7-36-g24b1eb6
Gamp: Graphics, Audio, Multimedia and Processing
Loading...
Searching...
No Matches
Gamp Root

Graphics, Audio, Multimedia and Processing Framework. More...

Classes

struct  gamp::Attachable
 An attachable object. More...
 
class  gamp::GampEnv
 Singleton runtime environment properties. More...
 
class  gamp::GampException
 
class  gamp::StringHashMapWrap< Value_type, Novalue_type, no_value >
 

Typedefs

typedef std::shared_ptr< Attachablegamp::AttachableRef
 
typedef uintptr_t gamp::handle_t
 A native handle type, big enough to store a pointer.
 
using gamp::StringAttachables = StringHashMapWrap<AttachableRef, std::nullptr_t, nullptr>
 
template<typename K, typename V>
using gamp::StringlikeHashMap = std::unordered_map<K, V, jau::string_hash, std::equal_to<>>
 

Functions

std::string gamp::asset_dir () noexcept
 
template<typename T, typename U>
gamp::castOrThrow (T has)
 
template<typename T, typename U>
bool gamp::checkOverflow (T has)
 
int gamp::expected_fps () noexcept
 Returns expected fps, either gpu_forced_fps() if set, otherwise monitor_fps().
 
jau::fraction_timespec gamp::expected_framedur () noexcept
 Returns the expected frame duration in [s], i.e.
 
jau::fraction_timespec gamp::getElapsedMonotonicTime () noexcept
 Returns the elapsed monotonic time since init_gfx_subsystem, synchronized with the gfx subsystem timer.
 
float gamp::gpu_avg_fps () noexcept
 Returns the measured gpu fps each 5s, starting with monitor_fps()
 
const jau::fraction_timespecgamp::gpu_avg_framedur () noexcept
 Returns the measured gpu frame duration in [s] each 5s, starting with 1/gpu_avg_fps()
 
int gamp::gpu_forced_fps () noexcept
 Returns optional forced frames per seconds or -1 if unset, set via set_gpu_forced_fps().
 
size_t gamp::handle_events () noexcept
 GFX Toolkit: Handle windowing and keyboard events.
 
bool gamp::init_gfx_subsystem (const char *exe_path)
 GFX Toolkit: Initialize the subsystem once.
 
bool gamp::is_gfx_subsystem_initialized () noexcept
 
std::string gamp::lookup_and_register_asset_dir (const char *exe_path, const char *asset_file="fonts/freefont/FreeSansBold.ttf", const char *asset_install_subdir="gamp") noexcept
 
bool gamp::mainloop_default () noexcept
 Performs the whole tasks for all created gamp::wt::Window instances.
 
void gamp::mainloop_void () noexcept
 Calls mainloop_default(), but exits application if returning false.
 
int gamp::monitor_fps () noexcept
 Monitor frames per seconds.
 
std::string gamp::resolve_asset (const std::string &asset_file, bool lookup_direct=false) noexcept
 
void gamp::set_gpu_forced_fps (int fps) noexcept
 Optional forced frames per seconds, pass to swap_gpu_buffer() by default.
 
void gamp::shutdown () noexcept
 
void gamp::swap_gpu_buffer (int fps) noexcept
 GFX Toolkit: Swap GPU back to front framebuffer of all windows using given fps, maintaining vertical monitor synchronization if possible.
 
template<typename T, typename U>
void gamp::throwOnOverflow (T has)
 

Variables

const jau::util::VersionNumberString gamp::VERSION
 
const char * gamp::VERSION_API
 
const char * gamp::VERSION_SHORT
 

Detailed Description

Graphics, Audio, Multimedia and Processing Framework.

Typedef Documentation

◆ handle_t

typedef uintptr_t gamp::handle_t

A native handle type, big enough to store a pointer.

Definition at line 47 of file GampTypes.hpp.

◆ AttachableRef

typedef std::shared_ptr<Attachable> gamp::AttachableRef

Definition at line 79 of file GampTypes.hpp.

◆ StringlikeHashMap

template<typename K, typename V>
using gamp::StringlikeHashMap = std::unordered_map<K, V, jau::string_hash, std::equal_to<>>

Definition at line 82 of file GampTypes.hpp.

◆ StringAttachables

using gamp::StringAttachables = StringHashMapWrap<AttachableRef, std::nullptr_t, nullptr>

Definition at line 147 of file GampTypes.hpp.

Function Documentation

◆ lookup_and_register_asset_dir()

std::string gamp::lookup_and_register_asset_dir ( const char * exe_path,
const char * asset_file = "fonts/freefont/FreeSansBold.ttf",
const char * asset_install_subdir = "gamp" )
noexcept

Definition at line 31 of file gamp.cpp.

Here is the caller graph for this function:

◆ asset_dir()

std::string gamp::asset_dir ( )
noexcept

Definition at line 35 of file gamp.cpp.

◆ resolve_asset()

std::string gamp::resolve_asset ( const std::string & asset_file,
bool lookup_direct = false )
noexcept

Definition at line 37 of file gamp.cpp.

Here is the caller graph for this function:

◆ getElapsedMonotonicTime()

jau::fraction_timespec gamp::getElapsedMonotonicTime ( )
noexcept

Returns the elapsed monotonic time since init_gfx_subsystem, synchronized with the gfx subsystem timer.

Definition at line 142 of file gamp_sdl2.cpp.

Here is the caller graph for this function:

◆ monitor_fps()

int gamp::monitor_fps ( )
noexcept

Monitor frames per seconds.

Definition at line 82 of file gamp_sdl2.cpp.

Here is the caller graph for this function:

◆ gpu_forced_fps()

int gamp::gpu_forced_fps ( )
noexcept

Returns optional forced frames per seconds or -1 if unset, set via set_gpu_forced_fps().

Passed to swap_gpu_buffer() by default.

Definition at line 84 of file gamp_sdl2.cpp.

Here is the caller graph for this function:

◆ set_gpu_forced_fps()

void gamp::set_gpu_forced_fps ( int fps)
noexcept

Optional forced frames per seconds, pass to swap_gpu_buffer() by default.

Definition at line 86 of file gamp_sdl2.cpp.

Here is the caller graph for this function:

◆ expected_fps()

int gamp::expected_fps ( )
inlinenoexcept

Returns expected fps, either gpu_forced_fps() if set, otherwise monitor_fps().

Definition at line 59 of file Gamp.hpp.

Here is the caller graph for this function:

◆ expected_framedur()

jau::fraction_timespec gamp::expected_framedur ( )
inlinenoexcept

Returns the expected frame duration in [s], i.e.

1/expected_fps()

Definition at line 61 of file Gamp.hpp.

◆ is_gfx_subsystem_initialized()

bool gamp::is_gfx_subsystem_initialized ( )
noexcept

Definition at line 146 of file gamp_sdl2.cpp.

Here is the caller graph for this function:

◆ init_gfx_subsystem()

bool gamp::init_gfx_subsystem ( const char * exe_path)

GFX Toolkit: Initialize the subsystem once.

Definition at line 150 of file gamp_sdl2.cpp.

Here is the caller graph for this function:

◆ swap_gpu_buffer()

void gamp::swap_gpu_buffer ( int fps)
noexcept

GFX Toolkit: Swap GPU back to front framebuffer of all windows using given fps, maintaining vertical monitor synchronization if possible.

fps <= 0 implies automatic fps.

Should not be called by user, instead use mainloop_default().

Parameters
fpsuse gpu_forced_fps()
See also
mainloop_default()

Definition at line 357 of file gamp_sdl2.cpp.

◆ gpu_avg_fps()

float gamp::gpu_avg_fps ( )
noexcept

Returns the measured gpu fps each 5s, starting with monitor_fps()

Definition at line 361 of file gamp_sdl2.cpp.

◆ gpu_avg_framedur()

const jau::fraction_timespec & gamp::gpu_avg_framedur ( )
noexcept

Returns the measured gpu frame duration in [s] each 5s, starting with 1/gpu_avg_fps()

Definition at line 365 of file gamp_sdl2.cpp.

◆ mainloop_default()

bool gamp::mainloop_default ( )
noexcept

Performs the whole tasks for all created gamp::wt::Window instances.

Returns
true signaling continuation, false to end the mainloop
See also
swap_gpu_buffer()

Definition at line 692 of file gamp_sdl2.cpp.

Here is the caller graph for this function:

◆ mainloop_void()

void gamp::mainloop_void ( )
noexcept

Calls mainloop_default(), but exits application if returning false.

Definition at line 713 of file gamp_sdl2.cpp.

Here is the caller graph for this function:

◆ shutdown()

void gamp::shutdown ( )
noexcept

Definition at line 724 of file gamp_sdl2.cpp.

◆ handle_events()

size_t gamp::handle_events ( )
noexcept

GFX Toolkit: Handle windowing and keyboard events.

Should be called until function returns false to process all buffered events.

Returns
number of events received

Definition at line 555 of file gamp_sdl2.cpp.

Here is the caller graph for this function:

◆ checkOverflow()

template<typename T, typename U>
bool gamp::checkOverflow ( T has)
inline

Definition at line 60 of file GampTypes.hpp.

◆ throwOnOverflow()

template<typename T, typename U>
void gamp::throwOnOverflow ( T has)
inline

Definition at line 64 of file GampTypes.hpp.

Here is the caller graph for this function:

◆ castOrThrow()

template<typename T, typename U>
U gamp::castOrThrow ( T has)
inline

Definition at line 70 of file GampTypes.hpp.

Here is the caller graph for this function:

Variable Documentation

◆ VERSION

const jau::util::VersionNumberString gamp::VERSION
extern

◆ VERSION_SHORT

const char* gamp::VERSION_SHORT
extern

◆ VERSION_API

const char* gamp::VERSION_API
extern