I'm trying to draw a black bar across the top of the screen.
Below is the code in my class that actually draws the bar (or right now, its a box). the function "getCinematicScreenActive()" simply returns a bool value.
drawCinemaScreen:
Code: Select all
drawCinemaScreen(/*pointer to driver*/)
{
if( getCinematicScreenActive() == true ){
// Draw black rectangle at the top of the screen
driver->draw2DRectangle(video::SColor(255,255,255,255),
core::rect<s32>( core::position2d<s32>(0,0), core::position2d<s32>(100,100)) );
}
}
Code: Select all
while( device->run() ){
driver->beginScene(true, true, video::SColor(0,100,100,100) );
smgr->drawAll();
// Draw the cinema screen
cinema.setCinematicScreenActive(true);
cinema.drawCinemaScreen(driver);
driver->endScene();
}Now, my problem is that whenever I change the parameters for the 'draw2DRectangle' function, I have to setCinematicScreenActive(false) then compile and run the program, then set it to true again.
So, say I draw a black box at (0,0). Then I decide I want it white. So, I change the 'SColor' parameters in 'draw2DRectangle'. Then I compile and run it again. The box will stay black no matter how many times it is compiled until I set the bool value to false with "setCinematicScreenActive(false)", compile and run it again, so no box is drawn and then set the bool value to true using "setCinematicScreenActive(true)" and compile and run it. Then the box will be white.
Ideas??
EDIT: Actually, I found out that when I set to false, I don't have to run it. I can just compile it with false, then compile again with true.