Gateware Libraries  6.3.A
Beta Build
GW::SYSTEM Namespace Reference

The namespace to which all Gateware library interfaces must belong. More...

Classes

class  GBufferedInput
 A Multi-threaded buffered input library. More...
 
struct  GBUFFEREDINPUT_EVENT_DATA
 Ensure identical binary padding for structures on all platforms. More...
 
class  GController
 A multi-threaded controller input library. More...
 
struct  GCONTROLLER_EVENT_DATA
 Ensure identical binary padding for structures on all platforms. More...
 
class  GFile
 Cross platform FileIO/Directory handling. More...
 
class  GInput
 A single threaded input library. More...
 
class  GLog
 Cross platform threadsafe logger. More...
 
class  GWindow
 A thread-safe window creation and management library. More...
 
struct  GWINDOW_EVENT_DATA
 Ensure identical binary padding for structures on all platforms. More...
 
struct  LINUX_WINDOW
 The structure used to pass into Input libraries on Linux. More...
 

Enumerations

enum  GBufferedInputEvents {
  KEYPRESSED, KEYRELEASED, BUTTONPRESSED, BUTTONRELEASED,
  MOUSESCROLL
}
 GBufferedInputEvents holds the possible events that can be sent from GBufferedInput. More...
 
enum  GControllerEvents { CONTROLLERBUTTONVALUECHANGED, CONTROLLERAXISVALUECHANGED, CONTROLLERCONNECTED, CONTROLLERDISCONNECTED }
 GControllerEvents holds the possible events that can be sent from GController. More...
 
enum  GControllerDeadzoneTypes { DEADZONESQUARE, DEADZONECIRCLE }
 GControllerDeadzoneTypes holds the diffrent type of deadzone calculations. More...
 
enum  GWindowStyle {
  WINDOWEDBORDERED, WINDOWEDBORDERLESS, FULLSCREENBORDERED, FULLSCREENBORDERLESS,
  MINIMIZED
}
 GWindowStyle holds the possible types of window GWindow can create.
 
enum  GWindowInputEvents {
  NOTIFY, MINIMIZE, MAXIMIZE, RESIZE,
  MOVE, DESTROY
}
 GWindowInputEvents holds the possible events a GWindow window can broadcast.
 

Functions

GATEWARE_EXPORT_IMPLICIT GReturn CreateGBufferedInput (void *_windowHandle, unsigned int _handleSize, GBufferedInput **_outBufferedInput)
 Creates a GBufferedInput Object. More...
 
GATEWARE_EXPORT_IMPLICIT GReturn CreateGController (int _controllerType, GController **_outController)
 Creates a new GController object.
 
GATEWARE_EXPORT_IMPLICIT GReturn CreateGFile (GFile **_outFile)
 Creates a GFile Object. More...
 
GATEWARE_EXPORT_IMPLICIT GReturn CreateGInput (void *_windowHandle, unsigned int _handleSize, GInput **_outInput)
 Creates a GInput Object. More...
 
GATEWARE_EXPORT_IMPLICIT GReturn CreateGLog (const char *const _fileName, GLog **_outLog)
 Creates a GLog object. More...
 
GATEWARE_EXPORT_IMPLICIT GReturn CreateGLogCustom (GFile *_file, GLog **_outLog)
 Creates a GLog object. More...
 
GATEWARE_EXPORT_IMPLICIT GReturn CreateGWindow (int _x, int _y, int _width, int _height, GWindowStyle _style, GWindow **_outWindow)
 Creates and outputs a new GWindow object. More...
 

Detailed Description

The namespace to which all Gateware library interfaces must belong.

Enumeration Type Documentation

◆ GBufferedInputEvents

GBufferedInputEvents holds the possible events that can be sent from GBufferedInput.

Enumerator
KEYPRESSED 

Key pressed event.

KEYRELEASED 

Key released event.

BUTTONPRESSED 

Mouse/Pointer Button pressed event.

BUTTONRELEASED 

Mouse/Pointer Button released event.

MOUSESCROLL 

Mouse/Pointer scroll event.

◆ GControllerDeadzoneTypes

GControllerDeadzoneTypes holds the diffrent type of deadzone calculations.

Enumerator
DEADZONESQUARE 

Calulates the deadzone of x and y separately

DEADZONECIRCLE 

Calulates the deadzone of x and y as a single magnitude

◆ GControllerEvents

GControllerEvents holds the possible events that can be sent from GController.

Enumerator
CONTROLLERBUTTONVALUECHANGED 

Input event for button value change

CONTROLLERAXISVALUECHANGED 

Input event for axis value changed

CONTROLLERCONNECTED 

Connection event for a controller being connected

CONTROLLERDISCONNECTED 

Connection event for a controller being disconnected

