Rise
The Vieneo Province
Loading...
Searching...
No Matches
isteamps3overlayrenderer.h
Go to the documentation of this file.
1//====== Copyright © 1996-2010, Valve Corporation, All rights reserved. =======
2//
3// Purpose: interface the game must provide Steam with on PS3 in order for the
4// Steam overlay to render.
5//
6//=============================================================================
7
8#ifndef ISTEAMPS3OVERLAYRENDERER_H
9#define ISTEAMPS3OVERLAYRENDERER_H
10#ifdef _WIN32
11#pragma once
12#endif
13
14#include "cell/pad.h"
15
16//-----------------------------------------------------------------------------
17// Purpose: Enum for supported gradient directions
18//-----------------------------------------------------------------------------
25
26// Helpers for fetching individual color components from ARGB packed DWORD colors Steam PS3 overlay renderer uses.
27#define STEAM_COLOR_RED( color ) \
28 (int)(((color)>>16)&0xff)
29
30#define STEAM_COLOR_GREEN( color ) \
31 (int)(((color)>>8)&0xff)
32
33#define STEAM_COLOR_BLUE( color ) \
34 (int)((color)&0xff)
35
36#define STEAM_COLOR_ALPHA( color ) \
37 (int)(((color)>>24)&0xff)
38
39
40//-----------------------------------------------------------------------------
41// Purpose: Interface the game must expose to Steam for rendering
42//-----------------------------------------------------------------------------
44{
45public:
46
47 // Interface for game engine to implement which Steam requires to render.
48
49 // Draw a textured rect. This may use only part of the texture and will pass texture coords, it will also possibly request a gradient and will specify colors for vertexes.
50 virtual void DrawTexturedRect( int x0, int y0, int x1, int y1, float u0, float v0, float u1, float v1, int32 iTextureID, DWORD colorStart, DWORD colorEnd, EOverlayGradientDirection eDirection ) = 0;
51
52 // Load a RGBA texture for Steam, or update a previously loaded one. Updates may be partial. You must not evict or remove this texture once Steam has uploaded it.
53 virtual void LoadOrUpdateTexture( int32 iTextureID, bool bIsFullTexture, int x0, int y0, uint32 uWidth, uint32 uHeight, int32 iBytes, char *pData ) = 0;
54
55 // Delete a texture Steam previously uploaded
56 virtual void DeleteTexture( int32 iTextureID ) = 0;
57
58 // Delete all previously uploaded textures
59 virtual void DeleteAllTextures() = 0;
60};
61
62
63//-----------------------------------------------------------------------------
64// Purpose: Interface Steam exposes for the game to tell it when to render, etc.
65//-----------------------------------------------------------------------------
67{
68public:
69
70 // Call once at startup to initialize the Steam overlay and pass it your host interface ptr
71 virtual bool BHostInitialize( uint32 unScreenWidth, uint32 unScreenHeight, uint32 unRefreshRate, ISteamPS3OverlayRenderHost *pRenderHost, void *CellFontLib ) = 0;
72
73 // Call this once a frame when you are ready for the Steam overlay to render (ie, right before flipping buffers, after all your rendering)
74 virtual void Render() = 0;
75
76 // Call this everytime you read input on PS3.
77 //
78 // If this returns true, then the overlay is active and has consumed the input, your game
79 // should then ignore all the input until BHandleCellPadData once again returns false, which
80 // will mean the overlay is deactivated.
81 virtual bool BHandleCellPadData( const CellPadData &padData ) = 0;
82
83 // Call this if you detect no controllers connected or that the XMB is intercepting input
84 //
85 // This is important to clear input state for the overlay, so keys left down during XMB activation
86 // are not continued to be processed.
87 virtual bool BResetInputState() = 0;
88};
89
90
91#endif // ISTEAMPS3OVERLAYRENDERER_H
SCRIPT_CONTROL SCRIPT_STATE const void DWORD
virtual void DeleteAllTextures()=0
virtual void DrawTexturedRect(int x0, int y0, int x1, int y1, float u0, float v0, float u1, float v1, int32 iTextureID, DWORD colorStart, DWORD colorEnd, EOverlayGradientDirection eDirection)=0
virtual void DeleteTexture(int32 iTextureID)=0
virtual void LoadOrUpdateTexture(int32 iTextureID, bool bIsFullTexture, int x0, int y0, uint32 uWidth, uint32 uHeight, int32 iBytes, char *pData)=0
virtual bool BHandleCellPadData(const CellPadData &padData)=0
virtual bool BHostInitialize(uint32 unScreenWidth, uint32 unScreenHeight, uint32 unRefreshRate, ISteamPS3OverlayRenderHost *pRenderHost, void *CellFontLib)=0
virtual bool BResetInputState()=0
virtual void Render()=0
EOverlayGradientDirection
@ k_EOverlayGradientHorizontal
@ k_EOverlayGradientVertical
@ k_EOverlayGradientNone
const char *typedef uint32(S_CALLTYPE *SteamAPI_CheckCallbackRegistered_t)(int iCallbackNum)
int int32
Definition steamtypes.h:57