sead
Loading...
Searching...
No Matches
sead::GraphicsCafe Class Reference

#include <seadGraphicsCafe.h>

Inherits sead::Graphics.

Classes

class  BlendExpression

Public Member Functions

 GraphicsCafe ()
virtual ~GraphicsCafe ()
GX2ContextState * getGX2ContextState ()
void setGX2ContextState (GX2ContextState *context_state)
Public Member Functions inherited from sead::Graphics
 Graphics ()
 ~Graphics () override
void setViewportRealPosition (f32 x, f32 y, f32 w, f32 h)
void setScissorRealPosition (f32 x, f32 y, f32 w, f32 h)
void setDepthEnable (bool test_enable, bool write_enable)
void setDepthFunc (Graphics::DepthFunc func)
void setBlendEnable (bool enable)
void setBlendFactor (BlendFactor src_factor, BlendFactor dst_factor)
void setBlendFactorSeparate (BlendFactor src_factor_rgb, BlendFactor dst_factor_rgb, BlendFactor src_factor_a, BlendFactor dst_factor_a)
void setBlendFactorMRT (u32 target, BlendFactor src_factor, BlendFactor dst_factor)
void setBlendFactorSeparateMRT (u32 target, BlendFactor src_factor_rgb, BlendFactor dst_factor_rgb, BlendFactor src_factor_a, BlendFactor dst_factor_a)
void setBlendEquation (BlendEquation equation)
void setBlendEquationSeparate (BlendEquation equation_rgb, BlendEquation equation_a)
void setBlendEquationMRT (u32 target, BlendEquation equation)
void setBlendEquationSeparateMRT (u32 target, BlendEquation equation_rgb, BlendEquation equation_a)
void setAlphaTestEnable (bool enable)
void lockDrawContext ()
void unlockDrawContext ()
Public Member Functions inherited from sead::IDisposer
 IDisposer ()
virtual ~IDisposer ()

Static Public Member Functions

static GraphicsCafeinstance ()
Static Public Member Functions inherited from sead::Graphics
static DevicePosture getDefaultDevicePosture ()
static f32 getDefaultDeviceZScale ()
static f32 getDefaultDeviceZOffset ()
static Graphicsinstance ()
static void setInstance (Graphics *impl)

Private Attributes

BitFlag32 mFlags
GX2CompareFunction mDepathCompareFunc
SafeArray< BlendExpression, cRenderTarget_NummBlendExpression
GX2CompareFunction mStencilCompareFunc
GX2StencilFunction mStencilStencilZPassFunction
GX2StencilFunction mStencilStencilZFailFunction
GX2StencilFunction mStencilStencilFailFunction
GX2CompareFunction mAlphaCompareFunc
f32 mAlphaTestRef
GX2ContextState * mContextState
BitFlag32 mBlendEnableMask
u32 mColorMask
GX2Boolean mIsCullFront
GX2Boolean mIsCullBack
GX2PolygonMode mPolygonModeFront
GX2PolygonMode mPolygonModeBack
GX2Boolean mPolygonOffsetFrontEnable
GX2Boolean mPolygonOffsetBackEnable
GX2Boolean mPolygonOffsetPointLineEnable

Additional Inherited Members