Function Documentation

◆ CreateGBufferedInput()

GATEWARE_EXPORT_IMPLICIT GReturn GW::SYSTEM::CreateGBufferedInput ( void *  _windowHandle,
unsigned int  _handleSize,
GBufferedInput **  _outBufferedInput 
)

Creates a GBufferedInput Object.

Initializes a handle to a window based on the void* data passed in. The created GBufferedInput object will have its reference count initialized to one.

Parameters
[in]_windowHandle(Windows) The handle to the window (HWND).
[in]_windowHandle(Linux) LINUX_WINDOW data.
[in]_windowHandle(Mac) NSWindow data.
[in]_handleSizeThe size of the handle to the window in bytes.
[out]_outBufferedInputWill contain the GBufferedInput object if successfully created.
Return values
SUCCESSno problems found.
FAILUREcould not make an BufferedInput Object.
INVALID_ARGUMENT_outInput and or _windowHandle is nullptr.

◆ CreateGFile()

GATEWARE_EXPORT_IMPLICIT GReturn GW::SYSTEM::CreateGFile ( GFile **  _outFile)

Creates a GFile Object.

The GFile created by this function will have its current working directory defaulted to the directory where the program was ran from. Call SetCurrentWorkingDirectory to change it. No file will be opened in creation of GFile. Call an Open function to open one. Created GFile object will have its reference count initialized to one.

Parameters
[out]_outFileWill contain the GFile object if successfully created.
Return values
SUCCESSGfile successfully created.
FAILUREGFile could not be created.
INVALID_ARGUMENTA nullptr was passed in.

◆ CreateGInput()

GATEWARE_EXPORT_IMPLICIT GReturn GW::SYSTEM::CreateGInput ( void *  _windowHandle,
unsigned int  _handleSize,
GInput **  _outInput 
)

Creates a GInput Object.

Initializes a handle to a window based on the void* data passed in. The
created GInput object will have its reference count initialized to one.

Parameters
[in]_windowHandle(Windows) The handle to the window (HWND).
[in]_windowHandle(Linux) LINUX_WINDOW data.
[in]_windowHandle(Mac) NSWindow data.
[in]_handleSizeThe size of the handle to the window in bytes.
[out]_outInputWill contain the GInput object if successfully created.
Return values
SUCCESSno problems found.
FAILUREcould not make an Input Object.
INVALID_ARGUMENT_outInput and or _windowHandle is nullptr.

◆ CreateGLog()

GATEWARE_EXPORT_IMPLICIT GReturn GW::SYSTEM::CreateGLog ( const char *const  _fileName,
GLog **  _outLog 
)

Creates a GLog object.

This function will create a GLog object with the log file being created in the directory the program was ran from. If you want to control where the log file is going to be created then use the custom function below to pass in a GFile* that is pre set the way you want it. Reference count of created object is initialized to one.

Parameters
[in]_fileNameThe name of the log file.
[out]_outLogWill contain the GLog if successfully created.
Return values
SUCCESSGLog was successfully created.
FAILUREGLog was not created. _outLog will be null.
INVALID_ARGUMENTEither one or both arguments are nullptrs.

◆ CreateGLogCustom()

GATEWARE_EXPORT_IMPLICIT GReturn GW::SYSTEM::CreateGLogCustom ( GFile _file,
GLog **  _outLog 
)

Creates a GLog object.

This function will create a GLog object with the GFile object that was passed in. This is so you can have more control over your log by setting up a GFile in advance. The GFile object should already have a file open for text writing. Created GLog object will have its reference count initialized to one.

Parameters
[in]_fileThe GFile object that this log will use.
[out]_outLogWill contain the GLog object if successfully created.
Return values
SUCCESSGLog was successfully created.
FAILUREGLog was not created. _outLog will be null.
INVALID_ARGUMENTEither one or both the arguments are nullptr.

◆ CreateGWindow()

GATEWARE_EXPORT_IMPLICIT GReturn GW::SYSTEM::CreateGWindow ( int  _x,
int  _y,
int  _width,
int  _height,
GWindowStyle  _style,
GWindow **  _outWindow 
)

Creates and outputs a new GWindow object.

Initializes a handle to a GWindow object with the parameters specified. Created GWindow object will have its reference count initialized to one.

Parameters
[in]_xThe x position of the window on the screen.
[in]_yThe y position of the window on the screen.
[in]_widthThe width of the window.
[in]_heightThe height of the window.
[in]_styleThe style of the window. (see GWindowStyle for style options)
[out]_outWindowWill contain the GWindow object if successfully created.
Return values
SUCCESSGWindow was successfully created.
FAILUREGWindow was not created. _outWindow will be null.
INVALID_ARGUMENTEither one or some arguments are nullptrs or invalid integers.