From: <vo...@us...> - 2009-04-09 13:53:14
|
Revision: 1180 http://opde.svn.sourceforge.net/opde/?rev=1180&view=rev Author: volca Date: 2009-04-09 13:52:59 +0000 (Thu, 09 Apr 2009) Log Message: ----------- adding thirdparty null render system. Not working (has to be stabilised) but usable for OPDE core services, I guess. Modified Paths: -------------- trunk/thirdparty/CMakeLists.txt Added Paths: ----------- trunk/thirdparty/NullRenderer/ trunk/thirdparty/NullRenderer/CMakeLists.txt trunk/thirdparty/NullRenderer/NullGpuProgram.h trunk/thirdparty/NullRenderer/NullGpuProgramManager.cpp trunk/thirdparty/NullRenderer/NullGpuProgramManager.h trunk/thirdparty/NullRenderer/NullHardwareBufferManager.cpp trunk/thirdparty/NullRenderer/NullHardwareBufferManager.h trunk/thirdparty/NullRenderer/NullHardwareIndexBuffer.cpp trunk/thirdparty/NullRenderer/NullHardwareIndexBuffer.h trunk/thirdparty/NullRenderer/NullHardwareVertexBuffer.cpp trunk/thirdparty/NullRenderer/NullHardwareVertexBuffer.h trunk/thirdparty/NullRenderer/NullHlslProgramFactory.cpp trunk/thirdparty/NullRenderer/NullHlslProgramFactory.h trunk/thirdparty/NullRenderer/NullRenderSystem.cpp trunk/thirdparty/NullRenderer/NullRenderSystem.h trunk/thirdparty/NullRenderer/NullRenderToVertexBuffer.h trunk/thirdparty/NullRenderer/NullRenderWindow.cpp trunk/thirdparty/NullRenderer/NullRenderWindow.h trunk/thirdparty/NullRenderer/NullRendererDll.cpp trunk/thirdparty/NullRenderer/NullTexture.h trunk/thirdparty/NullRenderer/NullTextureManager.cpp trunk/thirdparty/NullRenderer/NullTextureManager.h trunk/thirdparty/NullRenderer/stdafx.h Modified: trunk/thirdparty/CMakeLists.txt =================================================================== --- trunk/thirdparty/CMakeLists.txt 2009-04-09 13:51:01 UTC (rev 1179) +++ trunk/thirdparty/CMakeLists.txt 2009-04-09 13:52:59 UTC (rev 1180) @@ -1 +1 @@ -# add_subdirectory(QuickGUI) +add_subdirectory(NullRenderer) Added: trunk/thirdparty/NullRenderer/CMakeLists.txt =================================================================== --- trunk/thirdparty/NullRenderer/CMakeLists.txt (rev 0) +++ trunk/thirdparty/NullRenderer/CMakeLists.txt 2009-04-09 13:52:59 UTC (rev 1180) @@ -0,0 +1,40 @@ +# $Id: CMakeLists.txt 1163 2009-03-15 08:48:57Z patryn $ + +include_directories( + ${OGRE_INCLUDE_DIR} +) + +add_library (NullRenderSystem SHARED + NullGpuProgram.h + NullGpuProgramManager.cpp + NullGpuProgramManager.h + NullHardwareBufferManager.cpp + NullHardwareBufferManager.h + NullHardwareIndexBuffer.cpp + NullHardwareIndexBuffer.h + NullHardwareVertexBuffer.cpp + NullHardwareVertexBuffer.h + NullHlslProgramFactory.cpp + NullHlslProgramFactory.h + NullRendererDll.cpp + NullRenderSystem.cpp + NullRenderSystem.h + NullRenderWindow.cpp + NullRenderWindow.h + NullTexture.h + NullTextureManager.cpp + NullTextureManager.h + stdafx.h +) + +target_link_libraries( NullRenderSystem + ${OGRE_LIBRARIES} +) + +set_property(TARGET OpenDark PROPERTY LINK_INTERFACE_LIBRARIES "") + +# Build flags for the .DLL __declspec things, etc. +SET_TARGET_PROPERTIES(NullRenderSystem PROPERTIES + DEFINE_SYMBOL "OPDELIB_DLL_TARGET" + LINK_INTERFACE_LIBRARIES "" +) Property changes on: trunk/thirdparty/NullRenderer/CMakeLists.txt ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/thirdparty/NullRenderer/NullGpuProgram.h =================================================================== --- trunk/thirdparty/NullRenderer/NullGpuProgram.h (rev 0) +++ trunk/thirdparty/NullRenderer/NullGpuProgram.h 2009-04-09 13:52:59 UTC (rev 1180) @@ -0,0 +1,29 @@ +#ifndef __NULLGPUPROGRAM_H +#define __NULLGPUPROGRAM_H + +#include "stdafx.h" + +namespace Ogre { + + class NULLGpuProgram : public GpuProgram + { + protected: + public: + NULLGpuProgram(ResourceManager* creator, const String& name, ResourceHandle handle, + const String& group, bool isManual = false, ManualResourceLoader* loader = 0) : GpuProgram(creator, name, handle, group, isManual, loader) {} + + protected: + /** @copydoc Resource::loadImpl */ + void loadImpl(void) {} + + /** Overridden from GpuProgram */ + void loadFromSource(void) {} + + /** Internal method to load from microcode, must be overridden by subclasses. */ + void unloadImpl(void) {} + + }; + +} + +#endif Property changes on: trunk/thirdparty/NullRenderer/NullGpuProgram.h ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/thirdparty/NullRenderer/NullGpuProgramManager.cpp =================================================================== --- trunk/thirdparty/NullRenderer/NullGpuProgramManager.cpp (rev 0) +++ trunk/thirdparty/NullRenderer/NullGpuProgramManager.cpp 2009-04-09 13:52:59 UTC (rev 1180) @@ -0,0 +1,42 @@ +#include "NullGpuProgramManager.h" +#include "NullGpuProgram.h" + +namespace Ogre { + +//----------------------------------------------------------------------------- +NULLGpuProgramManager::NULLGpuProgramManager() : + GpuProgramManager() { + // Superclass sets up members + + // Register with resource group manager + ResourceGroupManager::getSingleton()._registerResourceManager( + mResourceType, this); + +} +//----------------------------------------------------------------------------- +NULLGpuProgramManager::~NULLGpuProgramManager() { + // Unregister with resource group manager + ResourceGroupManager::getSingleton()._unregisterResourceManager( + mResourceType); + +} +//----------------------------------------------------------------------------- +GpuProgramParametersSharedPtr NULLGpuProgramManager::createParameters(void) { + return GpuProgramParametersSharedPtr(new GpuProgramParameters()); +} +//----------------------------------------------------------------------------- +Resource* NULLGpuProgramManager::createImpl(const String& name, + ResourceHandle handle, const String& group, bool isManual, + ManualResourceLoader* loader, const NameValuePairList* params) { + return new NULLGpuProgram(this, name, handle, group, isManual, loader); +} + +//----------------------------------------------------------------------------- +Resource* NULLGpuProgramManager::createImpl(const String& name, + ResourceHandle handle, const String& group, bool isManual, + ManualResourceLoader* loader, GpuProgramType gptype, + const String& syntaxCode) { + return new NULLGpuProgram(this, name, handle, group, isManual, loader); +} + +} Property changes on: trunk/thirdparty/NullRenderer/NullGpuProgramManager.cpp ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/thirdparty/NullRenderer/NullGpuProgramManager.h =================================================================== --- trunk/thirdparty/NullRenderer/NullGpuProgramManager.h (rev 0) +++ trunk/thirdparty/NullRenderer/NullGpuProgramManager.h 2009-04-09 13:52:59 UTC (rev 1180) @@ -0,0 +1,27 @@ +#ifndef __NULLGPUPROGRAMMANAGER_H +#define __NULLGPUPROGRAMMANAGER_H + +#include "stdafx.h" + +namespace Ogre { + + class NULLGpuProgramManager: public GpuProgramManager { + protected: + /// @copydoc ResourceManager::createImpl + Resource* createImpl(const String& name, ResourceHandle handle, + const String& group, bool isManual, ManualResourceLoader* loader, + const NameValuePairList* params); + /// Specialised create method with specific parameters + Resource* createImpl(const String& name, ResourceHandle handle, + const String& group, bool isManual, ManualResourceLoader* loader, + GpuProgramType gptype, const String& syntaxCode); + + public: + NULLGpuProgramManager(); + ~NULLGpuProgramManager(); + /// @copydoc GpuProgramManager::createParameters + GpuProgramParametersSharedPtr createParameters(void); + }; +} + +#endif Property changes on: trunk/thirdparty/NullRenderer/NullGpuProgramManager.h ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/thirdparty/NullRenderer/NullHardwareBufferManager.cpp =================================================================== --- trunk/thirdparty/NullRenderer/NullHardwareBufferManager.cpp (rev 0) +++ trunk/thirdparty/NullRenderer/NullHardwareBufferManager.cpp 2009-04-09 13:52:59 UTC (rev 1180) @@ -0,0 +1,35 @@ +#include "stdafx.h" +#include "NullHardwareBufferManager.h" +#include "NullHardwareIndexBuffer.h" +#include "NullHardwareVertexBuffer.h" +#include "NullRenderToVertexBuffer.h" + +namespace Ogre { + + HardwareVertexBufferSharedPtr NULLHardwareBufferManager::createVertexBuffer( + size_t vertexSize, size_t numVerts, HardwareBuffer::Usage usage, + bool useShadowBuffer) { + HardwareVertexBuffer* vbuf = new NULLHardwareVertexBuffer(vertexSize, + numVerts, usage, false, false); + mVertexBuffers.insert(vbuf); + + return HardwareVertexBufferSharedPtr(vbuf); + } + + HardwareIndexBufferSharedPtr NULLHardwareBufferManager::createIndexBuffer( + HardwareIndexBuffer::IndexType itype, size_t numIndexes, + HardwareBuffer::Usage usage, bool useShadowBuffer) { + NULLHardwareIndexBuffer* idx = new NULLHardwareIndexBuffer(itype, + numIndexes, usage, false, useShadowBuffer); + mIndexBuffers.insert(idx); + + return HardwareIndexBufferSharedPtr(idx); + + } + + RenderToVertexBufferSharedPtr NULLHardwareBufferManager::createRenderToVertexBuffer() { + return RenderToVertexBufferSharedPtr(new NULLRenderToVertexBuffer()); + } + +} + Property changes on: trunk/thirdparty/NullRenderer/NullHardwareBufferManager.cpp ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/thirdparty/NullRenderer/NullHardwareBufferManager.h =================================================================== --- trunk/thirdparty/NullRenderer/NullHardwareBufferManager.h (rev 0) +++ trunk/thirdparty/NullRenderer/NullHardwareBufferManager.h 2009-04-09 13:52:59 UTC (rev 1180) @@ -0,0 +1,23 @@ +#ifndef __NULLGPUPROGRAM_H +#define __NULLGPUPROGRAM_H + +#include "stdafx.h" + +namespace Ogre { + + class NULLHardwareBufferManager: public HardwareBufferManager { + HardwareVertexBufferSharedPtr createVertexBuffer(size_t vertexSize, + size_t numVerts, HardwareBuffer::Usage usage, bool useShadowBuffer = + false); + HardwareIndexBufferSharedPtr createIndexBuffer( + HardwareIndexBuffer::IndexType itype, size_t numIndexes, + HardwareBuffer::Usage usage, bool useShadowBuffer = false); + + RenderToVertexBufferSharedPtr createRenderToVertexBuffer(); + }; + + + +} + +#endif Property changes on: trunk/thirdparty/NullRenderer/NullHardwareBufferManager.h ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/thirdparty/NullRenderer/NullHardwareIndexBuffer.cpp =================================================================== --- trunk/thirdparty/NullRenderer/NullHardwareIndexBuffer.cpp (rev 0) +++ trunk/thirdparty/NullRenderer/NullHardwareIndexBuffer.cpp 2009-04-09 13:52:59 UTC (rev 1180) @@ -0,0 +1,41 @@ +#include "stdafx.h" +#include "NullHardwareIndexBuffer.h" + +namespace Ogre { + + NULLHardwareIndexBuffer::NULLHardwareIndexBuffer(HardwareIndexBuffer::IndexType idxType, + size_t numIndexes, HardwareBuffer::Usage usage, bool useSystemMemory, bool useShadowBuffer) + : HardwareIndexBuffer(idxType, numIndexes, usage, useSystemMemory, useShadowBuffer) + { + m_pBuffer = (char *)malloc(numIndexes * sizeof(Ogre::uint32)); + } + //--------------------------------------------------------------------- + NULLHardwareIndexBuffer::~NULLHardwareIndexBuffer() + { + free(m_pBuffer); + } + //--------------------------------------------------------------------- + void* NULLHardwareIndexBuffer::lockImpl(size_t offset, + size_t length, LockOptions options) + { + return &m_pBuffer[offset]; + } + //--------------------------------------------------------------------- + void NULLHardwareIndexBuffer::unlockImpl(void) + { + } + //--------------------------------------------------------------------- + void NULLHardwareIndexBuffer::readData(size_t offset, size_t length, + void* pDest) + { + memcpy(pDest, &m_pBuffer[offset], length); + } + //--------------------------------------------------------------------- + void NULLHardwareIndexBuffer::writeData(size_t offset, size_t length, + const void* pSource, + bool discardWholeBuffer) + { + memcpy(&m_pBuffer[offset],pSource, length); + } + +} Property changes on: trunk/thirdparty/NullRenderer/NullHardwareIndexBuffer.cpp ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/thirdparty/NullRenderer/NullHardwareIndexBuffer.h =================================================================== --- trunk/thirdparty/NullRenderer/NullHardwareIndexBuffer.h (rev 0) +++ trunk/thirdparty/NullRenderer/NullHardwareIndexBuffer.h 2009-04-09 13:52:59 UTC (rev 1180) @@ -0,0 +1,30 @@ +#ifndef __NULLHARDWAREINDEXBUFFER_H +#define __NULLHARDWAREINDEXBUFFER_H + +#include "stdafx.h" + +namespace Ogre { + + class NULLHardwareIndexBuffer: public HardwareIndexBuffer { + protected: + /** See HardwareBuffer. */ + void* lockImpl(size_t offset, size_t length, LockOptions options); + /** See HardwareBuffer. */ + void unlockImpl(void); + public: + NULLHardwareIndexBuffer(IndexType idxType, size_t numIndexes, + HardwareBuffer::Usage usage, bool useSystemMem, + bool useShadowBuffer); + ~NULLHardwareIndexBuffer(); + /** See HardwareBuffer. */ + void readData(size_t offset, size_t length, void* pDest); + /** See HardwareBuffer. */ + void writeData(size_t offset, size_t length, const void* pSource, + bool discardWholeBuffer = false); + + char *m_pBuffer; + }; + +} + +#endif Property changes on: trunk/thirdparty/NullRenderer/NullHardwareIndexBuffer.h ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/thirdparty/NullRenderer/NullHardwareVertexBuffer.cpp =================================================================== --- trunk/thirdparty/NullRenderer/NullHardwareVertexBuffer.cpp (rev 0) +++ trunk/thirdparty/NullRenderer/NullHardwareVertexBuffer.cpp 2009-04-09 13:52:59 UTC (rev 1180) @@ -0,0 +1,48 @@ +#include "stdafx.h" +#include "NullHardwareVertexBuffer.h" + +namespace Ogre { + + //--------------------------------------------------------------------- + NULLHardwareVertexBuffer::NULLHardwareVertexBuffer(size_t vertexSize, + size_t numVertices, HardwareBuffer::Usage usage, + bool useSystemMemory, bool useShadowBuffer) + : HardwareVertexBuffer(vertexSize, numVertices, usage, useSystemMemory, useShadowBuffer) + { + // Create the vertex buffer + m_pBuffer = (char *)malloc(vertexSize * numVertices); + + } + //--------------------------------------------------------------------- + NULLHardwareVertexBuffer::~NULLHardwareVertexBuffer() + { + free(m_pBuffer); + } + //--------------------------------------------------------------------- + +//--------------------------------------------------------------------- + void* NULLHardwareVertexBuffer::lockImpl(size_t offset, + size_t length, LockOptions options) + { + return &m_pBuffer[offset]; + } + //--------------------------------------------------------------------- + void NULLHardwareVertexBuffer::unlockImpl(void) + { + } + //--------------------------------------------------------------------- + void NULLHardwareVertexBuffer::readData(size_t offset, size_t length, + void* pDest) + { + memcpy(pDest, &m_pBuffer[offset], length); + } + //--------------------------------------------------------------------- + void NULLHardwareVertexBuffer::writeData(size_t offset, size_t length, + const void* pSource, + bool discardWholeBuffer) + { + memcpy(&m_pBuffer[offset], pSource, length); + } + //--------------------------------------------------------------------- + +} Property changes on: trunk/thirdparty/NullRenderer/NullHardwareVertexBuffer.cpp ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/thirdparty/NullRenderer/NullHardwareVertexBuffer.h =================================================================== --- trunk/thirdparty/NullRenderer/NullHardwareVertexBuffer.h (rev 0) +++ trunk/thirdparty/NullRenderer/NullHardwareVertexBuffer.h 2009-04-09 13:52:59 UTC (rev 1180) @@ -0,0 +1,30 @@ +#ifndef __NULLHARDWAREVERTEXBUFFER_H +#define __NULLHARDWAREVERTEXBUFFER_H + +#include "stdafx.h" + +namespace Ogre { + + class NULLHardwareVertexBuffer : public HardwareVertexBuffer + { + protected: + /** See HardwareBuffer. */ + virtual void* lockImpl(size_t offset, size_t length, LockOptions options); + /** See HardwareBuffer. */ + virtual void unlockImpl(void); + public: + NULLHardwareVertexBuffer(size_t vertexSize, size_t numVertices, + HardwareBuffer::Usage usage, bool useSystemMem, bool useShadowBuffer); + ~NULLHardwareVertexBuffer(); + /** See HardwareBuffer. */ + void readData(size_t offset, size_t length, void* pDest); + /** See HardwareBuffer. */ + void writeData(size_t offset, size_t length, const void* pSource, + bool discardWholeBuffer = false); + + char *m_pBuffer; + + }; +} + +#endif Property changes on: trunk/thirdparty/NullRenderer/NullHardwareVertexBuffer.h ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/thirdparty/NullRenderer/NullHlslProgramFactory.cpp =================================================================== --- trunk/thirdparty/NullRenderer/NullHlslProgramFactory.cpp (rev 0) +++ trunk/thirdparty/NullRenderer/NullHlslProgramFactory.cpp 2009-04-09 13:52:59 UTC (rev 1180) @@ -0,0 +1,18 @@ +#include "stdafx.h" +#include "NullHlslProgramFactory.h" + +namespace Ogre { + const String NULLHLSLProgramFactory::msLanguage = "NULLHLSL"; + + const String& NULLHLSLProgramFactory::getLanguage() const { + return msLanguage; + } + + HighLevelGpuProgram* NULLHLSLProgramFactory::create(ResourceManager* creator, const Ogre::String& name, ResourceHandle handle, + const Ogre::String& group, bool isManual, Ogre::ManualResourceLoader* loader) { + } + + void NULLHLSLProgramFactory::destroy(Ogre::HighLevelGpuProgram* prg) { + } +}; + Property changes on: trunk/thirdparty/NullRenderer/NullHlslProgramFactory.cpp ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/thirdparty/NullRenderer/NullHlslProgramFactory.h =================================================================== --- trunk/thirdparty/NullRenderer/NullHlslProgramFactory.h (rev 0) +++ trunk/thirdparty/NullRenderer/NullHlslProgramFactory.h 2009-04-09 13:52:59 UTC (rev 1180) @@ -0,0 +1,20 @@ +#ifndef __NULLHLSLPROGRAMFACTORY_H +#define __NULLHLSLPROGRAMFACTORY_H + +#include "stdafx.h" + +namespace Ogre { + class NULLHLSLProgramFactory : public Ogre::HighLevelGpuProgramFactory + { + public: + const String& getLanguage() const; + HighLevelGpuProgram* create(ResourceManager* creator, const Ogre::String& name, ResourceHandle handle, + const Ogre::String& group, bool isManual, Ogre::ManualResourceLoader* loader); + void destroy(Ogre::HighLevelGpuProgram*); + + protected: + static const String msLanguage; + }; +} + +#endif Property changes on: trunk/thirdparty/NullRenderer/NullHlslProgramFactory.h ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/thirdparty/NullRenderer/NullRenderSystem.cpp =================================================================== --- trunk/thirdparty/NullRenderer/NullRenderSystem.cpp (rev 0) +++ trunk/thirdparty/NullRenderer/NullRenderSystem.cpp 2009-04-09 13:52:59 UTC (rev 1180) @@ -0,0 +1,387 @@ +#include "stdafx.h" +#include "NullRenderSystem.h" +#include "NullHardwareBufferManager.h" +#include "NullTextureManager.h" +#include "NullRenderWindow.h" + +namespace Ogre { + + //--------------------------------------------------------------------- + NULLRenderSystem::NULLRenderSystem() { + m_pHardwareBufferManager = new NULLHardwareBufferManager(); + } + //--------------------------------------------------------------------- + NULLRenderSystem::~NULLRenderSystem() { + delete m_pHardwareBufferManager; + + shutdown(); + } + //--------------------------------------------------------------------- + const String& NULLRenderSystem::getName() const { + static String strName("NULL Rendering Subsystem"); + return strName; + } + //--------------------------------------------------------------------- + + void NULLRenderSystem::setConfigOption(const String &name, const String &value) { + + } + //--------------------------------------------------------------------- + String NULLRenderSystem::validateConfigOptions() { + return StringUtil::BLANK; + } + //--------------------------------------------------------------------- + ConfigOptionMap& NULLRenderSystem::getConfigOptions() { + return m_options; + } + //--------------------------------------------------------------------- + void NULLRenderSystem::reinitialise() { + this->shutdown(); + this->_initialise(true); + } + //--------------------------------------------------------------------- + RenderWindow* NULLRenderSystem::_createRenderWindow(const String &name, + unsigned int width, unsigned int height, bool fullScreen, + const NameValuePairList *miscParams) { + + mTextureManager = new NULLTextureManager(); + mGpuProgramManager = new NULLGpuProgramManager(); + + RenderWindow* win = new NULLRenderWindow(); + + win->create(name, width, height, fullScreen, miscParams); + + attachRenderTarget(*win); + return win; + } + //----------------------------------------------------------------------- + MultiRenderTarget * NULLRenderSystem::createMultiRenderTarget( + const String & name) { + return NULL; + } + //--------------------------------------------------------------------- + String NULLRenderSystem::getErrorDescription(long errorNumber) const { + const String errMsg = "Not implemented"; + return errMsg; + } + //--------------------------------------------------------------------- + VertexElementType NULLRenderSystem::getColourVertexElementType(void) const { + return VET_COLOUR_ARGB; + } + //--------------------------------------------------------------------- + void NULLRenderSystem::_convertProjectionMatrix(const Matrix4& matrix, + Matrix4& dest, bool forGpuProgram) { + dest = matrix; + + // Convert depth range from [-1,+1] to [0,1] + dest[2][0] = (dest[2][0] + dest[3][0]) / 2; + dest[2][1] = (dest[2][1] + dest[3][1]) / 2; + dest[2][2] = (dest[2][2] + dest[3][2]) / 2; + dest[2][3] = (dest[2][3] + dest[3][3]) / 2; + + if (!forGpuProgram) { + // Convert right-handed to left-handed + dest[0][2] = -dest[0][2]; + dest[1][2] = -dest[1][2]; + dest[2][2] = -dest[2][2]; + dest[3][2] = -dest[3][2]; + } + } + //--------------------------------------------------------------------- + void NULLRenderSystem::_makeProjectionMatrix(const Radian& fovy, Real aspect, + Real nearPlane, Real farPlane, Matrix4& dest, bool forGpuProgram) { + } + //--------------------------------------------------------------------- + void NULLRenderSystem::_makeOrthoMatrix(const Radian& fovy, Real aspect, + Real nearPlane, Real farPlane, Matrix4& dest, bool forGpuProgram) { + } + //--------------------------------------------------------------------- + void NULLRenderSystem::setAmbientLight(float r, float g, float b) { + } + //--------------------------------------------------------------------- + void NULLRenderSystem::_useLights(const LightList& lights, unsigned short limit) { + + } + + //--------------------------------------------------------------------- + void NULLRenderSystem::setShadingType(ShadeOptions so) { + } + //--------------------------------------------------------------------- + void NULLRenderSystem::setLightingEnabled(bool enabled) { + } + //--------------------------------------------------------------------- + void NULLRenderSystem::_setViewMatrix(const Matrix4 &m) { + } + //--------------------------------------------------------------------- + void NULLRenderSystem::_setProjectionMatrix(const Matrix4 &m) { + } + //--------------------------------------------------------------------- + void NULLRenderSystem::_setWorldMatrix(const Matrix4 &m) { + } + //--------------------------------------------------------------------- + void NULLRenderSystem::_setSurfaceParams(const ColourValue &ambient, + const ColourValue &diffuse, const ColourValue &specular, + const ColourValue &emissive, Real shininess, + TrackVertexColourType tracking) { + + } + //--------------------------------------------------------------------- + void NULLRenderSystem::_setPointParameters(Real size, bool attenuationEnabled, + Real constant, Real linear, Real quadratic, Real minSize, Real maxSize) { + } + //--------------------------------------------------------------------- + void NULLRenderSystem::_setPointSpritesEnabled(bool enabled) { + } + //--------------------------------------------------------------------- + void NULLRenderSystem::_setTexture(size_t stage, bool enabled, + const TexturePtr& tex) { + } + //--------------------------------------------------------------------- + void NULLRenderSystem::_setTextureCoordSet(size_t stage, size_t index) { + } + //--------------------------------------------------------------------- + void NULLRenderSystem::_setTextureCoordCalculation(size_t stage, + TexCoordCalcMethod m, const Frustum* frustum) { + } + //--------------------------------------------------------------------- + void NULLRenderSystem::_setTextureMipmapBias(size_t unit, float bias) { + + } + + //--------------------------------------------------------------------- + void NULLRenderSystem::_setTextureMatrix(size_t stage, const Matrix4& xForm) { + } + //--------------------------------------------------------------------- + void NULLRenderSystem::_setTextureAddressingMode(size_t stage, + const TextureUnitState::UVWAddressingMode& uvw) { + } + //----------------------------------------------------------------------------- + void NULLRenderSystem::_setTextureBorderColour(size_t stage, + const ColourValue& colour) { + } + //--------------------------------------------------------------------- + void NULLRenderSystem::_setTextureBlendMode(size_t stage, + const LayerBlendModeEx& bm) { + } + //--------------------------------------------------------------------- + void NULLRenderSystem::_setSceneBlending(SceneBlendFactor sourceFactor, + SceneBlendFactor destFactor) { + } + + //--------------------------------------------------------------------- + void NULLRenderSystem::_setSeparateSceneBlending(SceneBlendFactor sourceFactor, + SceneBlendFactor destFactor, SceneBlendFactor sourceFactorAlpha, + SceneBlendFactor destFactorAlpha) { + + } + + //--------------------------------------------------------------------- + void NULLRenderSystem::_setAlphaRejectSettings(CompareFunction func, + unsigned char value, bool alphaToCoverage) { + } + //--------------------------------------------------------------------- + void NULLRenderSystem::_setCullingMode(CullingMode mode) { + } + //--------------------------------------------------------------------- + void NULLRenderSystem::_setDepthBufferParams(bool depthTest, bool depthWrite, + CompareFunction depthFunction) { + } + //--------------------------------------------------------------------- + void NULLRenderSystem::_setDepthBufferCheckEnabled(bool enabled) { + } + //--------------------------------------------------------------------- + void NULLRenderSystem::_setDepthBufferWriteEnabled(bool enabled) { + } + //--------------------------------------------------------------------- + void NULLRenderSystem::_setDepthBufferFunction(CompareFunction func) { + } + //--------------------------------------------------------------------- + void NULLRenderSystem::_setDepthBias(float bias, float slopeScaleBias) { + } + //--------------------------------------------------------------------- + void NULLRenderSystem::_setColourBufferWriteEnabled(bool red, bool green, + bool blue, bool alpha) { + } + //--------------------------------------------------------------------- + void NULLRenderSystem::_setFog(FogMode mode, const ColourValue& colour, + Real densitiy, Real start, Real end) { + } + //--------------------------------------------------------------------- + void NULLRenderSystem::_setPolygonMode(PolygonMode level) { + } + //--------------------------------------------------------------------- + void NULLRenderSystem::setStencilCheckEnabled(bool enabled) { + } + //--------------------------------------------------------------------- + void NULLRenderSystem::setStencilBufferParams(CompareFunction func, + uint32 refValue, uint32 mask, StencilOperation stencilFailOp, + StencilOperation depthFailOp, StencilOperation passOp, + bool twoSidedOperation) { + } + //--------------------------------------------------------------------- + void NULLRenderSystem::_setTextureUnitFiltering(size_t unit, FilterType ftype, + FilterOptions filter) { + } + //--------------------------------------------------------------------- + void NULLRenderSystem::_setTextureLayerAnisotropy(size_t unit, + unsigned int maxAnisotropy) { + } + //--------------------------------------------------------------------- + void NULLRenderSystem::_setViewport(Viewport *vp) { + } + //--------------------------------------------------------------------- + void NULLRenderSystem::_beginFrame() { + } + //--------------------------------------------------------------------- + void NULLRenderSystem::_endFrame() { + } + //--------------------------------------------------------------------- + void NULLRenderSystem::setVertexDeclaration(VertexDeclaration* decl) { + } + //--------------------------------------------------------------------- + void NULLRenderSystem::setVertexBufferBinding(VertexBufferBinding* binding) { + } + //--------------------------------------------------------------------- + void NULLRenderSystem::_render(const RenderOperation& op) { + } + //--------------------------------------------------------------------- + void NULLRenderSystem::setNormaliseNormals(bool normalise) { + } + //--------------------------------------------------------------------- + void NULLRenderSystem::bindGpuProgram(GpuProgram* prg) { + } + //--------------------------------------------------------------------- + void NULLRenderSystem::unbindGpuProgram(GpuProgramType gptype) { + } + //--------------------------------------------------------------------- + void NULLRenderSystem::bindGpuProgramParameters(GpuProgramType gptype, + GpuProgramParametersSharedPtr params) { + } + //--------------------------------------------------------------------- + void NULLRenderSystem::bindGpuProgramPassIterationParameters( + GpuProgramType gptype) { + } + //--------------------------------------------------------------------- + void NULLRenderSystem::setClipPlanesImpl(const PlaneList& clipPlanes) { + } + //--------------------------------------------------------------------- + void NULLRenderSystem::setScissorTest(bool enabled, size_t left, size_t top, + size_t right, size_t bottom) { + } + //--------------------------------------------------------------------- + void NULLRenderSystem::clearFrameBuffer(unsigned int buffers, + const ColourValue& colour, Real depth, unsigned short stencil) { + } + //--------------------------------------------------------------------- + void NULLRenderSystem::_makeProjectionMatrix(Real left, Real right, + Real bottom, Real top, Real nearPlane, Real farPlane, Matrix4& dest, + bool forGpuProgram) { + } + + // ------------------------------------------------------------------ + void NULLRenderSystem::setClipPlane(ushort index, Real A, Real B, Real C, + Real D) { + } + + // ------------------------------------------------------------------ + void NULLRenderSystem::enableClipPlane(ushort index, bool enable) { + } + //--------------------------------------------------------------------- + HardwareOcclusionQuery* NULLRenderSystem::createHardwareOcclusionQuery(void) { + return NULL; + } + //--------------------------------------------------------------------- + Real NULLRenderSystem::getHorizontalTexelOffset(void) { + return -0.5f; + } + //--------------------------------------------------------------------- + Real NULLRenderSystem::getVerticalTexelOffset(void) { + return -0.5f; + } + //--------------------------------------------------------------------- + void NULLRenderSystem::_applyObliqueDepthProjection(Matrix4& matrix, + const Plane& plane, bool forGpuProgram) { + } + //--------------------------------------------------------------------- + Real NULLRenderSystem::getMinimumDepthInputValue(void) { + return 0.0f; + } + + //--------------------------------------------------------------------- + Real NULLRenderSystem::getMaximumDepthInputValue(void) { + return -1.0f; + } + + //--------------------------------------------------------------------- + void NULLRenderSystem::preExtraThreadsStarted() { + + } + //--------------------------------------------------------------------- + void NULLRenderSystem::postExtraThreadsStarted() { + + } + //--------------------------------------------------------------------- + void NULLRenderSystem::registerThread() { + + } + //--------------------------------------------------------------------- + void NULLRenderSystem::unregisterThread() { + + } + + //--------------------------------------------------------------------- + RenderSystemCapabilities* NULLRenderSystem::createRenderSystemCapabilities() const { + mRealCapabilities->setCapability(RSC_HWSTENCIL); + mRealCapabilities->setStencilBufferBitDepth(8); + mRealCapabilities->setNumTextureUnits(16); + mRealCapabilities->setCapability(RSC_ANISOTROPY); + mRealCapabilities->setCapability(RSC_AUTOMIPMAP); + mRealCapabilities->setCapability(RSC_BLENDING); + mRealCapabilities->setCapability(RSC_DOT3); + mRealCapabilities->setCapability(RSC_CUBEMAPPING); + mRealCapabilities->setCapability(RSC_TEXTURE_COMPRESSION); + mRealCapabilities->setCapability(RSC_TEXTURE_COMPRESSION_DXT); + mRealCapabilities->setCapability(RSC_VBO); + mRealCapabilities->setCapability(RSC_SCISSOR_TEST); + mRealCapabilities->setCapability(RSC_TWO_SIDED_STENCIL); + mRealCapabilities->setCapability(RSC_STENCIL_WRAP); + mRealCapabilities->setCapability(RSC_HWOCCLUSION); + mRealCapabilities->setCapability(RSC_USER_CLIP_PLANES); + mRealCapabilities->setCapability(RSC_VERTEX_FORMAT_UBYTE4); + mRealCapabilities->setCapability(RSC_INFINITE_FAR_PLANE); + mRealCapabilities->setCapability(RSC_TEXTURE_3D); + mRealCapabilities->setCapability(RSC_NON_POWER_OF_2_TEXTURES); + mRealCapabilities->setCapability(RSC_NON_POWER_OF_2_TEXTURES); + mRealCapabilities->setNonPOW2TexturesLimited(true); + mRealCapabilities->setCapability(RSC_HWRENDER_TO_TEXTURE); + mRealCapabilities->setCapability(RSC_TEXTURE_FLOAT); + mRealCapabilities->setCapability(RSC_POINT_SPRITES); + mRealCapabilities->setCapability(RSC_POINT_EXTENDED_PARAMETERS); + mRealCapabilities->setMaxPointSize(256); + + return mRealCapabilities; + } + + //--------------------------------------------------------------------- + void NULLRenderSystem::initialiseFromRenderSystemCapabilities(RenderSystemCapabilities* caps, RenderTarget* primary) { + mRealCapabilities = caps; + } + + RenderWindow* NULLRenderSystem::_initialise(bool autoCreateWindow, + const String& windowTitle) { + RenderWindow* autoWindow = NULL; + + // Init using current settings + if (autoCreateWindow) { + autoWindow = this->_createRenderWindow(windowTitle, 640, 480, false, + NULL); + } + + // call superclass method + RenderSystem::_initialise(autoCreateWindow); + + return autoWindow; + } + +} + Property changes on: trunk/thirdparty/NullRenderer/NullRenderSystem.cpp ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/thirdparty/NullRenderer/NullRenderSystem.h =================================================================== --- trunk/thirdparty/NullRenderer/NullRenderSystem.h (rev 0) +++ trunk/thirdparty/NullRenderer/NullRenderSystem.h 2009-04-09 13:52:59 UTC (rev 1180) @@ -0,0 +1,202 @@ +#ifndef __NULLRENDERSYSTEM_H +#define __NULLRENDERSYSTEM_H + +#include "stdafx.h" +#include "NullHardwareBufferManager.h" +#include "NullGpuProgramManager.h" + +namespace Ogre { + +class NULLRenderSystem: public RenderSystem { +public: + NULLRenderSystem(); + ~NULLRenderSystem(); + + ConfigOptionMap m_options; + + virtual const String& getName(void) const; + virtual ConfigOptionMap& getConfigOptions(void); + virtual void setConfigOption(const String &name, const String &value); + virtual HardwareOcclusionQuery* createHardwareOcclusionQuery(void); + + virtual String validateConfigOptions(void); + + virtual void reinitialise(void); + + virtual void setAmbientLight(float r, float g, float b); + + virtual void setShadingType(ShadeOptions so); + + virtual void setLightingEnabled(bool enabled); + + virtual MultiRenderTarget * createMultiRenderTarget(const String & name); + + virtual String getErrorDescription(long errorNumber) const; + + // ------------------------------------------------------------------------ + // Internal Rendering Access + // All methods below here are normally only called by other OGRE classes + // They can be called by library user if required + // ------------------------------------------------------------------------ + + + virtual void _useLights(const LightList& lights, unsigned short limit); + virtual void _setWorldMatrix(const Matrix4 &m); + virtual void _setViewMatrix(const Matrix4 &m); + virtual void _setProjectionMatrix(const Matrix4 &m); + virtual void _setSurfaceParams(const ColourValue &ambient, + const ColourValue &diffuse, const ColourValue &specular, + const ColourValue &emissive, Real shininess, + TrackVertexColourType tracking = TVC_NONE); + + virtual void _setPointSpritesEnabled(bool enabled); + virtual void _setPointParameters(Real size, bool attenuationEnabled, + Real constant, Real linear, Real quadratic, Real minSize, + Real maxSize); + + virtual void _setTexture(size_t unit, bool enabled, const TexturePtr& tex); + + virtual void _setTextureCoordSet(size_t unit, size_t index); + + virtual void _setTextureCoordCalculation(size_t unit, TexCoordCalcMethod m, + const Frustum* frustum = 0); + + virtual void _setTextureBlendMode(size_t unit, const LayerBlendModeEx& bm); + + virtual void _setTextureMipmapBias(size_t unit, float bias); + + virtual void _setTextureUnitFiltering(size_t unit, FilterType ftype, + FilterOptions filter); + + virtual void _setTextureLayerAnisotropy(size_t unit, + unsigned int maxAnisotropy); + + virtual void _setTextureAddressingMode(size_t unit, + const TextureUnitState::UVWAddressingMode& uvw); + + virtual void + _setTextureBorderColour(size_t unit, const ColourValue& colour); + + virtual void _setTextureMatrix(size_t unit, const Matrix4& xform); + + virtual void _setSceneBlending(SceneBlendFactor sourceFactor, + SceneBlendFactor destFactor); + + virtual void _setSeparateSceneBlending(SceneBlendFactor sourceFactor, SceneBlendFactor destFactor, SceneBlendFactor sourceFactorAlpha, SceneBlendFactor destFactorAlpha); + + virtual void _setAlphaRejectSettings(CompareFunction func, + unsigned char value, bool alphaToCoverage); + virtual void _beginFrame(void); + + virtual void _endFrame(void); + virtual void _setViewport(Viewport *vp); + virtual void _setCullingMode(CullingMode mode); + + virtual void _setDepthBufferParams(bool depthTest = true, bool depthWrite = + true, CompareFunction depthFunction = CMPF_LESS_EQUAL); + virtual void _setDepthBufferCheckEnabled(bool enabled = true); + virtual void _setDepthBufferWriteEnabled(bool enabled = true); + virtual void + _setDepthBufferFunction(CompareFunction func = CMPF_LESS_EQUAL); + virtual void _setColourBufferWriteEnabled(bool red, bool green, bool blue, + bool alpha); + virtual void _setDepthBias(float bias, float slopeScaleBias); + virtual void _setFog(FogMode mode = FOG_NONE, const ColourValue& colour = + ColourValue::White, Real expDensity = 1.0, Real linearStart = 0.0, + Real linearEnd = 1.0); + + virtual VertexElementType getColourVertexElementType(void) const; + virtual void _convertProjectionMatrix(const Matrix4& matrix, Matrix4& dest, + bool forGpuProgram = false); + + virtual void _makeProjectionMatrix(const Radian& fovy, Real aspect, + Real nearPlane, Real farPlane, Matrix4& dest, bool forGpuProgram = + false); + + virtual void _makeProjectionMatrix(Real left, Real right, Real bottom, + Real top, Real nearPlane, Real farPlane, Matrix4& dest, + bool forGpuProgram = false); + virtual void _makeOrthoMatrix(const Radian& fovy, Real aspect, + Real nearPlane, Real farPlane, Matrix4& dest, bool forGpuProgram = + false); + + virtual void _applyObliqueDepthProjection(Matrix4& matrix, + const Plane& plane, bool forGpuProgram); + + virtual void _setPolygonMode(PolygonMode level); + + virtual void setStencilCheckEnabled(bool enabled); + virtual void setStencilBufferParams( + CompareFunction func = CMPF_ALWAYS_PASS, uint32 refValue = 0, + uint32 mask = 0xFFFFFFFF, + StencilOperation stencilFailOp = SOP_KEEP, + StencilOperation depthFailOp = SOP_KEEP, StencilOperation passOp = + SOP_KEEP, bool twoSidedOperation = false); + + virtual void setVertexDeclaration(VertexDeclaration* decl); + virtual void setVertexBufferBinding(VertexBufferBinding* binding); + virtual void setNormaliseNormals(bool normalise); + + virtual void _render(const RenderOperation& op); + const RenderSystemCapabilities* getCapabilities(void) const { + return mRealCapabilities; + } + virtual void bindGpuProgram(GpuProgram* prg); + virtual void bindGpuProgramParameters(GpuProgramType gptype, + GpuProgramParametersSharedPtr params); + virtual void bindGpuProgramPassIterationParameters(GpuProgramType gptype); + virtual void unbindGpuProgram(GpuProgramType gptype); + + virtual void setClipPlanesImpl(const PlaneList& clipPlanes); + virtual void enableClipPlane(Ogre::ushort index, bool enable); + virtual void setScissorTest(bool enabled, size_t left = 0, size_t top = 0, + size_t right = 800, size_t bottom = 600); + virtual void clearFrameBuffer(unsigned int buffers, + const ColourValue& colour = ColourValue::Black, Real depth = 1.0f, + unsigned short stencil = 0); + virtual Real getHorizontalTexelOffset(void); + virtual Real getVerticalTexelOffset(void); + virtual Real getMinimumDepthInputValue(void); + virtual Real getMaximumDepthInputValue(void); + + virtual void preExtraThreadsStarted(); + virtual void postExtraThreadsStarted(); + virtual void registerThread(); + virtual void unregisterThread(); + + void setCurrentPassIterationCount(const size_t count) { + mCurrentPassIterationCount = count; + } + + virtual RenderSystemCapabilities* createRenderSystemCapabilities() const; + + virtual void initialiseFromRenderSystemCapabilities(RenderSystemCapabilities* caps, RenderTarget* primary); + + class _OgreExport Listener { + public: + Listener() { + } + virtual ~Listener() { + } + + virtual void eventOccurred(const String& eventName, + const NameValuePairList* parameters = 0); + }; + virtual const StringVector& getRenderSystemEvents(void) const { + return mEventNames; + } + void setClipPlane(Ogre::ushort index, Real A, Real B, Real C, Real D); + + virtual RenderWindow* _initialise(bool autoCreateWindow, + const String& windowTitle = "null render window"); + + RenderWindow* _createRenderWindow(const String &name, + unsigned int width, unsigned int height, bool fullScreen, + const NameValuePairList *miscParams = 0); + + NULLHardwareBufferManager * m_pHardwareBufferManager; + NULLGpuProgramManager* mGpuProgramManager; +}; + +} +#endif Property changes on: trunk/thirdparty/NullRenderer/NullRenderSystem.h ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/thirdparty/NullRenderer/NullRenderToVertexBuffer.h =================================================================== --- trunk/thirdparty/NullRenderer/NullRenderToVertexBuffer.h (rev 0) +++ trunk/thirdparty/NullRenderer/NullRenderToVertexBuffer.h 2009-04-09 13:52:59 UTC (rev 1180) @@ -0,0 +1,19 @@ +#ifndef __NULLRENDERTOVERTEXBUFFER_H +#define __NULLRENDERTOVERTEXBUFFER_H + +#include "stdafx.h" + +namespace Ogre { + + class NULLRenderToVertexBuffer : public RenderToVertexBuffer { + public: + NULLRenderToVertexBuffer() {}; + + + virtual void getRenderOperation(Ogre::RenderOperation& op) {}; + virtual void update(Ogre::SceneManager*) {}; + }; + +} + +#endif Property changes on: trunk/thirdparty/NullRenderer/NullRenderToVertexBuffer.h ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/thirdparty/NullRenderer/NullRenderWindow.cpp =================================================================== --- trunk/thirdparty/NullRenderer/NullRenderWindow.cpp (rev 0) +++ trunk/thirdparty/NullRenderer/NullRenderWindow.cpp 2009-04-09 13:52:59 UTC (rev 1180) @@ -0,0 +1,48 @@ +#include "stdafx.h" +#include "NullRenderWindow.h" + +namespace Ogre { + + unsigned int NULLRenderWindow::mWindowHandle = 1; + + NULLRenderWindow::NULLRenderWindow() + { + mIsFullScreen = false; + mIsExternal = false; + mSizing = false; + mClosed = false; + } + + NULLRenderWindow::~NULLRenderWindow() + { + destroy(); + } + + + void NULLRenderWindow::create(const String& name, unsigned int width, unsigned int height, + bool fullScreen, const NameValuePairList *miscParams) + { + mWindowHandle++; + + } + + void NULLRenderWindow::destroy() + { + + } + + void NULLRenderWindow::reposition(int top, int left) + { + } + + void NULLRenderWindow::resize(unsigned int width, unsigned int height) + { + } + + //----------------------------------------------------------------------------- + void NULLRenderWindow::update(bool swap) + { + RenderWindow::update(swap); + } + +} Property changes on: trunk/thirdparty/NullRenderer/NullRenderWindow.cpp ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/thirdparty/NullRenderer/NullRenderWindow.h =================================================================== --- trunk/thirdparty/NullRenderer/NullRenderWindow.h (rev 0) +++ trunk/thirdparty/NullRenderer/NullRenderWindow.h 2009-04-09 13:52:59 UTC (rev 1180) @@ -0,0 +1,37 @@ +#ifndef __NULLRENDERWINDOW_H +#define __NULLRENDERWINDOW_H + +#include "stdafx.h" + +namespace Ogre { + + class NULLRenderWindow : public RenderWindow + { + public: + NULLRenderWindow(); + ~NULLRenderWindow(); + void create(const String& name, unsigned int width, unsigned int height, + bool fullScreen, const NameValuePairList *miscParams); + void destroy(void); + bool isClosed() const { return mClosed; } + void reposition(int left, int top); + void resize(unsigned int width, unsigned int height); + void swapBuffers( bool waitForVSync = true ) {}; + int getWindowHandle() const { return mWindowHandle; } + virtual void writeContentsToFile(const String& filename) {} + virtual void copyContentsToMemory(const PixelBox &dst, FrameBuffer buffer=FB_AUTO) {}; + virtual bool requiresTextureFlipping() const { return false;} + + /// @copydoc RenderTarget::update + void update(bool swap); + protected: + bool mIsExternal; // window not created by Ogre + bool mSizing; + bool mClosed; + bool mIsSwapChain; // Is this a secondary window? + static unsigned int mWindowHandle; + + }; +} + +#endif Property changes on: trunk/thirdparty/NullRenderer/NullRenderWindow.h ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/thirdparty/NullRenderer/NullRendererDll.cpp =================================================================== --- trunk/thirdparty/NullRenderer/NullRendererDll.cpp (rev 0) +++ trunk/thirdparty/NullRenderer/NullRendererDll.cpp 2009-04-09 13:52:59 UTC (rev 1180) @@ -0,0 +1,26 @@ +#include "stdafx.h" +#include "NullRenderSystem.h" +#include "NullHlslProgramFactory.h" + +namespace Ogre { + + NULLRenderSystem* nullRendPlugin; + NULLHLSLProgramFactory* hlslProgramFactory; + + extern "C" void dllStartPlugin(void) throw() + { + nullRendPlugin = new NULLRenderSystem(); + Ogre::Root::getSingleton().addRenderSystem( (Ogre::RenderSystem *)nullRendPlugin ); + + // create & register HLSL factory + hlslProgramFactory = new NULLHLSLProgramFactory(); + Ogre::HighLevelGpuProgramManager::getSingleton().addFactory(hlslProgramFactory); + } + + extern "C" void dllStopPlugin(void) + { + delete nullRendPlugin; + delete hlslProgramFactory; + } + +} Property changes on: trunk/thirdparty/NullRenderer/NullRendererDll.cpp ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/thirdparty/NullRenderer/NullTexture.h =================================================================== --- trunk/thirdparty/NullRenderer/NullTexture.h (rev 0) +++ trunk/thirdparty/NullRenderer/NullTexture.h 2009-04-09 13:52:59 UTC (rev 1180) @@ -0,0 +1,21 @@ +#ifndef __NULLTEXTURE_H +#define __NULLTEXTURE_H + +#include "stdafx.h" + +using namespace Ogre; + +class NULLTexture : public Texture +{ +public: + NULLTexture(ResourceManager* creator, const String& name, ResourceHandle handle, + const String& group, bool isManual = false, ManualResourceLoader* loader = 0) : Texture(creator, name, handle, group, isManual, loader) { } + ~NULLTexture() {} + void loadImpl(void) {} + void loadImage (const Ogre::Image &) {} + HardwarePixelBufferSharedPtr getBuffer(size_t face=0, size_t mipmap=0) { return HardwarePixelBufferSharedPtr(NULL); } + void createInternalResourcesImpl() {} + void freeInternalResourcesImpl() {} +}; + +#endif Property changes on: trunk/thirdparty/NullRenderer/NullTexture.h ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/thirdparty/NullRenderer/NullTextureManager.cpp =================================================================== --- trunk/thirdparty/NullRenderer/NullTextureManager.cpp (rev 0) +++ trunk/thirdparty/NullRenderer/NullTextureManager.cpp 2009-04-09 13:52:59 UTC (rev 1180) @@ -0,0 +1,36 @@ +#include "stdafx.h" +#include "NullTextureManager.h" +#include "NullTexture.h" + +namespace Ogre { + + NULLTextureManager::NULLTextureManager( ) : TextureManager() + { + ResourceGroupManager::getSingleton()._registerResourceManager(mResourceType, this); + } + + NULLTextureManager::~NULLTextureManager() + { + // unregister with group manager + ResourceGroupManager::getSingleton()._unregisterResourceManager(mResourceType); + + } + + Resource* NULLTextureManager::createImpl(const String& name, + ResourceHandle handle, const String& group, bool isManual, + ManualResourceLoader* loader, const NameValuePairList* createParams) + { + return new NULLTexture(this, name, handle, group, isManual, loader); + } + + + PixelFormat NULLTextureManager::getNativeFormat(TextureType ttype, PixelFormat format, int usage) + { + return PF_A8; + } + + bool NULLTextureManager::isHardwareFilteringSupported(TextureType ttype, PixelFormat format, int usage, bool preciseFormatOnly) { + return true; + } + +} Property changes on: trunk/thirdparty/NullRenderer/NullTextureManager.cpp ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/thirdparty/NullRenderer/NullTextureManager.h =================================================================== --- trunk/thirdparty/NullRenderer/NullTextureManager.h (rev 0) +++ trunk/thirdparty/NullRenderer/NullTextureManager.h 2009-04-09 13:52:59 UTC (rev 1180) @@ -0,0 +1,28 @@ +#ifndef __NULLTEXTUREMANAGER_H +#define __NULLTEXTUREMANAGER_H + +#include "stdafx.h" + +namespace Ogre { + + class NULLTextureManager : public TextureManager + { + protected: + /// @copydoc ResourceManager::createImpl + Resource* createImpl(const String& name, ResourceHandle handle, + const String& group, bool isManual, ManualResourceLoader* loader, + const NameValuePairList* createParams); + + public: + NULLTextureManager(); + ~NULLTextureManager(); + + /// @copydoc TextureManager::getNativeFormat + PixelFormat getNativeFormat(TextureType ttype, PixelFormat format, int usage); + + virtual bool isHardwareFilteringSupported (TextureType ttype, PixelFormat format, int usage, bool preciseFormatOnly=false); + }; + +} + +#endif Property changes on: trunk/thirdparty/NullRenderer/NullTextureManager.h ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/thirdparty/NullRenderer/stdafx.h =================================================================== --- trunk/thirdparty/NullRenderer/stdafx.h (rev 0) +++ trunk/thirdparty/NullRenderer/stdafx.h 2009-04-09 13:52:59 UTC (rev 1180) @@ -0,0 +1,14 @@ +#include <OgreRoot.h> +#include <OgreRenderSystem.h> +#include <OgreHardwareBufferManager.h> +#include <OgreTextureManager.h> +#include <OgreTexture.h> +#include <OgreHardwarePixelBuffer.h> +#include <OgreRenderWindow.h> +#include <OgreGpuProgramManager.h> +#include <OgreHighLevelGpuProgramManager.h> +#include <OgreGpuProgram.h> +#include <OgreStringConverter.h> +#include <OgreString.h> +#include <OgreResourceManager.h> +#include <OgreRenderSystemCapabilities.h> Property changes on: trunk/thirdparty/NullRenderer/stdafx.h ___________________________________________________________________ Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |