示例#1
0
void TinyRendererSetup::initPhysics()
{
	//request a visual bitma/texture we can render to
	
    m_app->setUpAxis(2);
    
	CommonRenderInterface* render = m_app->m_renderer;
	
	m_internalData->m_textureHandle = render->registerTexture(m_internalData->m_rgbColorBuffer.buffer(),m_internalData->m_width,m_internalData->m_height);
    
    {
    ComboBoxParams comboParams;
    comboParams.m_userPointer = this;
    comboParams.m_numItems=sizeof(items)/sizeof(char*);
    comboParams.m_startItem = 1;
    comboParams.m_items=items;
    comboParams.m_callback =TinyRendererComboCallback;
    m_guiHelper->getParameterInterface()->registerComboBox( comboParams);
    }

    {
    
    ComboBoxParams comboParams;
    comboParams.m_userPointer = this;
    comboParams.m_numItems=sizeof(itemsanimate)/sizeof(char*);
    comboParams.m_startItem = 0;
    comboParams.m_items=itemsanimate;
    comboParams.m_callback =TinyRendererComboCallbackAnimate;
    m_guiHelper->getParameterInterface()->registerComboBox( comboParams);
    }
    
}
	SW_And_OpenGLGuiHelper(CommonGraphicsApp* glApp, bool useOpenGL2, int swWidth, int swHeight, GLPrimitiveRenderer* primRenderer)
		: OpenGLGuiHelper(glApp, useOpenGL2),
		  m_swWidth(swWidth),
		  m_swHeight(swHeight),
		  m_rgbColorBuffer(swWidth, swHeight, TGAImage::RGB),
		  m_primRenderer(primRenderer)
	{
		m_depthBuffer.resize(swWidth * swHeight);
		CommonRenderInterface* render = getRenderInterface();
		m_image = new unsigned char[m_swWidth * m_swHeight * 4];

		m_textureHandle = render->registerTexture(m_image, m_swWidth, m_swHeight);
	}