1
0
mirror of https://github.com/alliedmodders/hl2sdk.git synced 2025-09-20 20:46:03 +08:00

Updated ILauncherMgr and shaderapiempty.

This commit is contained in:
Scott Ehlert
2017-07-11 04:13:01 -05:00
parent 6fd68f3835
commit 884ba15d3c
5 changed files with 81 additions and 16 deletions

View File

@ -16,7 +16,7 @@ SHADER_OBJ_DIR = $(BUILD_OBJ_DIR)/materialsystem/$(NAME)
INCLUDEDIRS = -I$(PUBLIC_SRC_DIR) -I$(MAT_SRC_DIR) -I$(MAT_PUBLIC_SRC_DIR) \ INCLUDEDIRS = -I$(PUBLIC_SRC_DIR) -I$(MAT_SRC_DIR) -I$(MAT_PUBLIC_SRC_DIR) \
-I $(SHADERAPI_PUBLIC_SRC_DIR) -I$(TIER0_PUBLIC_SRC_DIR) -I$(TIER1_PUBLIC_SRC_DIR) -I $(SHADERAPI_PUBLIC_SRC_DIR) -I$(TIER0_PUBLIC_SRC_DIR) -I$(TIER1_PUBLIC_SRC_DIR)
LDFLAGS_SHADER = -lm -ldl libtier0.$(SHLIBEXT) libvstdlib.$(SHLIBEXT) \ LDFLAGS_SHADER = -lm -ldl libtier0$(SHLIBSUFFIX).$(SHLIBEXT) libvstdlib$(SHLIBSUFFIX).$(SHLIBEXT) \
$(LIB_DIR)/tier1.a $(LIB_DIR)/interfaces.a $(LIB_DIR)/tier1.a $(LIB_DIR)/interfaces.a
DO_CC = $(CPLUS) $(INCLUDEDIRS) -DARCH=$(ARCH) DO_CC = $(CPLUS) $(INCLUDEDIRS) -DARCH=$(ARCH)
@ -34,22 +34,22 @@ DO_CC += -o $@ -c $<
SHADER_OBJS= \ SHADER_OBJS= \
$(SHADER_OBJ_DIR)/shaderapiempty.o \ $(SHADER_OBJ_DIR)/shaderapiempty.o \
all: dirs $(NAME).$(SHLIBEXT) all: dirs $(NAME)$(SHLIBSUFFIX).$(SHLIBEXT)
dirs: dirs:
-mkdir -p $(BUILD_OBJ_DIR) -mkdir -p $(BUILD_OBJ_DIR)
-mkdir -p $(SHADER_OBJ_DIR) -mkdir -p $(SHADER_OBJ_DIR)
$(NAME).$(SHLIBEXT): $(SHADER_OBJS) $(NAME)$(SHLIBSUFFIX).$(SHLIBEXT): $(SHADER_OBJS)
$(CPLUS) $(SHLIBLDFLAGS) -o $(BUILD_DIR)/$@ $(SHADER_OBJS) $(LDFLAGS_SHADER) $(CPP_LIB) $(CPLUS) $(SHLIBLDFLAGS) -o $(BUILD_DIR)/$@ $(SHADER_OBJS) $(LDFLAGS_SHADER) $(CPP_LIB)
$(SHADER_OBJ_DIR)/%.o: $(SHADER_SRC_DIR)/%.cpp $(SHADER_OBJ_DIR)/%.o: $(SHADER_SRC_DIR)/%.cpp
$(DO_CC) $(DO_CC)
install: install:
cp -f $(NAME).$(SHLIBEXT) $(LIB_DIR)/$(NAME).$(SHLIBEXT) cp -f $(NAME)$(SHLIBSUFFIX).$(SHLIBEXT) $(LIB_DIR)/$(NAME)$(SHLIBSUFFIX).$(SHLIBEXT)
clean: clean:
-rm -rf $(SHADER_OBJ_DIR) -rm -rf $(SHADER_OBJ_DIR)
-rm -rf $(NAME).$(SHLIBEXT) -rm -rf $(NAME)$(SHLIBSUFFIX).$(SHLIBEXT)

