mirror of
https://github.com/bulletphysics/bullet3
synced 2024-12-14 05:40:05 +00:00
don't pass width/height into renderObject
This commit is contained in:
parent
d2e50d045b
commit
e0c3392cee
@ -363,7 +363,7 @@ void TinyRendererSetup::stepSimulation(float deltaTime)
|
||||
|
||||
}
|
||||
}
|
||||
TinyRenderer::renderObject(*m_internalData->m_renderObjects[o], m_internalData->m_width,m_internalData->m_height);
|
||||
TinyRenderer::renderObject(*m_internalData->m_renderObjects[o]);
|
||||
}
|
||||
//m_app->drawText("hello",500,500);
|
||||
render->activateTexture(m_internalData->m_textureHandle);
|
||||
|
@ -576,7 +576,7 @@ void TinyRendererVisualShapeConverter::render(const float viewMat[16], const flo
|
||||
renderObj->m_lightDirWorld = lightDirWorld;
|
||||
}
|
||||
}
|
||||
TinyRenderer::renderObject(*renderObj,m_data->m_swWidth,m_data->m_swHeight);
|
||||
TinyRenderer::renderObject(*renderObj);
|
||||
}
|
||||
}
|
||||
//printf("write tga \n");
|
||||
|
@ -110,7 +110,7 @@ public:
|
||||
int shapeIndex = OpenGLGuiHelper::registerGraphicsShape(vertices,numvertices,indices,numIndices);
|
||||
if (shapeIndex>=0)
|
||||
{
|
||||
TinyRenderObjectData* swObj = new TinyRenderObjectData(m_swWidth,m_swHeight,m_rgbColorBuffer,m_depthBuffer);
|
||||
TinyRenderObjectData* swObj = new TinyRenderObjectData(m_rgbColorBuffer,m_depthBuffer);
|
||||
float rgbaColor[4] = {1,1,1,1};
|
||||
swObj->registerMeshShape(vertices,numvertices,indices,numIndices,rgbaColor);
|
||||
//swObj->createCube(1,1,1);//MeshShape(vertices,numvertices,indices,numIndices);
|
||||
|
@ -253,7 +253,7 @@ struct TinyRendererGUIHelper : public GUIHelperInterface
|
||||
{
|
||||
int shapeIndex = m_swRenderObjects.size();
|
||||
|
||||
TinyRenderObjectData* swObj = new TinyRenderObjectData(m_swWidth,m_swHeight,m_rgbColorBuffer,m_depthBuffer);
|
||||
TinyRenderObjectData* swObj = new TinyRenderObjectData(m_rgbColorBuffer,m_depthBuffer);
|
||||
float rgbaColor[4] = {1,1,1,1};
|
||||
swObj->registerMeshShape(vertices,numvertices,indices,numIndices,rgbaColor);
|
||||
//swObj->createCube(1,1,1);//MeshShape(vertices,numvertices,indices,numIndices);
|
||||
|
@ -231,8 +231,11 @@ TinyRenderObjectData::~TinyRenderObjectData()
|
||||
delete m_model;
|
||||
}
|
||||
|
||||
void TinyRenderer::renderObject(TinyRenderObjectData& renderData, int width, int height)
|
||||
void TinyRenderer::renderObject(TinyRenderObjectData& renderData)
|
||||
{
|
||||
int width = renderData.m_rgbColorBuffer.get_width();
|
||||
int height = renderData.m_rgbColorBuffer.get_height();
|
||||
|
||||
Vec3f light_dir_local = Vec3f(renderData.m_lightDirWorld[0],renderData.m_lightDirWorld[1],renderData.m_lightDirWorld[2]);
|
||||
Model* model = renderData.m_model;
|
||||
if (0==model)
|
||||
|
@ -47,7 +47,7 @@ struct TinyRenderObjectData
|
||||
class TinyRenderer
|
||||
{
|
||||
public:
|
||||
static void renderObject(TinyRenderObjectData& renderData, int width, int height);
|
||||
static void renderObject(TinyRenderObjectData& renderData);
|
||||
};
|
||||
|
||||
#endif // TINY_RENDERER_Hbla
|
||||
|
@ -86,7 +86,7 @@ int main(int argc, char* argv[])
|
||||
b3AlignedObjectArray<float> depthBuffer;
|
||||
depthBuffer.resize(gWidth*gHeight);
|
||||
|
||||
TinyRenderObjectData renderData(textureWidth, textureHeight,rgbColorBuffer,depthBuffer);//, "african_head/african_head.obj");//floor.obj");
|
||||
TinyRenderObjectData renderData(rgbColorBuffer,depthBuffer);//, "african_head/african_head.obj");//floor.obj");
|
||||
|
||||
//renderData.loadModel("african_head/african_head.obj");
|
||||
renderData.loadModel("floor.obj");
|
||||
|
Loading…
Reference in New Issue
Block a user