摘要:
VOID SnakeGame_Update(DWORD dwDeltaTime){ /* 游戏更新 */ if (g_game == NULL) return; g_game->Update(dwDeltaTime);}调用游戏的更新,并传入与上次更新的时间差(毫秒数)。 ④ 游戏渲染VOID Sn 阅读全文
摘要:
#include <windows.h> // Standard Window header required for all programs#include <stdio.h>#include <GL\gl.h> // OpenGL functions #include <GL\glaux.h> 阅读全文
摘要:
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam){ // 游戏中对窗口的消息进行处理 if (g_game != NULL) g_game->WndProc(hWnd, message, w 阅读全文
摘要:
MSG msg = { 0 };DWORD dwLastTick = ::GetTickCount(), dwCurrentTick;while (msg.message != WM_QUIT){ // 当前时间戳 dwCurrentTick = ::GetTickCount(); if (Peek 阅读全文
摘要:
VOID SnakeGame_KeyDown(WPARAM wParam) { if (g_game == NULL) return; (http://www.amjmh.com/v/BIBRGZ_558768/) Keys key = Keys::KEY_W; if (wParam == 'W') 阅读全文