View File

@ -572,6 +572,12 @@ public:
virtual void BeginGeneratingCSMs(); virtual void BeginGeneratingCSMs();
virtual void EndGeneratingCSMs(); virtual void EndGeneratingCSMs();
virtual void PerpareForCascadeDraw( int, float, float ); virtual void PerpareForCascadeDraw( int, float, float );
virtual bool GetCSMAccurateBlending() const;
virtual void SetCSMAccurateBlending( bool bEnable );
virtual bool SupportsResolveDepth() const;
virtual bool HasFullResolutionDepthTexture() const;
virtual int NumBooleanPixelShaderConstants() const;
virtual int NumIntegerPixelShaderConstants() const;
private: private:
enum enum
{ {
@ -3217,3 +3223,34 @@ void CShaderAPIEmpty::PerpareForCascadeDraw( int, float, float )
{ {
} }
bool CShaderAPIEmpty::GetCSMAccurateBlending() const
{
return false;
}
void CShaderAPIEmpty::SetCSMAccurateBlending( bool bEnable )
{
}
bool CShaderAPIEmpty::SupportsResolveDepth() const
{
return false;
}
bool CShaderAPIEmpty::HasFullResolutionDepthTexture() const
{
return false;
}
int CShaderAPIEmpty::NumBooleanPixelShaderConstants() const
{
return 0;
}
int CShaderAPIEmpty::NumIntegerPixelShaderConstants() const
{
return 0;
}

View File

@ -33,6 +33,7 @@ class CShowPixelsParams;
#if defined(DEDICATED) #if defined(DEDICATED)
typedef void *PseudoGLContextPtr; typedef void *PseudoGLContextPtr;
class GLMRendererInfoFields; class GLMRendererInfoFields;
class SDL_Cursor;
#endif #endif
#endif // DX_TO_GL_ABSTRACTION #endif // DX_TO_GL_ABSTRACTION
@ -47,7 +48,7 @@ class ILauncherMgr : public IAppSystem
{ {
public: public:
// Create the window. // Create the window.
virtual bool CreateGameWindow( const char *pTitle, bool bWindowed, int width, int height ) = 0; virtual bool CreateGameWindow( const char *pTitle, bool bWindowed, int width, int height, bool bUnknown ) = 0;
#if defined( DX_TO_GL_ABSTRACTION ) #if defined( DX_TO_GL_ABSTRACTION )
virtual void GetDesiredPixelFormatAttribsAndRendererInfo( uint **ptrOut, uint *countOut, GLMRendererInfoFields *rendInfoOut ) = 0; virtual void GetDesiredPixelFormatAttribsAndRendererInfo( uint **ptrOut, uint *countOut, GLMRendererInfoFields *rendInfoOut ) = 0;
@ -60,13 +61,12 @@ public:
// Set the mouse cursor position. // Set the mouse cursor position.
virtual void SetCursorPosition( int x, int y ) = 0; virtual void SetCursorPosition( int x, int y ) = 0;
virtual void GetCursorPosition( int *x, int *y ) = 0;
#if defined( DX_TO_GL_ABSTRACTION ) #if defined( DX_TO_GL_ABSTRACTION )
virtual void ShowPixels( CShowPixelsParams *params ) = 0; virtual void ShowPixels( CShowPixelsParams *params ) = 0;
#endif #endif
virtual void SetWindowFullScreen( bool bFullScreen, int nWidth, int nHeight ) = 0; virtual void SetWindowFullScreen( bool bFullScreen, int nWidth, int nHeight, bool bUnknown ) = 0;
virtual bool IsWindowFullScreen() = 0; virtual bool IsWindowFullScreen() = 0;
virtual void MoveWindow( int x, int y ) = 0; virtual void MoveWindow( int x, int y ) = 0;
virtual void SizeWindow( int width, int tall ) = 0; virtual void SizeWindow( int width, int tall ) = 0;
@ -87,12 +87,6 @@ public:
virtual void WaitUntilUserInput( int msSleepTime ) = 0; virtual void WaitUntilUserInput( int msSleepTime ) = 0;
// Loads a cursor defined in a file
virtual InputCursorHandle_t LoadCursorFromFile( const char *pFileName ) = 0;
virtual void FreeCursor( InputCursorHandle_t hCursor ) = 0;
// Sets the cursor icon
virtual void SetCursorIcon( InputCursorHandle_t hCursor ) = 0;
#if defined( DX_TO_GL_ABSTRACTION ) #if defined( DX_TO_GL_ABSTRACTION )
virtual PseudoGLContextPtr GetMainContext() = 0; virtual PseudoGLContextPtr GetMainContext() = 0;
virtual PseudoGLContextPtr CreateExtraContext() = 0; virtual PseudoGLContextPtr CreateExtraContext() = 0;
@ -105,11 +99,31 @@ public:
virtual void *GetWindowRef() = 0; virtual void *GetWindowRef() = 0;
virtual void SetMouseVisible( bool bState ) = 0; virtual void SetMouseVisible( bool bState ) = 0;
virtual int GetActiveDisplayIndex() = 0;
virtual void SetMouseCursor(SDL_Cursor *pCursor) = 0;
virtual void SetForbidMouseGrab( bool bForbidMouseGrab ) = 0; virtual void SetForbidMouseGrab( bool bForbidMouseGrab ) = 0;
virtual void SetGammaRamp( const uint16 *pRed, const uint16 *pGreen, const uint16 *pBlue ) = 0; virtual void OnFrameRendered() = 0;
virtual void ForceSystemCursorVisible() = 0;
virtual void UnforceSystemCursorVisible() = 0;
virtual double GetPrevGLSwapWindowTime() = 0; virtual double GetPrevGLSwapWindowTime() = 0;
virtual void GetCursorPosition( int *x, int *y ) = 0;
// Loads a cursor defined in a file
virtual InputCursorHandle_t LoadCursorFromFile( const char *pFileName ) = 0;
virtual void FreeCursor( InputCursorHandle_t hCursor ) = 0;
// Sets the cursor icon
virtual void SetCursorIcon( InputCursorHandle_t hCursor ) = 0;
virtual void SetGammaRamp( const uint16 *pRed, const uint16 *pGreen, const uint16 *pBlue ) = 0;
}; };
extern ILauncherMgr *g_pLauncherMgr; extern ILauncherMgr *g_pLauncherMgr;

View File

@ -218,6 +218,19 @@ public:
virtual CSMQualityMode_t GetCSMQuality() const = 0; virtual CSMQualityMode_t GetCSMQuality() const = 0;
virtual bool SupportsBilinearPCFSampling() const = 0; virtual bool SupportsBilinearPCFSampling() const = 0;
virtual CSMShaderMode_t GetCSMShaderMode( CSMQualityMode_t nQualityLevel ) const = 0; virtual CSMShaderMode_t GetCSMShaderMode( CSMQualityMode_t nQualityLevel ) const = 0;
virtual bool GetCSMAccurateBlending() const = 0;
virtual void SetCSMAccurateBlending( bool bEnable ) = 0;
virtual bool SupportsResolveDepth() const = 0;
virtual bool HasFullResolutionDepthTexture() const = 0;
virtual const char *GetHWSpecificShaderDLLName() const = 0;
virtual bool HasStencilBuffer() const = 0;
virtual int NumBooleanVertexShaderConstants() const = 0;
virtual int NumIntegerVertexShaderConstants() const = 0;
virtual int NumBooleanPixelShaderConstants() const = 0;
virtual int NumIntegerPixelShaderConstants() const = 0;
}; };
#endif // IMATERIALSYSTEMHARDWARECONFIG_H #endif // IMATERIALSYSTEMHARDWARECONFIG_H

View File

@ -17,6 +17,7 @@
#include "tier0/dbg.h" #include "tier0/dbg.h"
#include <string.h> #include <string.h>
#include "tier0/platform.h" #include "tier0/platform.h"
#include "mathlib/mathlib.h"
#include "tier0/memalloc.h" #include "tier0/memalloc.h"
#include "tier0/memdbgon.h" #include "tier0/memdbgon.h"