Public Types inherited from sead::Graphics
enum  DevicePosture {
  cDevicePosture_Same = 0 , cDevicePosture_RotateRight = 1 , cDevicePosture_RotateLeft = 2 , cDevicePosture_RotateHalfAround = 3 ,
  cDevicePosture_FlipX = 4 , cDevicePosture_FlipY = 5 , cDevicePosture_FlipXY = 3 , cDevicePosture_Invalid = 4
}
enum  DepthFunc {
  cDepthFunc_Never = GX2_COMPARE_NEVER , cDepthFunc_Less = GX2_COMPARE_LESS , cDepthFunc_Equal = GX2_COMPARE_EQUAL , cDepthFunc_LessEqual = GX2_COMPARE_LEQUAL ,
  cDepthFunc_Greater = GX2_COMPARE_GREATER , cDepthFunc_NotEqual = GX2_COMPARE_NOTEQUAL , cDepthFunc_GreaterEqual = GX2_COMPARE_GEQUAL , cDepthFunc_Always = GX2_COMPARE_ALWAYS
}
enum  CullingMode { cCullingMode_Front = 0 , cCullingMode_Back = 1 , cCullingMode_None = 2 , cCullingMode_All = 3 }
enum  BlendFactor {
  cBlendFactor_Zero = GX2_BLEND_ZERO , cBlendFactor_One = GX2_BLEND_ONE , cBlendFactor_SrcColor = GX2_BLEND_SRC_COLOR , cBlendFactor_InvSrcColor = GX2_BLEND_ONE_MINUS_SRC_COLOR ,
  cBlendFactor_SrcAlpha = GX2_BLEND_SRC_ALPHA , cBlendFactor_InvSrcAlpha = GX2_BLEND_ONE_MINUS_SRC_ALPHA , cBlendFactor_DstAlpha = GX2_BLEND_DST_ALPHA , cBlendFactor_InvDstAlpha = GX2_BLEND_ONE_MINUS_DST_ALPHA ,
  cBlendFactor_DstColor = GX2_BLEND_DST_COLOR , cBlendFactor_InvDstColor = GX2_BLEND_ONE_MINUS_DST_COLOR , cBlendFactor_SrcAlphaSaturate = GX2_BLEND_SRC_ALPHA_SATURATE , cBlendFactor_ConstantColor = GX2_BLEND_CONSTANT_COLOR ,
  cBlendFactor_InvConstantColor = GX2_BLEND_ONE_MINUS_CONSTANT_COLOR , cBlendFactor_ConstantAlpha = GX2_BLEND_CONSTANT_ALPHA , cBlendFactor_InvConstantAlpha = GX2_BLEND_ONE_MINUS_CONSTANT_ALPHA
}
enum  BlendEquation {
  cBlendEquation_Add = GX2_BLEND_COMBINE_ADD , cBlendEquation_Sub = GX2_BLEND_COMBINE_SRC_MINUS_DST , cBlendEquation_Min = GX2_BLEND_COMBINE_MIN , cBlendEquation_Max = GX2_BLEND_COMBINE_MAX ,
  cBlendEquation_ReverseSub = GX2_BLEND_COMBINE_DST_MINUS_SRC
}
enum  AlphaFunc {
  cAlphaFunc_Never = GX2_COMPARE_NEVER , cAlphaFunc_Less = GX2_COMPARE_LESS , cAlphaFunc_Equal = GX2_COMPARE_EQUAL , cAlphaFunc_LessEqual = GX2_COMPARE_LEQUAL ,
  cAlphaFunc_Greater = GX2_COMPARE_GREATER , cAlphaFunc_NotEqual = GX2_COMPARE_NOTEQUAL , cAlphaFunc_GreaterEqual = GX2_COMPARE_GEQUAL , cAlphaFunc_Always = GX2_COMPARE_ALWAYS
}
enum  StencilFunc {
  cStencilFunc_Never = GX2_COMPARE_NEVER , cStencilFunc_Less = GX2_COMPARE_LESS , cStencilFunc_Equal = GX2_COMPARE_EQUAL , cStencilFunc_LessEqual = GX2_COMPARE_LEQUAL ,
  cStencilFunc_Greater = GX2_COMPARE_GREATER , cStencilFunc_NotEqual = GX2_COMPARE_NOTEQUAL , cStencilFunc_GreaterEqual = GX2_COMPARE_GEQUAL , cStencilFunc_Always = GX2_COMPARE_ALWAYS
}
enum  StencilOp {
  cStencilOp_Keep = GX2_STENCIL_KEEP , cStencilOp_Zero = GX2_STENCIL_ZERO , cStencilOp_Replace = GX2_STENCIL_REPLACE , cStencilOp_Increment = GX2_STENCIL_INCR ,
  cStencilOp_Decrement = GX2_STENCIL_DECR , cStencilOp_Invert = GX2_STENCIL_INVERT , cStencilOp_IncrementWrap = GX2_STENCIL_INCR_WRAP , cStencilOp_DecrementWrap = GX2_STENCIL_DECR_WRAP
}
enum  PolygonMode { cPolygonMode_Point = GX2_POLYGON_MODE_POINT , cPolygonMode_Line = GX2_POLYGON_MODE_LINE , cPolygonMode_Fill = GX2_POLYGON_MODE_TRIANGLE }
Static Public Attributes inherited from sead::Graphics
static const u32 cRenderTarget_Num = 8
Protected Member Functions inherited from sead::Graphics
virtual void initializeImpl ()
virtual void setViewportImpl (f32 x, f32 y, f32 w, f32 h)
virtual void setScissorImpl (f32 x, f32 y, f32 w, f32 h)
virtual void setDepthTestEnableImpl (bool enable)
virtual void setDepthWriteEnableImpl (bool enable)
virtual void setDepthFuncImpl (DepthFunc func)
virtual bool setVBlankWaitIntervalImpl (u32 interval)
virtual void setCullingModeImpl (CullingMode mode)
virtual void setBlendEnableImpl (bool enable)
virtual void setBlendEnableMRTImpl (u32 target, bool enable)
virtual void setBlendFactorImpl (BlendFactor src_factor_rgb, BlendFactor dst_factor_rgb, BlendFactor src_factor_a, BlendFactor dst_factor_a)
virtual void setBlendFactorMRTImpl (u32 target, BlendFactor src_factor_rgb, BlendFactor dst_factor_rgb, BlendFactor src_factor_a, BlendFactor dst_factor_a)
virtual void setBlendEquationImpl (BlendEquation equation_rgb, BlendEquation equation_a)
virtual void setBlendEquationMRTImpl (u32 target, BlendEquation equation_rgb, BlendEquation equation_a)
virtual void setBlendConstantColorImpl (const Color4f &color)
virtual void lockDrawContextImpl ()
virtual void unlockDrawContextImpl ()
virtual void waitForVBlankImpl ()
virtual void setColorMaskImpl (bool r, bool g, bool b, bool a)
virtual void setColorMaskMRTImpl (u32 target, bool r, bool g, bool b, bool a)
virtual void setAlphaTestEnableImpl (bool enable)
virtual void setAlphaTestFuncImpl (AlphaFunc func, f32 ref)
virtual void setStencilTestEnableImpl (bool enable)
virtual void setStencilTestFuncImpl (StencilFunc func, s32 ref, u32 mask)
virtual void setStencilTestOpImpl (StencilOp fail, StencilOp zfail, StencilOp zpass)
virtual void setPolygonModeImpl (PolygonMode front, PolygonMode back)
virtual void setPolygonOffsetEnableImpl (bool fill_front_enable, bool fill_back_enable, bool point_line_enable)
Protected Attributes inherited from sead::Graphics
ThreadmContextHolderThread
s32 mContextRefCounter
CriticalSection mContextCriticalSection
Static Protected Attributes inherited from sead::Graphics
static GraphicssInstance = nullptr
static DevicePosture sDefaultDevicePosture = Graphics::cDevicePosture_Same
static f32 sDefaultDeviceZScale = 1.0f
static f32 sDefaultDeviceZOffset = 0.0f

