FPLBase
An open source project by FPL.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
fplbase Namespace Reference

Namespace for FPLBase library. More...

Classes

class  Asset
 Base class of all assets that may be managed by Assetmanager. More...
 
class  FileAsset
 A generic asset whose contents the AssetManager doesn't care about. More...
 
class  AssetManager
 Central place to own game assets loaded from disk. More...
 
class  AsyncAsset
 
class  AsyncLoader
 Handles loading AsyncAsset objects. More...
 
struct  EnvironmentHandles
 
class  Environment
 
class  Button
 Used to record state for fingers, mousebuttons, keys and gamepad buttons. More...
 
class  InputPointer
 Stores information about the current and recent state of a pointer. More...
 
class  Joystick
 Represents the state of a Joystick. More...
 
class  Gamepad
 Represents the state of a connected gamepad. More...
 
struct  AndroidInputEvent
 Structure used for storing gamepad events when we get them from jni until we can handle them. More...
 
struct  TextInputEventEdit
 An event parameter for a text edit in IME (Input Method Editor). The information passed in the event is an intermediate state and only used for UI represents. Once IME finalizes an edit, the user recieves an TextInputEventText event for the finalized strings. More...
 
struct  TextInputEventKey
 An event parameter for a keyboard input. More...
 
struct  TextInputEvent
 Holds text input events. More...
 
class  InputSystem
 Use to handle time, touch/mouse/keyboard/etc input, and lifecyle events. More...
 
struct  AlphaTestState
 
struct  BlendState
 
struct  CullState
 
struct  DepthState
 
struct  StencilFunction
 
struct  StencilOperation
 
struct  StencilState
 
struct  ScissorState
 
struct  RenderState
 
union  HandleUnionGl
 
class  Material
 Collections of textures used for rendering multi-texture models. More...
 
class  Mesh
 Abstraction for a set of indices, used for rendering. More...
 
class  RenderTarget
 Abstracts a surface that can be rendered to. More...
 
class  RendererBase
 Manages the rendering system, handling the window and resources. More...
 
class  Renderer
 Renderer is the main API class for rendering commands. More...
 
struct  HeadMountedDisplayViewSettings
 Dimensions and transforms for viewport when using stereoscopic rendering. More...
 
class  Shader
 Represents a shader consisting of a vertex and pixel shader. More...
 
class  Texture
 Abstraction for a texture object loaded on the GPU. More...
 
class  TextureAtlas
 Texture coordinate dictionary. More...
 
