mirror of
https://github.com/minetest/irrlicht.git
synced 2025-06-28 06:20:21 +02:00
Merging r6288 through r6336 from trunk to ogl-es branch
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/branches/ogl-es@6337 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
@ -12,7 +12,7 @@ IrrlichtHome := ../..
|
||||
BinPath = ../../bin/$(SYSTEM)
|
||||
|
||||
# general compiler settings (might need to be set when compiling the lib, too)
|
||||
CPPFLAGS += -I$(IrrlichtHome)/include -I/usr/X11R6/include
|
||||
CPPFLAGS += -I$(IrrlichtHome)/include
|
||||
ifndef NDEBUG
|
||||
CXXFLAGS += -g -Wall
|
||||
else
|
||||
|
@ -201,7 +201,7 @@ int main()
|
||||
*/
|
||||
int lastFPS = -1;
|
||||
|
||||
// In order to do framerate independent movement, we have to know
|
||||
// In order to do frame rate independent movement, we have to know
|
||||
// how long it was since the last frame
|
||||
u32 then = device->getTimer()->getTime();
|
||||
|
||||
@ -215,21 +215,24 @@ int main()
|
||||
const f32 frameDeltaTime = (f32)(now - then) / 1000.f; // Time in seconds
|
||||
then = now;
|
||||
|
||||
/* Check if keys W, S, A or D are being held down, and move the
|
||||
sphere node around respectively. */
|
||||
core::vector3df nodePosition = sphereNode->getPosition();
|
||||
if ( sphereNode )
|
||||
{
|
||||
/* Check if keys W, S, A or D are being held down, and move the
|
||||
sphere node around respectively. */
|
||||
core::vector3df nodePosition = sphereNode->getPosition();
|
||||
|
||||
if(receiver.IsKeyDown(irr::KEY_KEY_W))
|
||||
nodePosition.Y += MOVEMENT_SPEED * frameDeltaTime;
|
||||
else if(receiver.IsKeyDown(irr::KEY_KEY_S))
|
||||
nodePosition.Y -= MOVEMENT_SPEED * frameDeltaTime;
|
||||
if(receiver.IsKeyDown(irr::KEY_KEY_W))
|
||||
nodePosition.Y += MOVEMENT_SPEED * frameDeltaTime;
|
||||
else if(receiver.IsKeyDown(irr::KEY_KEY_S))
|
||||
nodePosition.Y -= MOVEMENT_SPEED * frameDeltaTime;
|
||||
|
||||
if(receiver.IsKeyDown(irr::KEY_KEY_A))
|
||||
nodePosition.X -= MOVEMENT_SPEED * frameDeltaTime;
|
||||
else if(receiver.IsKeyDown(irr::KEY_KEY_D))
|
||||
nodePosition.X += MOVEMENT_SPEED * frameDeltaTime;
|
||||
if(receiver.IsKeyDown(irr::KEY_KEY_A))
|
||||
nodePosition.X -= MOVEMENT_SPEED * frameDeltaTime;
|
||||
else if(receiver.IsKeyDown(irr::KEY_KEY_D))
|
||||
nodePosition.X += MOVEMENT_SPEED * frameDeltaTime;
|
||||
|
||||
sphereNode->setPosition(nodePosition);
|
||||
sphereNode->setPosition(nodePosition);
|
||||
}
|
||||
|
||||
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,113,113,133));
|
||||
|
||||
|
Reference in New Issue
Block a user