Constructor & Destructor Documentation

◆ GraphicsCafe()

sead::GraphicsCafe::GraphicsCafe ( )
inline

◆ ~GraphicsCafe()

virtual sead::GraphicsCafe::~GraphicsCafe ( )
virtual

Member Function Documentation

◆ instance()

GraphicsCafe * sead::GraphicsCafe::instance ( )
inlinestatic

◆ getGX2ContextState()

GX2ContextState * sead::GraphicsCafe::getGX2ContextState ( )
inline

◆ setGX2ContextState()

void sead::GraphicsCafe::setGX2ContextState ( GX2ContextState * context_state)
inline

Member Data Documentation

◆ mFlags

BitFlag32 sead::GraphicsCafe::mFlags
private

◆ mDepathCompareFunc

GX2CompareFunction sead::GraphicsCafe::mDepathCompareFunc
private

◆ mBlendExpression

SafeArray<BlendExpression, cRenderTarget_Num> sead::GraphicsCafe::mBlendExpression
private

◆ mStencilCompareFunc

GX2CompareFunction sead::GraphicsCafe::mStencilCompareFunc
private

◆ mStencilStencilZPassFunction

GX2StencilFunction sead::GraphicsCafe::mStencilStencilZPassFunction
private

◆ mStencilStencilZFailFunction

GX2StencilFunction sead::GraphicsCafe::mStencilStencilZFailFunction
private

◆ mStencilStencilFailFunction

GX2StencilFunction sead::GraphicsCafe::mStencilStencilFailFunction
private

◆ mAlphaCompareFunc

GX2CompareFunction sead::GraphicsCafe::mAlphaCompareFunc
private

◆ mAlphaTestRef

f32 sead::GraphicsCafe::mAlphaTestRef
private

◆ mContextState

GX2ContextState* sead::GraphicsCafe::mContextState
private

◆ mBlendEnableMask

BitFlag32 sead::GraphicsCafe::mBlendEnableMask
private

◆ mColorMask

u32 sead::GraphicsCafe::mColorMask
private

◆ mIsCullFront

GX2Boolean sead::GraphicsCafe::mIsCullFront
private

◆ mIsCullBack

GX2Boolean sead::GraphicsCafe::mIsCullBack
private

◆ mPolygonModeFront

GX2PolygonMode sead::GraphicsCafe::mPolygonModeFront
private

◆ mPolygonModeBack

GX2PolygonMode sead::GraphicsCafe::mPolygonModeBack
private

◆ mPolygonOffsetFrontEnable

GX2Boolean sead::GraphicsCafe::mPolygonOffsetFrontEnable
private

◆ mPolygonOffsetBackEnable

GX2Boolean sead::GraphicsCafe::mPolygonOffsetBackEnable
private

◆ mPolygonOffsetPointLineEnable

GX2Boolean sead::GraphicsCafe::mPolygonOffsetPointLineEnable
private