naev 0.12.6
naev.h File Reference

Header file with generic functions and naev-specifics. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define APPNAME   "Naev"
#define ABS(x)
#define FABS(x)
#define MAX(x, y)
#define MIN(x, y)
#define CLAMP(a, b, x)
#define SIGN(x)
#define FSIGN(x)
#define pow2(x)
#define PATH_MAX   256
#define STRMAX   4096
#define STRMAX_SHORT   1024
#define DOUBLE_TOL   1e-6

Functions

void fps_setPos (double x, double y)
 Sets the position to display the FPS.
void fps_display (double dt)
 Displays FPS on the screen.
double fps_current (void)
 Gets the current FPS.
void naev_resize (void)
 Wrapper for gl_resize that handles non-GL reinitialization.
void naev_toggleFullscreen (void)
void update_routine (double dt, int dohooks)
 Actually runs the updates.
const char * naev_version (int long_version)
 Returns the version in a human readable string.
int naev_versionCompare (const char *version)
 Compares the version against the current naev version.
int naev_versionCompareTarget (const char *version, const char *target)
 Does a comparison with a specific target.
void naev_quit (void)
 Flags naev to quit.
int naev_isQuit (void)
 Get if Naev is trying to quit.
double naev_getrealdt (void)
 Gets the last delta-tick.
int naev_shouldRenderLoadscreen (void)
 Whether or not we want to render the loadscreen.
void naev_doRenderLoadscreen (void)
void naev_renderLoadscreen (void)
 Renders the loadscreen if necessary.

Variables

Uint32 SDL_LOOPDONE
const double fps_min
double elapsed_time_mod

Detailed Description

Header file with generic functions and naev-specifics.

Definition in file naev.h.

Macro Definition Documentation

◆ ABS

#define ABS ( x)
Value:
( ( ( x ) < 0 ) ? -( x ) : ( x ) )

Returns absolute value.

Definition at line 32 of file naev.h.

◆ APPNAME

#define APPNAME   "Naev"

Application name.

Definition at line 30 of file naev.h.

◆ CLAMP

#define CLAMP ( a,
b,
x )
Value:
( ( x ) < ( a ) \
? ( a ) \
: ( ( x ) > ( b ) \
? ( b ) \
: ( x ) ) )

Clamps x between a and b: a <= x <= b.

Definition at line 41 of file naev.h.

◆ DOUBLE_TOL

#define DOUBLE_TOL   1e-6

Definition at line 64 of file naev.h.

◆ FABS

#define FABS ( x)
Value:
( ( ( x ) < 0. ) ? -( x ) : ( x ) )

Returns float absolute value.

Definition at line 34 of file naev.h.

◆ FSIGN

#define FSIGN ( x)
Value:
( ( ( x ) > 0. ) ? 1. : -1. )

Returns the sign of a value.

Definition at line 50 of file naev.h.

◆ MAX

#define MAX ( x,
y )
Value:
( ( ( x ) > ( y ) ) ? ( x ) : ( y ) )

Returns maximum.

Definition at line 37 of file naev.h.

◆ MIN

#define MIN ( x,
y )
Value:
( ( ( x ) > ( y ) ) ? ( y ) : ( x ) )

Returns minimum.

Definition at line 39 of file naev.h.

◆ PATH_MAX

#define PATH_MAX   256

If not already defined.

Definition at line 57 of file naev.h.

◆ pow2

#define pow2 ( x)
Value:
( ( x ) * ( x ) )

^2

Definition at line 53 of file naev.h.

◆ SIGN

#define SIGN ( x)
Value:
( ( ( x ) > 0 ) ? 1 : -1 )

Returns the sign of a value.

Definition at line 48 of file naev.h.

◆ STRMAX

#define STRMAX   4096

Definition at line 61 of file naev.h.

◆ STRMAX_SHORT

#define STRMAX_SHORT   1024

Definition at line 62 of file naev.h.

Function Documentation

◆ fps_current()

double fps_current ( void )

Gets the current FPS.

Returns
Current FPS as displayed to the player.

Definition at line 995 of file naev.c.

◆ fps_display()

void fps_display ( double dt)

Displays FPS on the screen.

Parameters
[in]dtCurrent delta tick.

Definition at line 955 of file naev.c.

◆ fps_setPos()

void fps_setPos ( double x,
double y )

Sets the position to display the FPS.

Definition at line 944 of file naev.c.

◆ naev_doRenderLoadscreen()

void naev_doRenderLoadscreen ( void )

Definition at line 610 of file naev.c.

◆ naev_getrealdt()

double naev_getrealdt ( void )

Gets the last delta-tick.

Definition at line 1230 of file naev.c.

◆ naev_isQuit()

int naev_isQuit ( void )

Get if Naev is trying to quit.

Definition at line 153 of file naev.c.

◆ naev_quit()

void naev_quit ( void )

Flags naev to quit.

Definition at line 145 of file naev.c.

◆ naev_renderLoadscreen()

void naev_renderLoadscreen ( void )

Renders the loadscreen if necessary.

Definition at line 640 of file naev.c.

◆ naev_resize()

void naev_resize ( void )

Wrapper for gl_resize that handles non-GL reinitialization.

Definition at line 874 of file naev.c.

◆ naev_shouldRenderLoadscreen()

int naev_shouldRenderLoadscreen ( void )

Whether or not we want to render the loadscreen.

Definition at line 596 of file naev.c.

◆ naev_toggleFullscreen()

void naev_toggleFullscreen ( void )

Definition at line 928 of file naev.c.

◆ naev_version()

const char * naev_version ( int long_version)

Returns the version in a human readable string.

Parameters
long_versionReturns the long version if it's long.
Returns
The human readable version string.

Definition at line 27 of file naev_version.c.

◆ naev_versionCompare()

int naev_versionCompare ( const char * version)

Compares the version against the current naev version.

Returns
positive if version is newer or negative if version is older.

Definition at line 1151 of file naev.c.

◆ naev_versionCompareTarget()

int naev_versionCompareTarget ( const char * version,
const char * target )

Does a comparison with a specific target.

Definition at line 1175 of file naev.c.

◆ update_routine()

void update_routine ( double dt,
int dohooks )

Actually runs the updates.

Parameters
[in]dtCurrent delta tick.
[in]dohooksWhether or not we want to do hooks, such as the initial update upon entering a system.

Definition at line 1056 of file naev.c.

Variable Documentation

◆ elapsed_time_mod

double elapsed_time_mod
extern

Elapsed modified time.

Definition at line 117 of file naev.c.

◆ fps_min

const double fps_min
extern

New collisions allow larger fps_min.

Definition at line 116 of file naev.c.

◆ SDL_LOOPDONE

Uint32 SDL_LOOPDONE
extern

For custom event to exit loops.

Definition at line 99 of file naev.c.