put this following code in you`re while loop but remember to put this after drawAll otherwise it won`t work.
Code: Select all
while(device->run())
{
driver->beginScene(true, true, SColor(255,100,101,140)); //Must draw between begin and end. Begin drawing
//////////////////////////////////////////////////////////////Begin drawing
smgr->drawAll(); //Scenemanager drawing
//Draw crosshair
driver->draw2DRectangle( SColor(255,255,255,255), rect<s32>(cenW,cenH-8,cenW+2,cenH-3) ); //above
driver->draw2DRectangle( SColor(255,255,255,255), rect<s32>(cenW+5,cenH,cenW+10,cenH+2) ); //right
driver->draw2DRectangle( SColor(255,255,255,255), rect<s32>(cenW,cenH+5,cenW+2,cenH+10) ); //down
driver->draw2DRectangle( SColor(255,255,255,255), rect<s32>(cenW-8,cenH,cenW-3,cenH+2) ); //left
driver->draw2DRectangle( SColor(255,255,255,255), rect<s32>(cenW,cenH,cenW+2,cenH+2) ); //center of screen
guienv->drawAll(); //Gui environment drawing
//////////////////////////////////////////////////////////////End drawing
driver->endScene(); //Stop drawing
}
Code: Select all
int screenW = 800;
int screenH = 600;
int cenW = screenW / 2;
int cenH = screenH / 2;