aboutsummaryrefslogtreecommitdiff
path: root/mp/src/public/materialsystem
diff options
context:
space:
mode:
authorJoe Ludwig <[email protected]>2013-12-03 08:54:16 -0800
committerJoe Ludwig <[email protected]>2013-12-03 08:54:16 -0800
commitbeaae8ac45a2f322a792404092d4482065bef7ef (patch)
tree747f35193ba235f0f0b070c05b53468a54559c8e /mp/src/public/materialsystem
parentMake .xcconfigs text files too. (diff)
downloadsource-sdk-2013-beaae8ac45a2f322a792404092d4482065bef7ef.tar.xz
source-sdk-2013-beaae8ac45a2f322a792404092d4482065bef7ef.zip
Updated the SDK with the latest code from the TF and HL2 branches
* Adds support for Visual Studio 2012 and 2013 * VR Mode: . Switches from headtrack.dll to sourcevr.dll . Improved readability of the UI in VR . Removed the IPD calibration tool. TF2 will now obey the Oculus configuration file. Use the Oculus calibration tool in your SDK or install and run "OpenVR" under Tools in Steam to calibrate your IPD. . Added dropdown to enable VR mode in the Video options. Removed the -vr command line option. . Added the ability to switch in and out of VR mode without quitting the game . By default VR mode will run full screen. To switch back to a borderless window set the vr_force_windowed convar. . Added support for VR mode on Linux * Many assorted bug fixes and other changes from Team Fortress in various shared files
Diffstat (limited to 'mp/src/public/materialsystem')
-rw-r--r--mp/src/public/materialsystem/imaterialsystem.h15
-rw-r--r--mp/src/public/materialsystem/materialsystem_config.h7
2 files changed, 20 insertions, 2 deletions
diff --git a/mp/src/public/materialsystem/imaterialsystem.h b/mp/src/public/materialsystem/imaterialsystem.h
index 9a16b9db..812eb262 100644
--- a/mp/src/public/materialsystem/imaterialsystem.h
+++ b/mp/src/public/materialsystem/imaterialsystem.h
@@ -524,7 +524,8 @@ enum RenderTargetSizeMode_t
RT_SIZE_FULL_FRAME_BUFFER=4, // Same size as frame buffer, or next lower power of 2 if we can't do that.
RT_SIZE_OFFSCREEN=5, // Target of specified size, don't mess with dimensions
RT_SIZE_FULL_FRAME_BUFFER_ROUNDED_UP=6, // Same size as the frame buffer, rounded up if necessary for systems that can't do non-power of two textures.
- RT_SIZE_REPLAY_SCREENSHOT = 7 // Rounded down to power of 2, essentially...
+ RT_SIZE_REPLAY_SCREENSHOT = 7, // Rounded down to power of 2, essentially...
+ RT_SIZE_LITERAL = 8 // Use the size passed in. Don't clamp it to the frame buffer size. Really.
};
typedef void (*MaterialBufferReleaseFunc_t)( );
@@ -1028,6 +1029,16 @@ public:
#ifdef DX_TO_GL_ABSTRACTION
virtual void DoStartupShaderPreloading( void ) = 0;
#endif
+
+ // Sets the override sizes for all render target size tests. These replace the frame buffer size.
+ // Set them when you are rendering primarily to something larger than the frame buffer (as in VR mode).
+ virtual void SetRenderTargetFrameBufferSizeOverrides( int nWidth, int nHeight ) = 0;
+
+ // Returns the (possibly overridden) framebuffer size for render target sizing.
+ virtual void GetRenderTargetFrameBufferDimensions( int & nWidth, int & nHeight ) = 0;
+
+ // returns the display device name that matches the adapter index we were started with
+ virtual char *GetDisplayDeviceName() const = 0;
};
@@ -1482,7 +1493,7 @@ public:
// Returns whether a pointer is render data. NOTE: passing NULL returns true
virtual bool IsRenderData( const void *pData ) const = 0;
virtual void PrintfVA( char *fmt, va_list vargs ) = 0;
- virtual void Printf( PRINTF_FORMAT_STRING char *fmt, ... ) = 0;
+ virtual void Printf( PRINTF_FORMAT_STRING const char *fmt, ... ) = 0;
virtual float Knob( char *knobname, float *setvalue = NULL ) = 0;
// Allows us to override the alpha write setting of a material
virtual void OverrideAlphaWriteEnable( bool bEnable, bool bAlphaWriteEnable ) = 0;
diff --git a/mp/src/public/materialsystem/materialsystem_config.h b/mp/src/public/materialsystem/materialsystem_config.h
index b0fe3a27..2908d2ce 100644
--- a/mp/src/public/materialsystem/materialsystem_config.h
+++ b/mp/src/public/materialsystem/materialsystem_config.h
@@ -33,6 +33,7 @@ enum MaterialSystem_Config_Flags_t
MATSYS_VIDCFG_FLAGS_SCALE_TO_OUTPUT_RESOLUTION = ( 1 << 14 ),
MATSYS_VIDCFG_FLAGS_USING_MULTIPLE_WINDOWS = ( 1 << 15 ),
MATSYS_VIDCFG_FLAGS_DISABLE_PHONG = ( 1 << 16 ),
+ MATSYS_VIDCFG_FLAGS_VR_MODE = ( 1 << 17 ),
};
struct MaterialSystemHardwareIdentifier_t
@@ -64,6 +65,7 @@ struct MaterialSystem_Config_t
bool ScaleToOutputResolution() const { return ( m_Flags & MATSYS_VIDCFG_FLAGS_SCALE_TO_OUTPUT_RESOLUTION ) != 0; }
bool UsingMultipleWindows() const { return ( m_Flags & MATSYS_VIDCFG_FLAGS_USING_MULTIPLE_WINDOWS ) != 0; }
bool UsePhong() const { return ( m_Flags & MATSYS_VIDCFG_FLAGS_DISABLE_PHONG ) == 0; }
+ bool VRMode() const { return ( m_Flags & MATSYS_VIDCFG_FLAGS_VR_MODE) != 0; }
bool ShadowDepthTexture() const { return m_bShadowDepthTexture; }
bool MotionBlur() const { return m_bMotionBlur; }
bool SupportFlashlight() const { return m_bSupportFlashlight; }
@@ -140,6 +142,8 @@ struct MaterialSystem_Config_t
bool m_bMotionBlur;
bool m_bSupportFlashlight;
+ int m_nVRModeAdapter;
+
MaterialSystem_Config_t()
{
memset( this, 0, sizeof( *this ) );
@@ -160,6 +164,7 @@ struct MaterialSystem_Config_t
SetFlag( MATSYS_VIDCFG_FLAGS_SCALE_TO_OUTPUT_RESOLUTION, false );
SetFlag( MATSYS_VIDCFG_FLAGS_USING_MULTIPLE_WINDOWS, false );
SetFlag( MATSYS_VIDCFG_FLAGS_DISABLE_PHONG, false );
+ SetFlag( MATSYS_VIDCFG_FLAGS_VR_MODE, false );
m_VideoMode.m_Width = 640;
m_VideoMode.m_Height = 480;
@@ -182,6 +187,8 @@ struct MaterialSystem_Config_t
m_bMotionBlur = false;
m_bSupportFlashlight = true;
+ m_nVRModeAdapter = -1;
+
// misc defaults
bAllowCheats = false;
bCompressedTextures = true;