GOG GALAXY SDK Documentation
IUtils Class Referenceabstract

The interface for managing images. More...

#include <IUtils.h>

Public Member Functions

virtual void GetImageSize (uint32_t imageID, int32_t &width, int32_t &height)=0
 Reads width and height of the image of a specified ID. More...
 
virtual void GetImageRGBA (uint32_t imageID, void *buffer, uint32_t bufferLength)=0
 Reads the image of a specified ID. More...
 
virtual void RegisterForNotification (const char *type)=0
 Register for notifications of a specified type. More...
 
virtual uint32_t GetNotification (NotificationID notificationID, bool &consumable, char *type, uint32_t typeLength, void *content, uint32_t contentSize)=0
 Reads a specified notification. More...
 
virtual void ShowOverlayWithWebPage (const char *url)=0
 Shows web page in the overlay. More...
 
virtual bool IsOverlayVisible ()=0
 Return current visibility of the overlay. More...
 
virtual OverlayState GetOverlayState ()=0
 Return current state of the overlay. More...
 
virtual void DisableOverlayPopups (const char *popupGroup)=0
 Disable overlay pop-up notifications. More...
 
virtual GogServicesConnectionState GetGogServicesConnectionState ()=0
 Return current state of the connection to GOG services. More...
 

Detailed Description

The interface for managing images.

Member Function Documentation

◆ DisableOverlayPopups()

virtual void DisableOverlayPopups ( const char *  popupGroup)
pure virtual

Disable overlay pop-up notifications.

Hides overlay pop-up notifications based on the group specified below:

  • "chat_message" - New chat messages received.
  • "friend_invitation" - Friend request received, new user added to the friend list.
  • "game_invitation" - Game invitation sent or received.
Precondition
For this call to work, the overlay needs to be initialized first. To check whether the overlay is initialized successfully, call IUtils::GetOverlayState().
Parameters
[in]popupGroup- The name of the notification pop-up group.

◆ GetGogServicesConnectionState()

virtual GogServicesConnectionState GetGogServicesConnectionState ( )
pure virtual

Return current state of the connection to GOG services.

Remarks
IGogServicesConnectionStateListener might be used to track the GOG services connection state.
Before successful login connection state is undefined.
Returns
Current GOG services connection state.

◆ GetImageRGBA()

virtual void GetImageRGBA ( uint32_t  imageID,
void *  buffer,
uint32_t  bufferLength 
)
pure virtual

Reads the image of a specified ID.

Precondition
The size of the output buffer should be 4 * height * width * sizeof(char).
Parameters
[in]imageIDThe ID of the image.
[in,out]bufferThe output buffer.
[in]bufferLengthThe size of the output buffer.

◆ GetImageSize()

virtual void GetImageSize ( uint32_t  imageID,
int32_t &  width,
int32_t &  height 
)
pure virtual

Reads width and height of the image of a specified ID.

Parameters
[in]imageIDThe ID of the image.
[out]widthThe width of the image.
[out]heightThe height of the image.

◆ GetNotification()

virtual uint32_t GetNotification ( NotificationID  notificationID,
bool &  consumable,
char *  type,
uint32_t  typeLength,
void *  content,
uint32_t  contentSize 
)
pure virtual

Reads a specified notification.

Parameters
[in]notificationIDThe ID of the notification.
[out]consumableIndicates if the notification should be consumed.
[in,out]typeThe output buffer for the type of the notification.
[in]typeLengthThe size of the output buffer for the type of the notification.
[in,out]contentThe output buffer for the content of the notification.
[in]contentSizeThe size of the output buffer for the content of the notification.
Returns
The number of bytes written to the content buffer.

◆ GetOverlayState()

virtual OverlayState GetOverlayState ( )
pure virtual

Return current state of the overlay.

Remarks
Basic game functionality should not rely on the overlay state, as the overlay may either be switched off by the user, not supported, or may fail to initialize.
IOverlayInitializationStateChangeListener might be used to track the overlay initialization state change.
Precondition
In order for the overlay to be initialized successfully, first it must be enabled by the user in the Galaxy Client, and then successfully injected into the game.
Returns
State of the overlay.

◆ IsOverlayVisible()

virtual bool IsOverlayVisible ( )
pure virtual

Return current visibility of the overlay.

Remarks
IOverlayVisibilityChangeListener might be used to track the overlay visibility change.
Precondition
For this call to work, the overlay needs to be initialized first. To check whether the overlay is initialized successfully, call GetOverlayState().
Returns
true if the overlay is in front of the game.

◆ RegisterForNotification()

virtual void RegisterForNotification ( const char *  type)
pure virtual

Register for notifications of a specified type.

Remarks
Notification types starting "__" are reserved and cannot be used.
Parameters
[in]typeThe name of the type.

◆ ShowOverlayWithWebPage()

virtual void ShowOverlayWithWebPage ( const char *  url)
pure virtual

Shows web page in the overlay.

Precondition
For this call to work, the overlay needs to be initialized first. To check whether the overlay is initialized, call GetOverlayState().
Parameters
[in]urlThe URL address of a specified web page with the limit of 2047 bytes.