struct  HighPerformanceParams
 HighPerformanceParams are used on Android to configure simulated key presses, in order to stop the CPU governor (see https://www.kernel.org/doc/Documentation/cpu-freq/governors.txt) from reducing the CPU frequency when a user is not providing tactile input. More...
 

Typedefs

typedef void * Thread
 
typedef void * Mutex
 
typedef void * Semaphore
 
typedef internal::OpaqueHandle TextureHandle
 Backend agnostic handles to various resources. More...
 
typedef internal::OpaqueHandle TextureTarget
 
typedef internal::OpaqueHandle ShaderHandle
 
typedef internal::OpaqueHandle UniformHandle
 
typedef internal::OpaqueHandle BufferHandle
 
typedef internal::OpaqueHandle DeviceMemoryHandle
 
typedef uint64_t FingerId
 
typedef void * JoystickData
 
typedef uint64_t JoystickId
 
typedef void * Event
 
typedef void * TouchFingerEvent
 
typedef int AndroidInputDeviceId
 
typedef int32_t FPL_Keycode
 
typedef uint32_t StencilMask
 Specifies the type for the Stencil Mask.
 
typedef mathfu::recti Viewport
 Specifies the region of the surface to be used for rendering.
 
typedef std::function< Texture
*(const char *filename,
TextureFormat format,
TextureFlags flags)> 
TextureLoaderFn
 used by some functions to allow the texture loading mechanism to be specified by the caller.
 
typedef std::function< bool(const
char *filename, std::string
*dest)> 
LoadFileFunction
 Called by LoadFile().
 
typedef void(* VsyncCallback )(void)
 Used for Android to represent a Vsync callback function.
 

Enumerations

enum  FeatureLevel { kFeatureLevel20, kFeatureLevel30 }
 
enum  WindowMode { kWindowModeWindowedNative, kWindowModeWindowedScaled, kWindowModeFullscreenNative, kWindowModeFullscreenScaled }
 
enum  {
  K_POINTER1 = -10, K_POINTER2, K_POINTER3, K_POINTER4,
  K_POINTER5, K_POINTER6, K_POINTER7, K_POINTER8,
  K_POINTER9, K_POINTER10, K_PAD_UP = -20, K_PAD_DOWN,
  K_PAD_LEFT, K_PAD_RIGHT, K_PAD_A, K_PAD_B
}
 
enum  TextInputEventType { kTextInputEventTypeEdit = 0, kTextInputEventTypeText = 1, kTextInputEventTypeKey = 2 }
 
enum  RenderFunction {
  kRenderAlways, kRenderEqual, kRenderGreater, kRenderGreaterEqual,
  kRenderLess, kRenderLessEqual, kRenderNever, kRenderNotEqual,
  kRenderCount
}
 
enum  {
  FPLK_UNKNOWN = 0, FPLK_RETURN = '\r', FPLK_ESCAPE = '\033', FPLK_BACKSPACE = '\b',
  FPLK_TAB = '\t', FPLK_SPACE = ' ', FPLK_EXCLAIM = '!', FPLK_QUOTEDBL = '"',
  FPLK_HASH = '#', FPLK_PERCENT = '', FPLK_DOLLAR = '$', FPLK_AMPERSAND = '&',
  FPLK_QUOTE = '\'', FPLK_LEFTPAREN = '(', FPLK_RIGHTPAREN = ')', FPLK_ASTERISK = '*',
  FPLK_PLUS = '+', FPLK_COMMA = ',', FPLK_MINUS = '-', FPLK_PERIOD = '.',
  FPLK_SLASH = '/', FPLK_0 = '0', FPLK_1 = '1', FPLK_2 = '2',
  FPLK_3 = '3', FPLK_4 = '4', FPLK_5 = '5', FPLK_6 = '6',
  FPLK_7 = '7', FPLK_8 = '8', FPLK_9 = '9', FPLK_COLON = ':',
  FPLK_SEMICOLON = ';', FPLK_LESS = '<', FPLK_EQUALS = '=', FPLK_GREATER = '>',
  FPLK_QUESTION = '?', FPLK_AT = '@', FPLK_LEFTBRACKET = '[', FPLK_BACKSLASH = '\\',
  FPLK_RIGHTBRACKET = ']', FPLK_CARET = '^', FPLK_UNDERSCORE = '_', FPLK_BACKQUOTE = '`',
  FPLK_a = 'a', FPLK_b = 'b', FPLK_c = 'c', FPLK_d = 'd',
  FPLK_e = 'e', FPLK_f = 'f', FPLK_g = 'g', FPLK_h = 'h',
  FPLK_i = 'i', FPLK_j = 'j', FPLK_k = 'k', FPLK_l = 'l',
  FPLK_m = 'm', FPLK_n = 'n', FPLK_o = 'o', FPLK_p = 'p',
  FPLK_q = 'q', FPLK_r = 'r', FPLK_s = 's', FPLK_t = 't',
  FPLK_u = 'u', FPLK_v = 'v', FPLK_w = 'w', FPLK_x = 'x',
  FPLK_y = 'y', FPLK_z = 'z', FPLK_CAPSLOCK = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_CAPSLOCK), FPLK_F1 = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_F1),
  FPLK_F2 = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_F2), FPLK_F3 = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_F3), FPLK_F4 = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_F4), FPLK_F5 = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_F5),
  FPLK_F6 = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_F6), FPLK_F7 = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_F7), FPLK_F8 = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_F8), FPLK_F9 = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_F9),
  FPLK_F10 = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_F10), FPLK_F11 = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_F11), FPLK_F12 = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_F12), FPLK_PRINTSCREEN = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_PRINTSCREEN),
  FPLK_SCROLLLOCK = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_SCROLLLOCK), FPLK_PAUSE = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_PAUSE), FPLK_INSERT = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_INSERT), FPLK_HOME = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_HOME),
  FPLK_PAGEUP = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_PAGEUP), FPLK_DELETE = '\177', FPLK_END = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_END), FPLK_PAGEDOWN = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_PAGEDOWN),
  FPLK_RIGHT = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_RIGHT), FPLK_LEFT = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_LEFT), FPLK_DOWN = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_DOWN), FPLK_UP = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_UP),
  FPLK_NUMLOCKCLEAR = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_NUMLOCKCLEAR), FPLK_KP_DIVIDE = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_DIVIDE), FPLK_KP_MULTIPLY = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_MULTIPLY), FPLK_KP_MINUS = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_MINUS),
  FPLK_KP_PLUS = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_PLUS), FPLK_KP_ENTER = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_ENTER), FPLK_KP_1 = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_1), FPLK_KP_2 = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_2),
  FPLK_KP_3 = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_3), FPLK_KP_4 = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_4), FPLK_KP_5 = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_5), FPLK_KP_6 = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_6),
  FPLK_KP_7 = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_7), FPLK_KP_8 = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_8), FPLK_KP_9 = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_9), FPLK_KP_0 = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_0),
  FPLK_KP_PERIOD = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_PERIOD), FPLK_APPLICATION = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_APPLICATION), FPLK_POWER = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_POWER), FPLK_KP_EQUALS = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_EQUALS),
  FPLK_F13 = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_F13), FPLK_F14 = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_F14), FPLK_F15 = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_F15), FPLK_F16 = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_F16),
  FPLK_F17 = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_F17), FPLK_F18 = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_F18), FPLK_F19 = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_F19), FPLK_F20 = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_F20),
  FPLK_F21 = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_F21), FPLK_F22 = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_F22), FPLK_F23 = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_F23), FPLK_F24 = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_F24),
  FPLK_EXECUTE = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_EXECUTE), FPLK_HELP = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_HELP), FPLK_MENU = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_MENU), FPLK_SELECT = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_SELECT),
  FPLK_STOP = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_STOP), FPLK_AGAIN = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_AGAIN), FPLK_UNDO = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_UNDO), FPLK_CUT = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_CUT),
  FPLK_COPY = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_COPY), FPLK_PASTE = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_PASTE), FPLK_FIND = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_FIND), FPLK_MUTE = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_MUTE),
  FPLK_VOLUMEUP = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_VOLUMEUP), FPLK_VOLUMEDOWN = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_VOLUMEDOWN), FPLK_KP_COMMA = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_COMMA), FPLK_KP_EQUALSAS400 = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_EQUALSAS400),
  FPLK_ALTERASE = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_ALTERASE), FPLK_SYSREQ = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_SYSREQ), FPLK_CANCEL = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_CANCEL), FPLK_CLEAR = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_CLEAR),
  FPLK_PRIOR = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_PRIOR), FPLK_RETURN2 = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_RETURN2), FPLK_SEPARATOR = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_SEPARATOR), FPLK_OUT = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_OUT),
  FPLK_OPER = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_OPER), FPLK_CLEARAGAIN = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_CLEARAGAIN), FPLK_CRSEL = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_CRSEL), FPLK_EXSEL = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_EXSEL),
  FPLK_KP_00 = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_00), FPLK_KP_000 = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_000), FPLK_THOUSANDSSEPARATOR, FPLK_DECIMALSEPARATOR,
  FPLK_CURRENCYUNIT = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_CURRENCYUNIT), FPLK_CURRENCYSUBUNIT = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_CURRENCYSUBUNIT), FPLK_KP_LEFTPAREN = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_LEFTPAREN), FPLK_KP_RIGHTPAREN = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_RIGHTPAREN),
  FPLK_KP_LEFTBRACE = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_LEFTBRACE), FPLK_KP_RIGHTBRACE = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_RIGHTBRACE), FPLK_KP_TAB = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_TAB), FPLK_KP_BACKSPACE = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_BACKSPACE),
  FPLK_KP_A = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_A), FPLK_KP_B = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_B), FPLK_KP_C = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_C), FPLK_KP_D = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_D),
  FPLK_KP_E = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_E), FPLK_KP_F = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_F), FPLK_KP_XOR = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_XOR), FPLK_KP_POWER = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_POWER),
  FPLK_KP_PERCENT = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_PERCENT), FPLK_KP_LESS = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_LESS), FPLK_KP_GREATER = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_GREATER), FPLK_KP_AMPERSAND = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_AMPERSAND),
  FPLK_KP_DBLAMPERSAND = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_DBLAMPERSAND), FPLK_KP_VERTICALBAR = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_VERTICALBAR), FPLK_KP_DBLVERTICALBAR, FPLK_KP_COLON = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_COLON),
  FPLK_KP_HASH = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_HASH), FPLK_KP_SPACE = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_SPACE), FPLK_KP_AT = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_AT), FPLK_KP_EXCLAM = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_EXCLAM),
  FPLK_KP_MEMSTORE = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_MEMSTORE), FPLK_KP_MEMRECALL = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_MEMRECALL), FPLK_KP_MEMCLEAR = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_MEMCLEAR), FPLK_KP_MEMADD = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_MEMADD),
  FPLK_KP_MEMSUBTRACT = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_MEMSUBTRACT), FPLK_KP_MEMMULTIPLY = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_MEMMULTIPLY), FPLK_KP_MEMDIVIDE = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_MEMDIVIDE), FPLK_KP_PLUSMINUS = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_PLUSMINUS),
  FPLK_KP_CLEAR = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_CLEAR), FPLK_KP_CLEARENTRY = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_CLEARENTRY), FPLK_KP_BINARY = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_BINARY), FPLK_KP_OCTAL = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_OCTAL),
  FPLK_KP_DECIMAL = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_DECIMAL), FPLK_KP_HEXADECIMAL = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KP_HEXADECIMAL), FPLK_LCTRL = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_LCTRL), FPLK_LSHIFT = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_LSHIFT),
  FPLK_LALT = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_LALT), FPLK_LGUI = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_LGUI), FPLK_RCTRL = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_RCTRL), FPLK_RSHIFT = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_RSHIFT),
  FPLK_RALT = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_RALT), FPLK_RGUI = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_RGUI), FPLK_MODE = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_MODE), FPLK_AUDIONEXT = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_AUDIONEXT),
  FPLK_AUDIOPREV = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_AUDIOPREV), FPLK_AUDIOSTOP = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_AUDIOSTOP), FPLK_AUDIOPLAY = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_AUDIOPLAY), FPLK_AUDIOMUTE = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_AUDIOMUTE),
  FPLK_MEDIASELECT = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_MEDIASELECT), FPLK_WWW = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_WWW), FPLK_MAIL = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_MAIL), FPLK_CALCULATOR = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_CALCULATOR),
  FPLK_COMPUTER = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_COMPUTER), FPLK_AC_SEARCH = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_AC_SEARCH), FPLK_AC_HOME = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_AC_HOME), FPLK_AC_BACK = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_AC_BACK),
  FPLK_AC_FORWARD = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_AC_FORWARD), FPLK_AC_STOP = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_AC_STOP), FPLK_AC_REFRESH = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_AC_REFRESH), FPLK_AC_BOOKMARKS = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_AC_BOOKMARKS),
  FPLK_BRIGHTNESSDOWN = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_BRIGHTNESSDOWN), FPLK_BRIGHTNESSUP = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_BRIGHTNESSUP), FPLK_DISPLAYSWITCH = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_DISPLAYSWITCH), FPLK_KBDILLUMTOGGLE = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KBDILLUMTOGGLE),
  FPLK_KBDILLUMDOWN = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KBDILLUMDOWN), FPLK_KBDILLUMUP = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_KBDILLUMUP), FPLK_EJECT = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_EJECT), FPLK_SLEEP = FPL_SCANCODE_TO_KEYCODE(FPL_SCANCODE_SLEEP)
}
 
