コード例 #1
0
 virtual ~TinyRendererGUIHelper()
 {
     for (int i=0;i<m_swRenderObjects.size();i++)
     {
         TinyRenderObjectData** d = m_swRenderObjects[i];
         if (d && *d)
         {
             delete *d;
         }
     }
 }
コード例 #2
0
	virtual int	registerTexture(const unsigned char* texels, int width, int height)
	{
		//do we need to make a copy?
		int textureId = m_textures.size();
		TinyRendererTexture t;
		t.m_texels = texels;
		t.m_width = width;
		t.m_height = height;
		this->m_textures.insert(textureId,t);
		return textureId;
	}
コード例 #3
0
	virtual ~SW_And_OpenGLGuiHelper()
	{
		for (int i = 0; i < m_swRenderObjects.size(); i++)
		{
			TinyRenderObjectData** d = m_swRenderObjects[i];
			if (d && *d)
			{
				delete *d;
			}
		}
	}
コード例 #4
0
	virtual int registerGraphicsShape(const float* vertices, int numvertices, const int* indices, int numIndices,int primitiveType, int textureId)
	{
		int shapeIndex = m_swRenderObjects.size();

		TinyRenderObjectData* swObj = new TinyRenderObjectData(m_rgbColorBuffer,m_depthBuffer);
        float rgbaColor[4] = {1,1,1,1};

		//if (textureId>=0)
		//{
		//	swObj->registerMeshShape(vertices,numvertices,indices,numIndices,rgbaColor);
		//} else
		{
			swObj->registerMeshShape(vertices,numvertices,indices,numIndices,rgbaColor);
		}
		//swObj->createCube(1,1,1);//MeshShape(vertices,numvertices,indices,numIndices);
        m_swRenderObjects.insert(shapeIndex,swObj);
		return shapeIndex;
	}