Rise
The Vieneo Province
Loading...
Searching...
No Matches
isteamscreenshots.h
Go to the documentation of this file.
1//====== Copyright � 1996-2008, Valve Corporation, All rights reserved. =======
2//
3// Purpose: public interface to user remote file storage in Steam
4//
5//=============================================================================
6
7#ifndef ISTEAMSCREENSHOTS_H
8#define ISTEAMSCREENSHOTS_H
9#ifdef _WIN32
10#pragma once
11#endif
12
13#include "steam_api_common.h"
14
17const int k_cubUFSTagTypeMax = 255;
18const int k_cubUFSTagValueMax = 255;
19
20// Required with of a thumbnail provided to AddScreenshotToLibrary. If you do not provide a thumbnail
21// one will be generated.
22const int k_ScreenshotThumbWidth = 200;
23
24// Handle is valid for the lifetime of your process and no longer
26#define INVALID_SCREENSHOT_HANDLE 0
27
37
38//-----------------------------------------------------------------------------
39// Purpose: Functions for adding screenshots to the user's screenshot library
40//-----------------------------------------------------------------------------
42{
43public:
44 // Writes a screenshot to the user's screenshot library given the raw image data, which must be in RGB format.
45 // The return value is a handle that is valid for the duration of the game process and can be used to apply tags.
46 virtual ScreenshotHandle WriteScreenshot( void *pubRGB, uint32 cubRGB, int nWidth, int nHeight ) = 0;
47
48 // Adds a screenshot to the user's screenshot library from disk. If a thumbnail is provided, it must be 200 pixels wide and the same aspect ratio
49 // as the screenshot, otherwise a thumbnail will be generated if the user uploads the screenshot. The screenshots must be in either JPEG or TGA format.
50 // The return value is a handle that is valid for the duration of the game process and can be used to apply tags.
51 // JPEG, TGA, and PNG formats are supported.
52 virtual ScreenshotHandle AddScreenshotToLibrary( const char *pchFilename, const char *pchThumbnailFilename, int nWidth, int nHeight ) = 0;
53
54 // Causes the Steam overlay to take a screenshot. If screenshots are being hooked by the game then a ScreenshotRequested_t callback is sent back to the game instead.
55 virtual void TriggerScreenshot() = 0;
56
57 // Toggles whether the overlay handles screenshots when the user presses the screenshot hotkey, or the game handles them. If the game is hooking screenshots,
58 // then the ScreenshotRequested_t callback will be sent if the user presses the hotkey, and the game is expected to call WriteScreenshot or AddScreenshotToLibrary
59 // in response.
60 virtual void HookScreenshots( bool bHook ) = 0;
61
62 // Sets metadata about a screenshot's location (for example, the name of the map)
63 virtual bool SetLocation( ScreenshotHandle hScreenshot, const char *pchLocation ) = 0;
64
65 // Tags a user as being visible in the screenshot
66 virtual bool TagUser( ScreenshotHandle hScreenshot, CSteamID steamID ) = 0;
67
68 // Tags a published file as being visible in the screenshot
69 virtual bool TagPublishedFile( ScreenshotHandle hScreenshot, PublishedFileId_t unPublishedFileID ) = 0;
70
71 // Returns true if the app has hooked the screenshot
72 virtual bool IsScreenshotsHooked() = 0;
73
74 // Adds a VR screenshot to the user's screenshot library from disk in the supported type.
75 // pchFilename should be the normal 2D image used in the library view
76 // pchVRFilename should contain the image that matches the correct type
77 // The return value is a handle that is valid for the duration of the game process and can be used to apply tags.
78 // JPEG, TGA, and PNG formats are supported.
79 virtual ScreenshotHandle AddVRScreenshotToLibrary( EVRScreenshotType eType, const char *pchFilename, const char *pchVRFilename ) = 0;
80};
81
82#define STEAMSCREENSHOTS_INTERFACE_VERSION "STEAMSCREENSHOTS_INTERFACE_VERSION003"
83
84// Global interface accessor
87
88// callbacks
89#if defined( VALVE_CALLBACK_PACK_SMALL )
90#pragma pack( push, 4 )
91#elif defined( VALVE_CALLBACK_PACK_LARGE )
92#pragma pack( push, 8 )
93#else
94#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx
95#endif
96//-----------------------------------------------------------------------------
97// Purpose: Screenshot successfully written or otherwise added to the library
98// and can now be tagged
99//-----------------------------------------------------------------------------
106
107//-----------------------------------------------------------------------------
108// Purpose: Screenshot has been requested by the user. Only sent if
109// HookScreenshots() has been called, in which case Steam will not take
110// the screenshot itself.
111//-----------------------------------------------------------------------------
116
117#pragma pack( pop )
118
119#endif // ISTEAMSCREENSHOTS_H
120
virtual ScreenshotHandle AddVRScreenshotToLibrary(EVRScreenshotType eType, const char *pchFilename, const char *pchVRFilename)=0
virtual bool TagPublishedFile(ScreenshotHandle hScreenshot, PublishedFileId_t unPublishedFileID)=0
virtual void HookScreenshots(bool bHook)=0
virtual bool SetLocation(ScreenshotHandle hScreenshot, const char *pchLocation)=0
virtual bool TagUser(ScreenshotHandle hScreenshot, CSteamID steamID)=0
virtual bool IsScreenshotsHooked()=0
virtual ScreenshotHandle AddScreenshotToLibrary(const char *pchFilename, const char *pchThumbnailFilename, int nWidth, int nHeight)=0
virtual ScreenshotHandle WriteScreenshot(void *pubRGB, uint32 cubRGB, int nWidth, int nHeight)=0
virtual void TriggerScreenshot()=0
uint64 PublishedFileId_t
const int k_cubUFSTagTypeMax
EVRScreenshotType
@ k_EVRScreenshotType_StereoPanorama
@ k_EVRScreenshotType_MonoPanorama
@ k_EVRScreenshotType_MonoCubemap
@ k_EVRScreenshotType_None
@ k_EVRScreenshotType_Mono
@ k_EVRScreenshotType_Stereo
const int k_cubUFSTagValueMax
const uint32 k_nScreenshotMaxTaggedUsers
ISteamScreenshots * SteamScreenshots()
#define STEAMSCREENSHOTS_INTERFACE_VERSION
const int k_ScreenshotThumbWidth
uint32 ScreenshotHandle
const uint32 k_nScreenshotMaxTaggedPublishedFiles
const char *typedef uint32(S_CALLTYPE *SteamAPI_CheckCallbackRegistered_t)(int iCallbackNum)
#define STEAM_DEFINE_USER_INTERFACE_ACCESSOR(type, name, version)
@ k_iSteamScreenshotsCallbacks
ScreenshotHandle m_hLocal