enum  FPL_Keymod {
  FPL_KMOD_NONE = 0x0000, FPL_KMOD_LSHIFT = 0x0001, FPL_KMOD_RSHIFT = 0x0002, FPL_KMOD_LCTRL = 0x0040,
  FPL_KMOD_RCTRL = 0x0080, FPL_KMOD_LALT = 0x0100, FPL_KMOD_RALT = 0x0200, FPL_KMOD_LGUI = 0x0400,
  FPL_KMOD_RGUI = 0x0800, FPL_KMOD_NUM = 0x1000, FPL_KMOD_CAPS = 0x2000, FPL_KMOD_MODE = 0x4000,
  FPL_KMOD_RESERVED = 0x8000
}
 Enumeration of valid key mods (possibly OR'd together).
 
enum  FPL_SCANCODE {
  FPL_SCANCODE_UNKNOWN = 0, FPL_SCANCODE_A = 4, FPL_SCANCODE_B = 5, FPL_SCANCODE_C = 6,
  FPL_SCANCODE_D = 7, FPL_SCANCODE_E = 8, FPL_SCANCODE_F = 9, FPL_SCANCODE_G = 10,
  FPL_SCANCODE_H = 11, FPL_SCANCODE_I = 12, FPL_SCANCODE_J = 13, FPL_SCANCODE_K = 14,
  FPL_SCANCODE_L = 15, FPL_SCANCODE_M = 16, FPL_SCANCODE_N = 17, FPL_SCANCODE_O = 18,
  FPL_SCANCODE_P = 19, FPL_SCANCODE_Q = 20, FPL_SCANCODE_R = 21, FPL_SCANCODE_S = 22,
  FPL_SCANCODE_T = 23, FPL_SCANCODE_U = 24, FPL_SCANCODE_V = 25, FPL_SCANCODE_W = 26,
  FPL_SCANCODE_X = 27, FPL_SCANCODE_Y = 28, FPL_SCANCODE_Z = 29, FPL_SCANCODE_1 = 30,
  FPL_SCANCODE_2 = 31, FPL_SCANCODE_3 = 32, FPL_SCANCODE_4 = 33, FPL_SCANCODE_5 = 34,
  FPL_SCANCODE_6 = 35, FPL_SCANCODE_7 = 36, FPL_SCANCODE_8 = 37, FPL_SCANCODE_9 = 38,
  FPL_SCANCODE_0 = 39, FPL_SCANCODE_RETURN = 40, FPL_SCANCODE_ESCAPE = 41, FPL_SCANCODE_BACKSPACE = 42,
  FPL_SCANCODE_TAB = 43, FPL_SCANCODE_SPACE = 44, FPL_SCANCODE_MINUS = 45, FPL_SCANCODE_EQUALS = 46,
  FPL_SCANCODE_LEFTBRACKET = 47, FPL_SCANCODE_RIGHTBRACKET = 48, FPL_SCANCODE_BACKSLASH = 49, FPL_SCANCODE_NONUSHASH = 50,
  FPL_SCANCODE_SEMICOLON = 51, FPL_SCANCODE_APOSTROPHE = 52, FPL_SCANCODE_GRAVE = 53, FPL_SCANCODE_COMMA = 54,
  FPL_SCANCODE_PERIOD = 55, FPL_SCANCODE_SLASH = 56, FPL_SCANCODE_CAPSLOCK = 57, FPL_SCANCODE_F1 = 58,
  FPL_SCANCODE_F2 = 59, FPL_SCANCODE_F3 = 60, FPL_SCANCODE_F4 = 61, FPL_SCANCODE_F5 = 62,
  FPL_SCANCODE_F6 = 63, FPL_SCANCODE_F7 = 64, FPL_SCANCODE_F8 = 65, FPL_SCANCODE_F9 = 66,
  FPL_SCANCODE_F10 = 67, FPL_SCANCODE_F11 = 68, FPL_SCANCODE_F12 = 69, FPL_SCANCODE_PRINTSCREEN = 70,
  FPL_SCANCODE_SCROLLLOCK = 71, FPL_SCANCODE_PAUSE = 72, FPL_SCANCODE_INSERT = 73, FPL_SCANCODE_HOME = 74,
  FPL_SCANCODE_PAGEUP = 75, FPL_SCANCODE_DELETE = 76, FPL_SCANCODE_END = 77, FPL_SCANCODE_PAGEDOWN = 78,
  FPL_SCANCODE_RIGHT = 79, FPL_SCANCODE_LEFT = 80, FPL_SCANCODE_DOWN = 81, FPL_SCANCODE_UP = 82,
  FPL_SCANCODE_NUMLOCKCLEAR = 83, FPL_SCANCODE_KP_DIVIDE = 84, FPL_SCANCODE_KP_MULTIPLY = 85, FPL_SCANCODE_KP_MINUS = 86,
  FPL_SCANCODE_KP_PLUS = 87, FPL_SCANCODE_KP_ENTER = 88, FPL_SCANCODE_KP_1 = 89, FPL_SCANCODE_KP_2 = 90,
  FPL_SCANCODE_KP_3 = 91, FPL_SCANCODE_KP_4 = 92, FPL_SCANCODE_KP_5 = 93, FPL_SCANCODE_KP_6 = 94,
  FPL_SCANCODE_KP_7 = 95, FPL_SCANCODE_KP_8 = 96, FPL_SCANCODE_KP_9 = 97, FPL_SCANCODE_KP_0 = 98,
  FPL_SCANCODE_KP_PERIOD = 99, FPL_SCANCODE_NONUSBACKSLASH = 100, FPL_SCANCODE_APPLICATION = 101, FPL_SCANCODE_POWER = 102,
  FPL_SCANCODE_KP_EQUALS = 103, FPL_SCANCODE_F13 = 104, FPL_SCANCODE_F14 = 105, FPL_SCANCODE_F15 = 106,
  FPL_SCANCODE_F16 = 107, FPL_SCANCODE_F17 = 108, FPL_SCANCODE_F18 = 109, FPL_SCANCODE_F19 = 110,
  FPL_SCANCODE_F20 = 111, FPL_SCANCODE_F21 = 112, FPL_SCANCODE_F22 = 113, FPL_SCANCODE_F23 = 114,
  FPL_SCANCODE_F24 = 115, FPL_SCANCODE_EXECUTE = 116, FPL_SCANCODE_HELP = 117, FPL_SCANCODE_MENU = 118,
  FPL_SCANCODE_SELECT = 119, FPL_SCANCODE_STOP = 120, FPL_SCANCODE_AGAIN = 121, FPL_SCANCODE_UNDO = 122,
  FPL_SCANCODE_CUT = 123, FPL_SCANCODE_COPY = 124, FPL_SCANCODE_PASTE = 125, FPL_SCANCODE_FIND = 126,
  FPL_SCANCODE_MUTE = 127, FPL_SCANCODE_VOLUMEUP = 128, FPL_SCANCODE_VOLUMEDOWN = 129, FPL_SCANCODE_KP_COMMA = 133,
  FPL_SCANCODE_KP_EQUALSAS400 = 134, FPL_SCANCODE_INTERNATIONAL1 = 135, FPL_SCANCODE_INTERNATIONAL2 = 136, FPL_SCANCODE_INTERNATIONAL3 = 137,
  FPL_SCANCODE_INTERNATIONAL4 = 138, FPL_SCANCODE_INTERNATIONAL5 = 139, FPL_SCANCODE_INTERNATIONAL6 = 140, FPL_SCANCODE_INTERNATIONAL7 = 141,
  FPL_SCANCODE_INTERNATIONAL8 = 142, FPL_SCANCODE_INTERNATIONAL9 = 143, FPL_SCANCODE_LANG1 = 144, FPL_SCANCODE_LANG2 = 145,
  FPL_SCANCODE_LANG3 = 146, FPL_SCANCODE_LANG4 = 147, FPL_SCANCODE_LANG5 = 148, FPL_SCANCODE_LANG6 = 149,
  FPL_SCANCODE_LANG7 = 150, FPL_SCANCODE_LANG8 = 151, FPL_SCANCODE_LANG9 = 152, FPL_SCANCODE_ALTERASE = 153,
  FPL_SCANCODE_SYSREQ = 154, FPL_SCANCODE_CANCEL = 155, FPL_SCANCODE_CLEAR = 156, FPL_SCANCODE_PRIOR = 157,
  FPL_SCANCODE_RETURN2 = 158, FPL_SCANCODE_SEPARATOR = 159, FPL_SCANCODE_OUT = 160, FPL_SCANCODE_OPER = 161,
  FPL_SCANCODE_CLEARAGAIN = 162, FPL_SCANCODE_CRSEL = 163, FPL_SCANCODE_EXSEL = 164, FPL_SCANCODE_KP_00 = 176,
  FPL_SCANCODE_KP_000 = 177, FPL_SCANCODE_THOUSANDSSEPARATOR = 178, FPL_SCANCODE_DECIMALSEPARATOR = 179, FPL_SCANCODE_CURRENCYUNIT = 180,
  FPL_SCANCODE_CURRENCYSUBUNIT = 181, FPL_SCANCODE_KP_LEFTPAREN = 182, FPL_SCANCODE_KP_RIGHTPAREN = 183, FPL_SCANCODE_KP_LEFTBRACE = 184,
  FPL_SCANCODE_KP_RIGHTBRACE = 185, FPL_SCANCODE_KP_TAB = 186, FPL_SCANCODE_KP_BACKSPACE = 187, FPL_SCANCODE_KP_A = 188,
  FPL_SCANCODE_KP_B = 189, FPL_SCANCODE_KP_C = 190, FPL_SCANCODE_KP_D = 191, FPL_SCANCODE_KP_E = 192,
  FPL_SCANCODE_KP_F = 193, FPL_SCANCODE_KP_XOR = 194, FPL_SCANCODE_KP_POWER = 195, FPL_SCANCODE_KP_PERCENT = 196,
  FPL_SCANCODE_KP_LESS = 197, FPL_SCANCODE_KP_GREATER = 198, FPL_SCANCODE_KP_AMPERSAND = 199, FPL_SCANCODE_KP_DBLAMPERSAND = 200,
  FPL_SCANCODE_KP_VERTICALBAR = 201, FPL_SCANCODE_KP_DBLVERTICALBAR = 202, FPL_SCANCODE_KP_COLON = 203, FPL_SCANCODE_KP_HASH = 204,
  FPL_SCANCODE_KP_SPACE = 205, FPL_SCANCODE_KP_AT = 206, FPL_SCANCODE_KP_EXCLAM = 207, FPL_SCANCODE_KP_MEMSTORE = 208,
  FPL_SCANCODE_KP_MEMRECALL = 209, FPL_SCANCODE_KP_MEMCLEAR = 210, FPL_SCANCODE_KP_MEMADD = 211, FPL_SCANCODE_KP_MEMSUBTRACT = 212,
  FPL_SCANCODE_KP_MEMMULTIPLY = 213, FPL_SCANCODE_KP_MEMDIVIDE = 214, FPL_SCANCODE_KP_PLUSMINUS = 215, FPL_SCANCODE_KP_CLEAR = 216,
  FPL_SCANCODE_KP_CLEARENTRY = 217, FPL_SCANCODE_KP_BINARY = 218, FPL_SCANCODE_KP_OCTAL = 219, FPL_SCANCODE_KP_DECIMAL = 220,
  FPL_SCANCODE_KP_HEXADECIMAL = 221, FPL_SCANCODE_LCTRL = 224, FPL_SCANCODE_LSHIFT = 225, FPL_SCANCODE_LALT = 226,
  FPL_SCANCODE_LGUI = 227, FPL_SCANCODE_RCTRL = 228, FPL_SCANCODE_RSHIFT = 229, FPL_SCANCODE_RALT = 230,
  FPL_SCANCODE_RGUI = 231, FPL_SCANCODE_MODE = 257, FPL_SCANCODE_AUDIONEXT = 258, FPL_SCANCODE_AUDIOPREV = 259,
  FPL_SCANCODE_AUDIOSTOP = 260, FPL_SCANCODE_AUDIOPLAY = 261, FPL_SCANCODE_AUDIOMUTE = 262, FPL_SCANCODE_MEDIASELECT = 263,
  FPL_SCANCODE_WWW = 264, FPL_SCANCODE_MAIL = 265, FPL_SCANCODE_CALCULATOR = 266, FPL_SCANCODE_COMPUTER = 267,
  FPL_SCANCODE_AC_SEARCH = 268, FPL_SCANCODE_AC_HOME = 269, FPL_SCANCODE_AC_BACK = 270, FPL_SCANCODE_AC_FORWARD = 271,
  FPL_SCANCODE_AC_STOP = 272, FPL_SCANCODE_AC_REFRESH = 273, FPL_SCANCODE_AC_BOOKMARKS = 274, FPL_SCANCODE_BRIGHTNESSDOWN = 275,
  FPL_SCANCODE_BRIGHTNESSUP = 276, FPL_SCANCODE_DISPLAYSWITCH = 277, FPL_SCANCODE_KBDILLUMTOGGLE = 278, FPL_SCANCODE_KBDILLUMDOWN = 279,
  FPL_SCANCODE_KBDILLUMUP = 280, FPL_SCANCODE_EJECT = 281, FPL_SCANCODE_SLEEP = 282, FPL_SCANCODE_APP1 = 283,
  FPL_SCANCODE_APP2 = 284, FPL_NUM_SCANCODES = 512
}
 
enum  Attribute {
  kEND = 0, kPosition3f, kNormal3f, kTangent4f,
  kTexCoord2f, kTexCoordAlt2f, kColor4ub, kBoneIndices4ub,
  kBoneWeights4ub
}
 An array of these enums defines the format of vertex data. More...
 
enum  StencilMode {
  kStencilDisabled, kStencilCompareEqual, kStencilWrite, kStencilUnknown,
  kStencilModeCount
}
 Specifies stencil modes for the stencil test. More...
 
enum  BlendMode {
  kBlendModeOff = 0, kBlendModeTest, kBlendModeAlpha, kBlendModeAdd,
  kBlendModeAddAlpha, kBlendModeMultiply, kBlendModePreMultipliedAlpha, kBlendModeUnknown,
  kBlendModeCount
}
 Specifies the blending mode used by the blend function. More...
 
enum  DepthFunction {
  kDepthFunctionDisabled, kDepthFunctionNever, kDepthFunctionAlways, kDepthFunctionLess,
  kDepthFunctionLessEqual, kDepthFunctionGreater, kDepthFunctionGreaterEqual, kDepthFunctionEqual,
  kDepthFunctionNotEqual, kDepthFunctionUnknown, kDepthFunctionCount
}
 Specifies the depth function used for rendering. More...
 
enum  CullingMode {
  kCullingModeNone, kCullingModeFront, kCullingModeBack, kCullingModeFrontAndBack,
  kCullingModeUnknown
}
 Specifies the which face is culled when rendering. More...
 
enum  RenderTargetFormat { kRenderTargetFormatUByte, kRenderTargetFormatCount }
 
enum  TextureFormat {
  kFormatAuto = 0, kFormat8888, kFormat888, kFormat5551,
  kFormat565, kFormatLuminance, kFormatASTC, kFormatPKM,
  kFormatKTX, kFormatNative, kFormatLuminanceAlpha, kFormatCount
}
 
enum  TextureFlags {
  kTextureFlagsNone = 0, kTextureFlagsClampToEdge = 1 << 0, kTextureFlagsUseMipMaps = 1 << 1, kTextureFlagsIsCubeMap = 1 << 2,
  kTextureFlagsLoadAsync = 1 << 3, kTextureFlagsPremultiplyAlpha = 1 << 4
}
 Flags affecting loading and sampler modes for a texture. More...
 
enum  LogCategory {
  kApplication = 0, kError = 1, kSystem = 3, kAudio = 4,
  kVideo = 5, kRender = 6, kInput = 7, kCustom = 19
}
 Constants for use with LogInfo, LogError, etc.
 
enum  PerformanceMode { kNormalPerformance = 0, kHighPerformance }
 Enum for use with the Set/GetPerformanceMode() functions.
 

Functions

mathfu::vec2 LoadVec2 (const Vec2 *v)
 Converts a Vec2. More...
 
mathfu::vec3 LoadVec3 (const Vec3 *v)
 Converts a Vec3. More...
 
mathfu::vec4 LoadVec4 (const Vec4 *v)
 Converts a Vec4. More...
 
mathfu::vec2i LoadVec2i (const Vec2i *v)
 Converts a Vec2i. More...
 
mathfu::vec3i LoadVec3i (const Vec3i *v)
 Converts a Vec3i. More...
 
mathfu::vec4i LoadVec4i (const Vec4i *v)
 Converts a Vec4i. More...
 
mathfu::vec3 LoadAxis (Axis axis)
 Converts a Axis to the corresponding vec3. More...
 
mathfu::vec4 LoadColorRGBA (const ColorRGBA *c)
 Converts a ColorRGBA to a vec4. More...
 
ColorRGBA Vec4ToColorRGBA (const mathfu::vec4 &v)
 Converts a vec4 to a ColorRGBA. More...
 
mathfu::AffineTransform LoadAffine (const Mat3x4 *m)
 Converts a Mat3x4 to a mat4. More...
 
bool ValidateRenderState (const RenderState &render_state)
 : Validates that the current GPU state matches a given render state. More...
 
TextureHandle InvalidTextureHandle ()
 
TextureTarget InvalidTextureTarget ()
 
ShaderHandle InvalidShaderHandle ()
 
UniformHandle InvalidUniformHandle ()
 
BufferHandle InvalidBufferHandle ()
 
DeviceMemoryHandle InvalidDeviceMemoryHandle ()
 
bool ValidTextureHandle (TextureHandle handle)
 
bool ValidTextureTarget (TextureTarget target)
 
bool ValidShaderHandle (ShaderHandle handle)
 
bool ValidUniformHandle (UniformHandle handle)
 
bool ValidBufferHandle (BufferHandle handle)
 
bool ValidDeviceMemoryHandle (DeviceMemoryHandle handle)
 
bool operator== (const ScissorState &lhs, const ScissorState &rhs)
 
bool operator!= (const ScissorState &lhs, const ScissorState &rhs)
 
bool operator== (const StencilOperation &lhs, const StencilOperation &rhs)
 
bool operator!= (const StencilOperation &lhs, const StencilOperation &rhs)
 
bool operator== (const StencilFunction &lhs, const StencilFunction &rhs)
 
bool operator!= (const StencilFunction &lhs, const StencilFunction &rhs)
 
bool operator== (const StencilState &lhs, const StencilState &rhs)
 
bool operator!= (const StencilState &lhs, const StencilState &rhs)
 
bool operator== (const DepthState &lhs, const DepthState &rhs)
 
bool operator!= (const DepthState &lhs, const DepthState &rhs)
 
bool operator== (const CullState &lhs, const CullState &rhs)
 
bool operator!= (const CullState &lhs, const CullState &rhs)
 
unsigned int RenderFunctionToGlFunction (RenderFunction func)
 Converts FPL render function value to equivalent GL enum value. More...
 
unsigned int BlendStateFactorToGl (BlendState::BlendFactor factor)
 Converts FPL blend state factor to equivalent GL enum value. More...
 
unsigned int StencilOpToGlOp (StencilOperation::StencilOperations op)
 Converts FPL stencil operation value to equivalent GL enum value. More...
 
unsigned int CullFaceToGl (CullState::CullFace face)
 Converts FPL cull face value to equivalent GL enum value. More...
 
unsigned int RenderTargetFormatToGl (RenderTargetFormat format)
 Converts FPL RenderTargetFormat to equivalent GL enum value. More...
 
TextureHandle TextureHandleFromGl (unsigned int gl)
 
TextureTarget TextureTargetFromGl (unsigned int gl)
 
ShaderHandle ShaderHandleFromGl (unsigned int gl)
 
UniformHandle UniformHandleFromGl (int gl_int)
 
BufferHandle BufferHandleFromGl (unsigned int gl)
 
unsigned int GlTextureHandle (TextureHandle handle)
 
unsigned int GlTextureTarget (TextureTarget handle)
 
unsigned int GlShaderHandle (ShaderHandle handle)
 
int GlUniformHandle (UniformHandle handle)
 
unsigned int GlBufferHandle (BufferHandle handle)
 
bool LoadFileWithDirectives (const char *filename, std::string *dest, std::string *error_message)
 Load a file like LoadFile(), but scan for directives. More...
 
bool LoadFileWithDirectives (const char *filename, std::string *dest, const std::set< std::string > &defines, std::string *error_message)
 Overloaded LoadFileWithDirectives to allow pre-definining #define identifiers. More...
 
bool LoadFileWithDirectives (const char *filename, std::string *dest, const char *const *defines, std::string *error_message)
 Overloaded LoadFileWithDirectives to allow pre-definining #define identifiers in an array. More...
 
void PlatformSanitizeShaderSource (const char *source, const char *const *defines, std::string *result)
 Prepares OpenGL shaders for compilation across desktop or mobile. More...
 
void AndroidPreCreateWindow ()
 Create the Android window surface.
 
void AndroidSetScalerResolution (const mathfu::vec2i &resolution)
 Scalar settings can occasionally fail on fail on some Android devices. In failure cases, the caller can check for success by verifying AndroidGetScalerResolution() returns the expected resolution. If AndroidGetScalarResolution() returns a diffrent resolution than what was set in AndroidSetScaleResolution(), the application can assume failure and attempt to restart the app to try configuration again. More...
 
const mathfu::vec2i & AndroidGetScalerResolution ()
 Get the Android scaler resolution. More...
 
int AndroidGetContextClientVersion ()
 Gets the GLES client version of the current EGL context. More...
 
void AndroidInitGl3Functions ()
 Gets all the GL3 function pointers. Using this rather than GLES3/gl3.h directly means we can still compile on older SDKs and run on older devices too.
 
void InitializeUndistortFramebuffer (int width, int height)
 Initializes the framebuffer needed for Head Mounted Display undistortion. More...
 
void BeginUndistortFramebuffer ()
 Called before rendering for HMD to set up the framebuffer.
 
void FinishUndistortFramebuffer ()
 Called when finished with rendering for HMD, to undistort and render the result.
 
void SetCardboardButtonEnabled (bool enabled)
 Called to set whether the Cardboard settings button (gear icon) is enabled and rendering. More...
 
TextureFlags operator| (TextureFlags a, TextureFlags b)
 
bool HasAlpha (TextureFormat format)
 determines if the format has an alpha component.
 
bool IsCompressed (TextureFormat format)
 determines if the format is already compressed in some way. If image data is supplied in these formats, we use them as-is.
 
bool LoadFileRaw (const char *filename, std::string *dest)
 Loads a file and returns its contents via string pointer. More...
 
bool LoadFile (const char *filename, std::string *dest)
 Loads a file and returns its contents via string pointer. More...
 
LoadFileFunction SetLoadFileFunction (LoadFileFunction load_file_function)
 Set the function called by LoadFile(). More...
 
bool SaveFile (const char *filename, const std::string &data)
 Save a string to a file, overwriting the existing contents. More...
 
bool SaveFile (const char *filename, const void *data, size_t size)
 Save a string to a file, overwriting the existing contents. More...
 
bool LoadPreferences (const char *filename, std::string *dest)
 Load preference settings. More...
 
bool SavePreferences (const char *filename, const void *data, size_t size)
 Save preference settings. More...
 
int32_t LoadPreference (const char *key, int32_t initial_value)
 Load a single integer value to a preference. More...
 
bool SavePreference (const char *key, int32_t value)
 Save a single integer value to a preference. More...
 
const void * MapFile (const char *filename, int32_t offset, int32_t *size)
 Map a file into memory and returns its contents via pointer. More...
 
void UnmapFile (const void *file, int32_t size)
 Unmap a pointer that is mapped via MapFile() API. More...
 
bool ChangeToUpstreamDir (const char *const binary_dir, const char *const target_dir)
 Search and change to a given directory. More...
 
bool MipmapGeneration16bppSupported ()
 check if 16bpp MipMap is supported. More...
 
int32_t GetSystemRamSize ()
 Get the system's RAM size. More...
 
void LogInfo (const char *fmt, va_list args)
 Log a format string with Info priority to the console. More...
 
void LogError (const char *fmt, va_list args)
 Log a format string with Error priority to the console. More...
 
void LogInfo (LogCategory category, const char *fmt, va_list args)
 Log a format string with Info priority to the console. More...
 
void LogError (LogCategory category, const char *fmt, va_list args)
 Log a format string with Error priority to the console. More...
 
void LogInfo (const char *fmt,...)
 Log a format string with Info priority to the console. More...
 
void LogError (const char *fmt,...)
 Log a format string with Error priority to the console. More...
 
void LogInfo (LogCategory category, const char *fmt,...)
 Log a format string with Info priority to the console. More...
 
void LogError (LogCategory category, const char *fmt,...)
 Log a format string with Error priority to the console. More...
 
jobject AndroidGetActivity ()
 Get the Android activity class. More...
 
JNIEnv * AndroidGetJNIEnv ()
 Get the Java native interface object (JNIEnv). More...
 
VsyncCallback RegisterVsyncCallback (VsyncCallback callback)
 Register for handling vsync callbacks on android. More...
 
void WaitForVsync ()
 Blocks until the next time a VSync happens.
 
int GetVsyncFrameId ()
 Get Vsync frame id. More...
 
void SendKeypressEventToAndroid (int android_keycode)
 Triggers a keypress event on an Android device. More...
 
std::string AndroidGetActivityName ()
 Get the name of the current activity class. More...
 
std::string AndroidGetViewIntentData ()
 Determine whether the activity was started with Intent.ACTION_VIEW and, if so, return the data the user wants to "view" in the application. More...
 
bool GetStoragePath (const char *app_name, std::string *path)
 Retrieve a path where an app can store data files. More...
 
bool SupportsHeadMountedDisplay ()
 Checks whether Head Mounted Displays, such as Cardboard, are supported by the system being run on. More...
 
bool TouchScreenDevice ()
 Checks if the device has a touchscreen. More...
 
bool IsTvDevice ()
 Checks whether the device we are running on is an Android TV device. More...
 
void SetPerformanceMode (PerformanceMode new_mode)
 Sets the performance mode. More...
 
PerformanceMode GetPerformanceMode ()
 Get the current performance mode. More...
 
void RelaunchApplication ()
 Relaunch the application.
 
void SetHighPerformanceParameters (const HighPerformanceParams &params)
 Sets the specific parameters used by high-performance mode on Android. More...
 
const HighPerformanceParamsGetHighPerformanceParameters ()
 Get the high performance parameters. More...
 
std::string DeviceModel ()
 Get the Android device's model. More...
 
int32_t AndroidGetApiLevel ()
 Get the Android device's API level. More...
 

Variables

const float kGamepadHatThreshold = 0.5f
 
static const int kMaxTexturesPerShader = 8
 
static const int kNumVec4sInAffineTransform = 3
 
const int kDefaultAndroidKeycode = 115
 Used for Android to simulate a keypress. Corresponds to F24, which is unavailable on most keyboards.
 
const double kDefaultTimeBetweenPresses = 1.0
 Used for Android. Corresponds to the time, in seconds, between simulated keypresses.
 

Detailed Description

Namespace for FPLBase library.

Typedef Documentation

Backend agnostic handles to various resources.

These typedefs are capible of holding OpenGL and Vulkan equivalents. We abstract the handles so that we can present a uniform interface, regardless of which backend is used.

This is also required for when we allow OpenGL or Vulkan to be selected at runtime, instead of compile time.

Enumeration Type Documentation

Specifies the blending mode used by the blend function.

Enumerator
kBlendModeOff 

No blending is done. The alpha channel is ignored.

kBlendModeTest 

Used to provide a function via glAlphaFunc instead of glBlendFunc.

kBlendModeAlpha 

Normal alpha channel blending.

kBlendModeAdd 

Additive blending, where the resulting color is the sum of the two colors.

kBlendModeAddAlpha 

Additive blending, where the resulting color is the sum of the two colors, and the image is affected by the alpha. (Note: The background is not affected by the image's alpha.)

kBlendModeMultiply 

Multiplicative blending, where the resulting color is the product of the image color and the background color.

kBlendModePreMultipliedAlpha 

Like Alpha, except the source RGB values are assumed to have already been multiplied by the alpha, so the blend function doesn't touch them.

kBlendModeUnknown 

An unknown mode, usually happens when accessing the graphics API directly.

kBlendModeCount 

Used at the end of the enum as sentinel value.

Specifies the which face is culled when rendering.

Enumerator
kCullingModeUnknown 

An unknown mode, usually happens when accessing the graphics API directly.

Specifies the depth function used for rendering.

Enumerator
kDepthFunctionUnknown 

An unknown mode, usually happens when accessing the graphics API directly.

Specifies stencil modes for the stencil test.

Enumerator
kStencilDisabled 

No stencil test.

kStencilCompareEqual 

Compare the that reference written reference and given reference are equal, if they are, write to the pixel buffer.

kStencilWrite 

Always pass the test and write to the pixel and stencil buffers.

kStencilUnknown 

An unknown mode, usually happens when accessing the graphics API directly.

Function Documentation

unsigned int fplbase::BlendStateFactorToGl ( BlendState::BlendFactor  factor)

Converts FPL blend state factor to equivalent GL enum value.

Parameters
factorThe blend state factor to convert.
unsigned int fplbase::CullFaceToGl ( CullState::CullFace  face)

Converts FPL cull face value to equivalent GL enum value.

Parameters
faceThe cull face value to convert.
bool fplbase::LoadFileWithDirectives ( const char *  filename,
std::string *  dest,
std::string *  error_message 
)

Load a file like LoadFile(), but scan for directives.

The only supported directives is #include.

Parameters
[in]filenameA UTF-8 C-string representing the file to load.
[out]destA pointer to a std::string to capture the preprocessed version of the file.
[out]error_messageA pointer to a std::string that captures an error message (if the function returned false, indicating failure).
Returns
If this function returns false, error_message indicates which directive caused the problem and why.
bool fplbase::LoadFileWithDirectives ( const char *  filename,
std::string *  dest,
const std::set< std::string > &  defines,
std::string *  error_message 
)

Overloaded LoadFileWithDirectives to allow pre-definining #define identifiers.

Parameters
[in]filenameA UTF-8 C-string representing the file to load.
[out]destA pointer to a std::string to capture the preprocessed version of the file.
[in]definesA set of identifiers which will be prefixed with #define at the start of the file. before loading the file.
[out]error_messageA pointer to a std::string that captures an error message (if the function returned false, indicating failure).
Returns
If this function returns false, error_message indicates which directive caused the problem and why.
bool fplbase::LoadFileWithDirectives ( const char *  filename,
std::string *  dest,
const char *const *  defines,
std::string *  error_message 
)

Overloaded LoadFileWithDirectives to allow pre-definining #define identifiers in an array.

Parameters
[in]filenameA UTF-8 C-string representing the file to load.
[out]destA pointer to a std::string to capture the preprocessed version of the file.
[in]definesA nullptr-terminated array of identifiers which will be prefixed with #define at the start of the file. before loading the file.
[out]error_messageA pointer to a std::string that captures an error message (if the function returned false, indicating failure).
Returns
If this function returns false, error_message indicates which directive caused the problem and why.
void fplbase::PlatformSanitizeShaderSource ( const char *  source,
const char *const *  defines,
std::string *  result 
)

Prepares OpenGL shaders for compilation across desktop or mobile.

This function adds platform-specific definitions that allow the same shaders to be used on both desktop and mobile versions of GL. It does so in a way that is aware of #version and #extension directives, which must be placed before any shader code.

Parameters
[in]sourceShader source to be sanitized.
[in]definesA nullptr-terminated array of identifiers which will be safely prefixed with #define at the start of the file. Can be null.
[out]resultSanitized source code.
unsigned int fplbase::RenderFunctionToGlFunction ( RenderFunction  func)

Converts FPL render function value to equivalent GL enum value.

Parameters
funcThe render function value to convert.
unsigned int fplbase::RenderTargetFormatToGl ( RenderTargetFormat  format)

Converts FPL RenderTargetFormat to equivalent GL enum value.

Parameters
faceThe format to convert.
unsigned int fplbase::StencilOpToGlOp ( StencilOperation::StencilOperations  op)

Converts FPL stencil operation value to equivalent GL enum value.

Parameters
opThe stencil operation to convert.
bool fplbase::ValidateRenderState ( const RenderState &  render_state)

: Validates that the current GPU state matches a given render state.

In debug this function will throw assets if the present state does not match the expected render state. In release no checks will occur.