From cf9fe8f329cee363439c90a3b86dc99e25377088 Mon Sep 17 00:00:00 2001 From: Mitchell Stokes Date: Mon, 4 Nov 2013 19:21:07 +0000 Subject: BGE Rasterizer Cleanup: Removing RAS_IRenderTools and moving the functionality to RAS_IRasterizer. RAS_OpenGLRasterizer is a bit of a mess now with references to Ketsji and other modules it shouldn't be accessing. --- .../RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h | 74 ++++++++++++++++++++-- 1 file changed, 70 insertions(+), 4 deletions(-) (limited to 'source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h') diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h index c638c40d34b..bd9e479464a 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h @@ -105,6 +105,15 @@ class RAS_OpenGLRasterizer : public RAS_IRasterizer bool m_usingoverrideshader; + // Render tools + void* m_clientobject; + void* m_auxilaryClientInfo; + std::vector m_lights; + int m_lastlightlayer; + bool m_lastlighting; + void *m_lastauxinfo; + unsigned int m_numgllights; + protected: int m_drawingmode; TexCoGen m_texco[RAS_MAX_TEXCO]; @@ -171,10 +180,8 @@ public: virtual void IndexPrimitives(class RAS_MeshSlot& ms); virtual void IndexPrimitivesMulti(class RAS_MeshSlot& ms); - virtual void IndexPrimitives_3DText( - class RAS_MeshSlot& ms, - class RAS_IPolyMaterial* polymat, - class RAS_IRenderTools* rendertools); + virtual void IndexPrimitives_3DText(class RAS_MeshSlot& ms, + class RAS_IPolyMaterial* polymat); virtual void SetProjectionMatrix(MT_CmMatrix4x4 & mat); virtual void SetProjectionMatrix(const MT_Matrix4x4 & mat); @@ -330,6 +337,65 @@ public: virtual void SetUsingOverrideShader(bool val); virtual bool GetUsingOverrideShader(); + /** + * Render Tools + */ + void EnableOpenGLLights(); + void DisableOpenGLLights(); + void ProcessLighting(bool uselights, const MT_Transform& viewmat); + + void RenderBox2D(int xco, + int yco, + int width, + int height, + float percentage); + + + void RenderText3D(int fontid, + const char* text, + int size, + int dpi, + float* color, + double* mat, + float aspect); + + void RenderText2D(RAS_TEXT_RENDER_MODE mode, + const char* text, + int xco, + int yco, + int width, + int height); + + void RenderText(int mode, + class RAS_IPolyMaterial* polymat, + float v1[3], + float v2[3], + float v3[3], + float v4[3], + int glattrib); + + void applyTransform(double* oglmatrix, int objectdrawmode); + int applyLights(int objectlayer, const MT_Transform& viewmat); + + void PushMatrix(); + void PopMatrix(); + + bool RayHit(class KX_ClientObjectInfo* client, class KX_RayCast* result, void * const data); + bool NeedRayCast(class KX_ClientObjectInfo*) { return true; } + + + void AddLight(struct RAS_LightObject* lightobject); + + void RemoveLight(struct RAS_LightObject* lightobject); + int ApplyLights(int objectlayer, const MT_Transform& viewmat); + + void MotionBlur(); + + void SetClientObject(void* obj); + + void SetAuxilaryClientInfo(void* inf); + + #ifdef WITH_CXX_GUARDEDALLOC MEM_CXX_CLASS_ALLOC_FUNCS("GE:RAS_OpenGLRasterizer") #endif -- cgit v1.2.3