mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-28 07:45:40 +00:00
Merge pull request #608 from BeamNG/use_gfxdevice_setupgenericshaders
Use GFXDevice::setupGenericShaders for support non Fixed Fuction Pipelines.
This commit is contained in:
commit
1c95ce21d6
12 changed files with 14 additions and 16 deletions
|
|
@ -723,7 +723,7 @@ public:
|
|||
virtual U32 getNumRenderTargets() const = 0;
|
||||
|
||||
virtual void setShader( GFXShader *shader ) {}
|
||||
virtual void disableShaders() {}
|
||||
virtual void disableShaders() {} // TODO Remove when T3D 4.0
|
||||
|
||||
/// Set the buffer! (Actual set happens on the next draw call, just like textures, state blocks, etc)
|
||||
void setShaderConstBuffer(GFXShaderConstBuffer* buffer);
|
||||
|
|
|
|||
|
|
@ -60,7 +60,6 @@ void FontRenderBatcher::render( F32 rot, const Point2F &offset )
|
|||
return;
|
||||
|
||||
GFX->setStateBlock(mFontSB);
|
||||
GFX->disableShaders();
|
||||
for(U32 i = 0; i < GFX->getNumSamplers(); i++)
|
||||
GFX->setTexture(i, NULL);
|
||||
|
||||
|
|
@ -177,6 +176,7 @@ void FontRenderBatcher::render( F32 rot, const Point2F &offset )
|
|||
AssertFatal(currentPt <= mLength * 6, "FontRenderBatcher::render - too many verts for length of string!");
|
||||
|
||||
GFX->setVertexBuffer(verts);
|
||||
GFX->setupGenericShaders( GFXDevice::GSAddColorTexture );
|
||||
|
||||
// Now do an optimal render!
|
||||
for( S32 i = 0; i < mSheets.size(); i++ )
|
||||
|
|
@ -186,8 +186,7 @@ void FontRenderBatcher::render( F32 rot, const Point2F &offset )
|
|||
|
||||
if(!mSheets[i]->numChars )
|
||||
continue;
|
||||
|
||||
GFX->setupGenericShaders( GFXDevice::GSAddColorTexture );
|
||||
|
||||
GFX->setTexture( 0, mFont->getTextureHandle(i) );
|
||||
GFX->drawPrimitive(GFXTriangleList, mSheets[i]->startVertex, mSheets[i]->numChars * 2);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -150,11 +150,10 @@ void DebugDrawer::render()
|
|||
}
|
||||
|
||||
SimTime curTime = Sim::getCurrentTime();
|
||||
|
||||
GFX->disableShaders();
|
||||
|
||||
for(DebugPrim **walk = &mHead; *walk; )
|
||||
{
|
||||
GFX->setupGenericShaders();
|
||||
DebugPrim *p = *walk;
|
||||
|
||||
// Set up the state block...
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue