Giter Site home page Giter Site logo

Comments (2)

sharpdigger avatar sharpdigger commented on June 11, 2024

你这是能跑多快跑多快的节奏啊!

2014-04-18 17:24 GMT+08:00 Hai Bai [email protected]:

UpdateWindow之后是不是应该用如下代码刷新:
MSG msg;
while (1)
{
if (! PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
ejoy2d_win_update();
InvalidateRect(wnd, NULL , FALSE);
if (WM_QUIT == msg.message)
{
break;
}
continue;
}
TranslateMessage(&msg);
DispatchMessage(&msg);
}

在我的机器上(Win7, Intel i3)上动画不能正常播放。


Reply to this email directly or view it on GitHubhttps://github.com//issues/47
.

from ejoy2d.

eminom avatar eminom commented on June 11, 2024

void
ejoy2d_win_update() {
static int ifirst = 1;
static DWORD last_tick = 0;
if(ifirst){
last_tick = GetTickCount();
ifirst = 0;
}
DWORD dwNow = GetTickCount();
float delta = 1.0f * (dwNow - last_tick) / 1000;
last_tick = dwNow;
//ejoy2d_game_update(G->game, 0.01f); //之前是hardcode的0.01
ejoy2d_game_update(G->game, delta);
}
这样就可以了。

from ejoy2d.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.