Commit 302560a0 authored by D-AIRY's avatar D-AIRY

Updated for new GraphiX

parent 689e1962
Subproject commit 4c488f0c048793550e4c1b9551059cb78554e1ff
Subproject commit 760d08ff9d3ac024bb691a8612e09ff4103ae419
......@@ -42,7 +42,7 @@ void XMETHODCALLTYPE CRenderable::renderStage(X_RENDER_STAGE stage, IXRenderable
}
}
void XMETHODCALLTYPE CRenderable::startup(IGXContext *pDevice, IXMaterialSystem *pMaterialSystem)
void XMETHODCALLTYPE CRenderable::startup(IGXDevice *pDevice, IXMaterialSystem *pMaterialSystem)
{
m_pDevice = pDevice;
m_pMaterialSystem = pMaterialSystem;
......
......@@ -30,7 +30,7 @@ public:
{
}
void XMETHODCALLTYPE startup(IGXContext *pDevice, IXMaterialSystem *pMaterialSystem) override;
void XMETHODCALLTYPE startup(IGXDevice *pDevice, IXMaterialSystem *pMaterialSystem) override;
void XMETHODCALLTYPE shutdown() override;
//! Создает новый объект просчета видимости для системы
......@@ -38,7 +38,7 @@ public:
IXMaterialSystem *getMaterialSystem();
protected:
IGXContext *m_pDevice = NULL;
IGXDevice *m_pDevice = NULL;
IXMaterialSystem *m_pMaterialSystem = NULL;
ID m_idPlugin = -1;
......
......@@ -7,7 +7,7 @@ See the license in LICENSE
#include "SkyBox.h"
void CSkyBox::setDevice(IGXContext *pDevice)
void CSkyBox::setDevice(IGXDevice *pDevice)
{
m_pDevice = pDevice;
......@@ -188,10 +188,12 @@ void CSkyBox::render()
//static ID s_idShader = SGCore_ShaderCreateKit(m_idVS, m_idPS);
//SGCore_ShaderBind(s_idShader);
m_pDevice->setIndexBuffer(m_pIndeces);
m_pDevice->setRenderBuffer(m_pRenderBuffer);
m_pDevice->setPrimitiveTopology(GXPT_TRIANGLELIST);
m_pDevice->drawIndexed(8, 12, 0, 0);
IGXContext *pCtx = m_pDevice->getDirectContext();
pCtx->setIndexBuffer(m_pIndeces);
pCtx->setRenderBuffer(m_pRenderBuffer);
pCtx->setPrimitiveTopology(GXPT_TRIANGLELIST);
pCtx->drawIndexed(8, 12, 0, 0);
//SGCore_ShaderUnBind();
};
......
......@@ -38,7 +38,7 @@ class CSkyBox
public:
SX_ALIGNED_OP_MEM2();
void setDevice(IGXContext *pDevice);
void setDevice(IGXDevice *pDevice);
void setMaterialSystem(IXMaterialSystem *pMaterialSystem);
//! загрузка текстуры
......@@ -99,7 +99,7 @@ protected:
IGXIndexBuffer *m_pIndeces = NULL;
IGXRenderBuffer *m_pRenderBuffer = NULL;
IGXContext *m_pDevice = NULL;
IGXDevice *m_pDevice = NULL;
IXMaterialSystem *m_pMaterialSystem = NULL;
};
......
......@@ -749,8 +749,10 @@ void XMETHODCALLTYPE CAnimatedModel::render(UINT uLod, bool isTransparent)
m_isWorldDirty = false;
}
m_pDevice->setVertexShaderConstant(m_pWorldBuffer, 1 /* SCR_OBJECT */);
m_pDevice->setVertexShaderConstant(m_pBoneConstantBuffer, 10);
IGXContext *pCtx = m_pDevice->getDirectContext();
pCtx->setVSConstant(m_pWorldBuffer, 1 /* SCR_OBJECT */);
pCtx->setVSConstant(m_pBoneConstantBuffer, 10);
m_pShared->render(m_uSkin, uLod, m_vColor);
}
......
......@@ -13,9 +13,9 @@ public:
bool XMETHODCALLTYPE isEnabled() const override;
void XMETHODCALLTYPE enable(bool yesNo) override;
IXAnimatedModel * XMETHODCALLTYPE asAnimatedModel() override;
IXDynamicModel * XMETHODCALLTYPE asDynamicModel() override;
IXStaticModel * XMETHODCALLTYPE asStaticModel() override;
IXAnimatedModel* XMETHODCALLTYPE asAnimatedModel() override;
IXDynamicModel* XMETHODCALLTYPE asDynamicModel() override;
IXStaticModel* XMETHODCALLTYPE asStaticModel() override;
float3 XMETHODCALLTYPE getPosition() const override;
......@@ -37,20 +37,20 @@ public:
void XMETHODCALLTYPE setColor(const float4 &vColor) override;
UINT XMETHODCALLTYPE getPhysboxCount(UINT uPartIndex = 0) const override;
const IModelPhysbox * XMETHODCALLTYPE getPhysBox(UINT id, UINT uPartIndex = 0) const override;
const IXResourceModel * XMETHODCALLTYPE getResource(UINT uIndex = 0) override;
const IModelPhysbox* XMETHODCALLTYPE getPhysBox(UINT id, UINT uPartIndex = 0) const override;
const IXResourceModel* XMETHODCALLTYPE getResource(UINT uIndex = 0) override;
UINT XMETHODCALLTYPE getPartsCount() const override;
const char * XMETHODCALLTYPE getPartName(UINT uIndex) const override;
const char* XMETHODCALLTYPE getPartName(UINT uIndex) const override;
UINT XMETHODCALLTYPE getPartIndex(const char *szName) override;
XMODEL_PART_FLAGS XMETHODCALLTYPE getPartFlags(UINT uIndex) const override;
bool XMETHODCALLTYPE isPartEnabled(UINT uIndex) const override;
void XMETHODCALLTYPE enablePart(UINT uIndex, bool yesNo) override;
UINT XMETHODCALLTYPE getHitboxCount(UINT uPartIndex = 0) const override;
const XResourceModelHitbox * XMETHODCALLTYPE getHitbox(UINT id, UINT uPartIndex = 0) const override;
const XResourceModelHitbox* XMETHODCALLTYPE getHitbox(UINT id, UINT uPartIndex = 0) const override;
void XMETHODCALLTYPE play(const char *szName, UINT uFadeTime = 0, UINT uSlot = 0, bool bReplaceActivity = true) override;
void XMETHODCALLTYPE stop(UINT uSlot = 0) override;
......@@ -65,7 +65,7 @@ public:
UINT XMETHODCALLTYPE getBoneId(const char *szName) override;
UINT XMETHODCALLTYPE getBoneCount() const override;
const char * XMETHODCALLTYPE getBoneName(UINT id) const override;
const char* XMETHODCALLTYPE getBoneName(UINT id) const override;
bool XMETHODCALLTYPE isPlayingAnimations() override;
bool XMETHODCALLTYPE isPlayingAnimation(const char *szName) override;
......@@ -73,7 +73,7 @@ public:
void XMETHODCALLTYPE setController(UINT id, float fValue) override;
UINT XMETHODCALLTYPE getControllersCount() const override;
const char * XMETHODCALLTYPE getControllerName(UINT id) override;
const char* XMETHODCALLTYPE getControllerName(UINT id) override;
UINT XMETHODCALLTYPE getControllerId(const char *szName) override;
void XMETHODCALLTYPE setCallback(IAnimationCallback *pCallback) override;
......@@ -89,7 +89,7 @@ public:
protected:
CAnimatedModelProvider *m_pProvider;
CAnimatedModelShared *m_pShared;
IGXContext *m_pDevice;
IGXDevice *m_pDevice;
float3_t m_vPosition;
SMQuaternion m_qRotation;
......
......@@ -17,7 +17,7 @@ IGXVertexDeclaration *CAnimatedModelProvider::getVertexDeclaration()
return(m_pVertexDeclaration);
}
IGXContext *CAnimatedModelProvider::getDevice()
IGXDevice *CAnimatedModelProvider::getDevice()
{
return(m_pRenderContext);
}
......@@ -27,7 +27,7 @@ IXCore* CAnimatedModelProvider::getCore()
return(m_pCore);
}
void CAnimatedModelProvider::setDevice(IGXContext *pDevice)
void CAnimatedModelProvider::setDevice(IGXDevice *pDevice)
{
m_pRenderContext = pDevice;
......
......@@ -20,9 +20,9 @@ public:
void onSharedModelRelease(CAnimatedModelShared *pShared);
void onModelRelease(CAnimatedModel *pModel);
IXMaterialSystem *getMaterialSystem();
IGXContext *getDevice();
IGXDevice *getDevice();
IXCore* getCore();
void setDevice(IGXContext *pContext);
void setDevice(IGXDevice *pDevice);
IGXVertexDeclaration *getVertexDeclaration();
void update(float fDT);
......@@ -43,7 +43,7 @@ protected:
IGXVertexDeclaration *m_pVertexDeclaration = NULL;
IXCore *m_pCore;
IGXContext *m_pRenderContext = NULL;
IGXDevice *m_pRenderContext = NULL;
CConcurrentQueue<CAnimatedModelShared*> m_queueGPUinitShared;
CConcurrentQueue<CAnimatedModel*> m_queueGPUinitModel;
......
......@@ -1080,9 +1080,11 @@ void CAnimatedModelShared::render(UINT uSkin, UINT uLod, const float4_t &vColor)
return;
}
m_pDevice->setIndexBuffer(m_ppIndexBuffer[uLod]);
m_pDevice->setRenderBuffer(m_ppRenderBuffer[uLod]);
m_pDevice->setPrimitiveTopology(GXPT_TRIANGLELIST);
IGXContext *pCtx = m_pDevice->getDirectContext();
pCtx->setIndexBuffer(m_ppIndexBuffer[uLod]);
pCtx->setRenderBuffer(m_ppRenderBuffer[uLod]);
pCtx->setPrimitiveTopology(GXPT_TRIANGLELIST);
for(UINT i = 0; i < m_uMaterialCount; ++i)
{
......@@ -1122,7 +1124,7 @@ void CAnimatedModelShared::render(UINT uSkin, UINT uLod, const float4_t &vColor)
if(subset.uIndexCount != 0)
{
m_pMaterialSystem->bindMaterial(m_pppMaterials[uSkin][i]);
m_pDevice->drawIndexed(subset.uVertexCount, subset.uIndexCount / 3, subset.uStartIndex, subset.uStartVertex);
pCtx->drawIndexed(subset.uVertexCount, subset.uIndexCount / 3, subset.uStartIndex, subset.uStartVertex);
}
}
}
......@@ -76,7 +76,7 @@ protected:
UINT *m_puTempTotalVertices = 0;
CAnimatedModelProvider *m_pProvider;
IGXContext *m_pDevice;
IGXDevice *m_pDevice;
IXMaterialSystem *m_pMaterialSystem;
Array<const char*> m_aszActivities;
......
......@@ -198,7 +198,7 @@ void XMETHODCALLTYPE CDynamicModel::render(UINT uLod, bool isTransparent)
m_isWorldDirty = false;
}
m_pDevice->setVertexShaderConstant(m_pWorldBuffer, 1 /* SCR_OBJECT */);
m_pDevice->getDirectContext()->setVSConstant(m_pWorldBuffer, 1 /* SCR_OBJECT */);
m_pShared->render(m_uSkin, uLod, m_vColor, isTransparent);
}
......
......@@ -52,7 +52,7 @@ public:
protected:
CDynamicModelProvider *m_pProvider;
CDynamicModelShared *m_pShared;
IGXContext *m_pDevice;
IGXDevice *m_pDevice;
IGXConstantBuffer *m_pWorldBuffer = NULL;
bool m_isWorldDirty = true;
......
......@@ -35,7 +35,7 @@ IGXVertexDeclaration *CDynamicModelProvider::getVertexDeclaration()
return(m_pVertexDeclaration);
}
IGXContext* CDynamicModelProvider::getDevice()
IGXDevice* CDynamicModelProvider::getDevice()
{
return(m_pRenderContext);
}
......@@ -45,7 +45,7 @@ IXCore* CDynamicModelProvider::getCore()
return(m_pCore);
}
void CDynamicModelProvider::setDevice(IGXContext *pDevice)
void CDynamicModelProvider::setDevice(IGXDevice *pDevice)
{
m_pRenderContext = pDevice;
......
......@@ -34,9 +34,9 @@ public:
void onSharedModelRelease(CDynamicModelShared *pShared);
void onModelRelease(CDynamicModel *pModel);
IXMaterialSystem* getMaterialSystem();
IGXContext* getDevice();
IGXDevice* getDevice();
IXCore* getCore();
void setDevice(IGXContext *pContext);
void setDevice(IGXDevice *pContext);
IGXVertexDeclaration *getVertexDeclaration();
void render(bool isTransparent, CRenderableVisibility *pVisibility = NULL);
......@@ -66,7 +66,7 @@ protected:
IGXVertexDeclaration *m_pVertexDeclaration = NULL;
IXCore *m_pCore;
IGXContext *m_pRenderContext = NULL;
IGXDevice *m_pRenderContext = NULL;
CConcurrentQueue<CDynamicModelShared*> m_queueGPUinitShared;
CConcurrentQueue<CDynamicModel*> m_queueGPUinitModel;
......
......@@ -343,16 +343,18 @@ void CDynamicModelShared::render(UINT uSkin, UINT uLod, const float4_t &vColor,
return;
}
m_pDevice->setIndexBuffer(m_ppIndexBuffer[uLod]);
m_pDevice->setRenderBuffer(m_ppRenderBuffer[uLod]);
IGXContext *pCtx = m_pDevice->getDirectContext();
pCtx->setIndexBuffer(m_ppIndexBuffer[uLod]);
pCtx->setRenderBuffer(m_ppRenderBuffer[uLod]);
switch(m_topology)
{
case XPT_TRIANGLELIST:
m_pDevice->setPrimitiveTopology(GXPT_TRIANGLELIST);
pCtx->setPrimitiveTopology(GXPT_TRIANGLELIST);
break;
case XPT_TRIANGLESTRIP:
m_pDevice->setPrimitiveTopology(GXPT_TRIANGLESTRIP);
pCtx->setPrimitiveTopology(GXPT_TRIANGLESTRIP);
break;
}
......@@ -377,7 +379,7 @@ void CDynamicModelShared::render(UINT uSkin, UINT uLod, const float4_t &vColor,
break;
}
m_pDevice->drawIndexed(pSubset->uVertexCount, uPrimCount, pSubset->uStartIndex, pSubset->uStartVertex);
pCtx->drawIndexed(pSubset->uVertexCount, uPrimCount, pSubset->uStartIndex, pSubset->uStartVertex);
}
}
}
......
......@@ -55,7 +55,7 @@ protected:
UINT *m_puTempTotalVertices = 0;
CDynamicModelProvider *m_pProvider;
IGXContext *m_pDevice;
IGXDevice *m_pDevice;
IXMaterialSystem *m_pMaterialSystem;
void **m_ppMaterialsBlob = NULL;
......
......@@ -75,7 +75,7 @@ void XMETHODCALLTYPE CRenderable::renderTransparentObject(IXRenderableVisibility
m_pDynamicModelProvider->renderTransparentObject((CRenderableVisibility*)pVisibility, uIndex, uSplitPlanes);
}
void XMETHODCALLTYPE CRenderable::startup(IGXContext *pDevice, IXMaterialSystem *pMaterialSystem)
void XMETHODCALLTYPE CRenderable::startup(IGXDevice *pDevice, IXMaterialSystem *pMaterialSystem)
{
m_pDevice = pDevice;
m_pMaterialSystem = pMaterialSystem;
......
......@@ -28,7 +28,7 @@ public:
void XMETHODCALLTYPE renderTransparentObject(IXRenderableVisibility *pVisibility, UINT uIndex, UINT uSplitPlanes) override;
//! @}
void XMETHODCALLTYPE startup(IGXContext *pDevice, IXMaterialSystem *pMaterialSystem) override;
void XMETHODCALLTYPE startup(IGXDevice *pDevice, IXMaterialSystem *pMaterialSystem) override;
void XMETHODCALLTYPE shutdown() override;
//! Создает новый объект просчета видимости для системы
......@@ -36,7 +36,7 @@ public:
IXMaterialSystem* getMaterialSystem();
protected:
IGXContext *m_pDevice = NULL;
IGXDevice *m_pDevice = NULL;
IXMaterialSystem *m_pMaterialSystem = NULL;
ID m_idPlugin = -1;
......
......@@ -91,9 +91,6 @@ public:
case GXFMT_A8R8G8B8:
return(32);
case GXFMT_R8G8B8:
return(24);
case GXFMT_D16:
case GXFMT_R16F:
case GXFMT_R5G6B5:
......
......@@ -87,7 +87,7 @@ void CAxesHelper::render()
static float3 vCamPos;
Core_RFloat3Get(G_RI_FLOAT3_OBSERVER_POSITION, &vCamPos);
SGCore_GetDXDevice()->setTexture(NULL);
SGCore_GetDXDevice()->getDirectContext()->setPSTexture(NULL);
// SGCore_GetDXDevice()->SetFVF(D3DFVF_XYZ | D3DFVF_DIFFUSE);
SGCore_ShaderUnBind();
......
......@@ -12,7 +12,7 @@ CEditable::CEditable(IXCore *pCore)
m_pCore = pCore;
}
void CEditable::startup(IGXContext *pDevice)
void CEditable::startup(IGXDevice *pDevice)
{
m_pDevice = pDevice;
......
......@@ -14,29 +14,29 @@ public:
CEditable(IXCore *pCore);
~CEditable();
UINT getObjectCount();
IXEditorObject *getObject(UINT id);
IXEditorObject *newObject(const char *szClassName);
UINT getObjectCount() override;
IXEditorObject* getObject(UINT id) override;
IXEditorObject* newObject(const char *szClassName) override;
const char *getName()
const char* getName() override
{
return("Entity");
}
UINT getClassCount()
UINT getClassCount() override
{
return(CEntityFactoryMap::GetInstance()->getListCount());
}
const char *getClass(UINT id)
const char* getClass(UINT id) override
{
assert(id < getClassCount());
return(m_pszClassList[id]);
}
void startup(IGXContext *pDevice);
void shutdown();
void startup(IGXDevice *pDevice) override;
void shutdown() override;
protected:
IGXContext *m_pDevice = NULL;
IGXDevice *m_pDevice = NULL;
IXCore *m_pCore = NULL;
IXMaterialSystem *m_pMaterialSystem = NULL;
......
......@@ -145,26 +145,28 @@ void CEditorObject::renderSelection(bool is3D)
return;
}
IGXContext *pDevice = SGCore_GetDXDevice();
IGXBlendState *pOldBlendState = pDevice->getBlendState();
IGXRasterizerState *pOldRS = pDevice->getRasterizerState();
IGXDevice *pDevice = SGCore_GetDXDevice();
IGXContext *pCtx = pDevice->getDirectContext();
IGXBlendState *pOldBlendState = pCtx->getBlendState();
IGXRasterizerState *pOldRS = pCtx->getRasterizerState();
m_pEditable->m_pMaterialSystem->bindTexture(m_pEditable->m_pWhiteTexture);
//pDevice->setTexture(m_pEditable->m_pWhiteTexture);
pDevice->setBlendState(m_pEditable->m_pBlendColorFactor);
pCtx->setBlendState(m_pEditable->m_pBlendColorFactor);
if(is3D)
{
pDevice->setBlendFactor(GX_COLOR_ARGB(70, 255, 0, 0));
pCtx->setBlendFactor(GX_COLOR_ARGB(70, 255, 0, 0));
m_pEntity->renderEditor(is3D);
}
pDevice->setRasterizerState(m_pEditable->m_pRSWireframe);
pDevice->setBlendFactor(GX_COLOR_ARGB(255, 255, 255, 0));
pCtx->setRasterizerState(m_pEditable->m_pRSWireframe);
pCtx->setBlendFactor(GX_COLOR_ARGB(255, 255, 255, 0));
m_pEntity->renderEditor(is3D);
pDevice->setBlendState(pOldBlendState);
pDevice->setRasterizerState(pOldRS);
pCtx->setBlendState(pOldBlendState);
pCtx->setRasterizerState(pOldRS);
mem_release(pOldBlendState);
mem_release(pOldRS);
}
......
......@@ -1217,7 +1217,7 @@ void GameData::render()
//g_pTracer2->render();
//m_pStatsUI->render(0.1f);
IGXContext *pDev = SGCore_GetDXDevice();
IGXDevice *pDev = SGCore_GetDXDevice();
++g_uFrameCount;
static int64_t s_uTime = Core_TimeTotalMlsGetU(Core_RIntGet(G_RI_INT_TIMER_RENDER));
......@@ -1230,7 +1230,7 @@ void GameData::render()
}
if(pDev)
{
const GXFrameStats *pFrameStats = pDev->getFrameStats();
const GXFrameStats *pFrameStats = pDev->getDirectContext()->getFrameStats();
const GXAdapterMemoryStats *pMemoryStats = pDev->getMemoryStats();
static GXFrameStats s_oldFrameStats = {0};
......@@ -1281,10 +1281,12 @@ void GameData::render()
}
if(g_pTextRenderBuffer)
{
pDev->setBlendState(g_pTextBlendState);
pDev->setRasterizerState(NULL);
pDev->setDepthStencilState(g_pTextDepthState);
pDev->setSamplerState(NULL, 0);
IGXContext *pContext = pDev->getDirectContext();
pContext->setBlendState(g_pTextBlendState);
pContext->setRasterizerState(NULL);
pContext->setDepthStencilState(g_pTextDepthState);
pContext->setSamplerState(NULL, 0);
static const int *r_win_width = GET_PCVAR_INT("r_win_width");
static const int *r_win_height = GET_PCVAR_INT("r_win_height");
......@@ -1301,17 +1303,17 @@ void GameData::render()
g_pTextPSConstantBuffer->update(&float4_t(0, 0, 0, 1.0f));
SGCore_ShaderBind(g_idTextKit);
pDev->setRenderBuffer(g_pTextRenderBuffer);
pDev->setIndexBuffer(g_pTextIndexBuffer);
pDev->setTexture((IGXTexture2D*)g_pFont->getAPITexture(0));
pDev->setPrimitiveTopology(GXPT_TRIANGLELIST);
pDev->setVertexShaderConstant(g_pTextVSConstantBuffer);
pDev->setPixelShaderConstant(g_pTextPSConstantBuffer);
pDev->drawIndexed(g_uVertexCount, g_uIndexCount / 3, 0, 0);
pContext->setRenderBuffer(g_pTextRenderBuffer);
pContext->setIndexBuffer(g_pTextIndexBuffer);
pContext->setPSTexture((IGXTexture2D*)g_pFont->getAPITexture(0));
pContext->setPrimitiveTopology(GXPT_TRIANGLELIST);
pContext->setVSConstant(g_pTextVSConstantBuffer);
pContext->setPSConstant(g_pTextPSConstantBuffer);
pContext->drawIndexed(g_uVertexCount, g_uIndexCount / 3, 0, 0);
g_pTextVSConstantBuffer->update(&SMMatrixTranspose(m));
g_pTextPSConstantBuffer->update(&float4_t(0.3f, 1.0f, 0.3f, 1.0f));
pDev->drawIndexed(g_uVertexCount, g_uIndexCount / 3, 0, 0);
pContext->drawIndexed(g_uVertexCount, g_uIndexCount / 3, 0, 0);
SGCore_ShaderUnBind();
}
}
......
......@@ -379,20 +379,22 @@ void CCrosshair::render()
m_pIndexBuffer->unlock();
}
}
IGXContext *pCtx = m_pDev->getDirectContext();
SGCore_ShaderBind(m_idShaderKit);
m_pDev->setBlendState(m_pBlendState);
m_pDev->setSamplerState(m_pSamplerState, 0);
m_pDev->setIndexBuffer(m_pIndexBuffer);
m_pDev->setRenderBuffer(m_pRenderBuffer);
pCtx->setBlendState(m_pBlendState);
pCtx->setSamplerState(m_pSamplerState, 0);
pCtx->setIndexBuffer(m_pIndexBuffer);
pCtx->setRenderBuffer(m_pRenderBuffer);
IGXBaseTexture *pTex = NULL;
m_pTexture->getAPITexture(&pTex);
m_pDev->setTexture(pTex);
pCtx->setPSTexture(pTex);
mem_release(pTex);
m_pDev->setDepthStencilState(m_pDepthState);
m_pDev->setPrimitiveTopology(GXPT_TRIANGLELIST);
m_pDev->drawIndexed(m_iVertexCount[m_u8ActiveBuffer], m_iIndexCount[m_u8ActiveBuffer] / 3);
pCtx->setDepthStencilState(m_pDepthState);
pCtx->setPrimitiveTopology(GXPT_TRIANGLELIST);
pCtx->drawIndexed(m_iVertexCount[m_u8ActiveBuffer], m_iIndexCount[m_u8ActiveBuffer] / 3);
}
void CCrosshair::onSync()
{
......
......@@ -78,7 +78,7 @@ protected:
IGXVertexDeclaration *m_pVertexDeclaration;
IGXRenderBuffer *m_pRenderBuffer;
IGXContext *m_pDev;
IGXDevice *m_pDev;
float2_t m_f2TexOffs;
float2_t m_f2TexSize;
......
......@@ -6,7 +6,7 @@ See the license in LICENSE
#include "Bound.h"
void CreateCone(float fTopRadius, float fBottomRadius, float fHeight, IMesh ** ppMesh, IGXContext * pDevice, UINT iSideCount)
void CreateCone(float fTopRadius, float fBottomRadius, float fHeight, IMesh ** ppMesh, IGXDevice * pDevice, UINT iSideCount)
{
UINT iVC = iSideCount * 2;
UINT iIC = (iSideCount - 2) * 6 + iSideCount * 6;
......@@ -79,7 +79,7 @@ void CreateCone(float fTopRadius, float fBottomRadius, float fHeight, IMesh ** p
(*ppMesh) = pMesh;
}
void CreateSphere(float fRadius, UINT iSideCount, UINT iStackCount, IMesh ** ppMesh, IGXContext * pDevice)
void CreateSphere(float fRadius, UINT iSideCount, UINT iStackCount, IMesh ** ppMesh, IGXDevice * pDevice)
{
UINT iVC = (iStackCount - 1) * iSideCount + 2;
UINT iIC = (iStackCount - 1) * iSideCount * 6;
......@@ -145,7 +145,7 @@ void CreateSphere(float fRadius, UINT iSideCount, UINT iStackCount, IMesh ** ppM
//##########################################################################
void CreateBoundingBoxMesh(const float3* min, const float3* max, IMesh** bbmesh, IGXContext* device)
void CreateBoundingBoxMesh(const float3* min, const float3* max, IMesh** bbmesh, IGXDevice* device)
{
float dist_x = abs(max->x - min->x);
float dist_y = abs(max->y - min->y);
......
......@@ -10,9 +10,9 @@ See the license in LICENSE
#include <common/Math.h>
#include "sxgcore.h"
void CreateCone(float fTopRadius, float fBottomRadius, float fHeight, IMesh ** ppMesh, IGXContext * pDevice, UINT iSideCount);
void CreateSphere(float fRadius, UINT iSideCount, UINT iStackCount, IMesh ** ppMesh, IGXContext * pDevice);
void CreateCone(float fTopRadius, float fBottomRadius, float fHeight, IMesh ** ppMesh, IGXDevice * pDevice, UINT iSideCount);
void CreateSphere(float fRadius, UINT iSideCount, UINT iStackCount, IMesh ** ppMesh, IGXDevice * pDevice);
void CreateBoundingBoxMesh(const float3* min, const float3* max, IMesh** bbmesh, IGXContext* device);
void CreateBoundingBoxMesh(const float3* min, const float3* max, IMesh** bbmesh, IGXDevice* device);
#endif
......@@ -39,8 +39,8 @@ void InitDevice(SXWINDOW hWnd, int iWidth, int iHeight, bool isWindowed)
return;
}
IGXContext* (*libGXGetInstance)();
libGXGetInstance = (IGXContext*(*)())GetProcAddress(m_hLibGXAPI, "GetInstance");
IGXDevice* (*libGXGetInstance)();
libGXGetInstance = (IGXDevice*(*)())GetProcAddress(m_hLibGXAPI, "GetInstance");
if(!libGXGetInstance)
{
LibReport(REPORT_MSG_LEVEL_FATAL, "%s - %s: Not a GX module!\n", GEN_MSG_LOCATION, szModuleName);
......
......@@ -17,7 +17,7 @@ See the license in LICENSE
//##########################################################################
extern IGXContext *g_pDevice;
extern IGXDevice *g_pDevice;
extern HMODULE m_hLibGXAPI;
extern Array<DEVMODE> g_aModes;
extern IGXRenderBuffer *g_pScreenTextureRB;
......
......@@ -12,38 +12,38 @@ See the license in LICENSE
//##########################################################################
static void CreateShader(IGXContext *pContext, IGXPixelShader **ppOut, const char *szCode, const char *szFile, GXMacro *pDefs)
static void CreateShader(IGXDevice *pDevice, IGXPixelShader **ppOut, const char *szCode, const char *szFile, GXMacro *pDefs)
{
*ppOut = pContext->createPixelShaderFromString(szCode, pDefs);
*ppOut = pDevice->createPixelShaderFromString(szCode, pDefs);
}
static void CreateShader(IGXContext *pContext, IGXVertexShader **ppOut, const char *szCode, const char *szFile, GXMacro *pDefs)
static void CreateShader(IGXDevice *pDevice, IGXVertexShader **ppOut, const char *szCode, const char *szFile, GXMacro *pDefs)
{
*ppOut = pContext->createVertexShaderFromString(szCode, pDefs);
*ppOut = pDevice->createVertexShaderFromString(szCode, pDefs);
}
static void CreateShader(IGXContext *pContext, IGXGeometryShader **ppOut, const char *szCode, const char *szFile, GXMacro *pDefs)
static void CreateShader(IGXDevice *pDevice, IGXGeometryShader **ppOut, const char *szCode, const char *szFile, GXMacro *pDefs)
{
*ppOut = pContext->createGeometryShaderFromString(szCode, pDefs);
*ppOut = pDevice->createGeometryShaderFromString(szCode, pDefs);
}
static void CreateShader(IGXContext *pContext, IGXComputeShader **ppOut, const char *szCode, const char *szFile, GXMacro *pDefs)
static void CreateShader(IGXDevice *pDevice, IGXComputeShader **ppOut, const char *szCode, const char *szFile, GXMacro *pDefs)
{
*ppOut = pContext->createComputeShaderFromString(szCode, pDefs);
*ppOut = pDevice->createComputeShaderFromString(szCode, pDefs);
}
static void CreateShaderFromData(IGXContext *pContext, IGXPixelShader **ppOut, byte *pCode, UINT uSize)
static void CreateShaderFromData(IGXDevice *pDevice, IGXPixelShader **ppOut, byte *pCode, UINT uSize)
{
*ppOut = pContext->createPixelShaderFromBin(pCode, uSize);
*ppOut = pDevice->createPixelShaderFromBin(pCode, uSize);
}
static void CreateShaderFromData(IGXContext *pContext, IGXVertexShader **ppOut, byte *pCode, UINT uSize)
static void CreateShaderFromData(IGXDevice *pDevice, IGXVertexShader **ppOut, byte *pCode, UINT uSize)
{
*ppOut = pContext->createVertexShaderFromBin(pCode, uSize);
*ppOut = pDevice->createVertexShaderFromBin(pCode, uSize);
}
static void CreateShaderFromData(IGXContext *pContext, IGXGeometryShader **ppOut, byte *pCode, UINT uSize)
static void CreateShaderFromData(IGXDevice *pDevice, IGXGeometryShader **ppOut, byte *pCode, UINT uSize)
{
*ppOut = pContext->createGeometryShaderFromBin(pCode, uSize);
*ppOut = pDevice->createGeometryShaderFromBin(pCode, uSize);
}
static void CreateShaderFromData(IGXContext *pContext, IGXComputeShader **ppOut, byte *pCode, UINT uSize)
static void CreateShaderFromData(IGXDevice *pDevice, IGXComputeShader **ppOut, byte *pCode, UINT uSize)
{
*ppOut = pContext->createComputeShaderFromBin(pCode, uSize);
*ppOut = pDevice->createComputeShaderFromBin(pCode, uSize);
}
template <class T>
......@@ -844,12 +844,12 @@ void CShaderManager::bind(ID idShaderKit)
return;
}
g_pDevice->setShader(m_aShaderKit[idShaderKit]->m_pShaderKit);
g_pDevice->getDirectContext()->setShader(m_aShaderKit[idShaderKit]->m_pShaderKit);
}
void CShaderManager::unbind()
{