Permalink
Browse files

-Change: display FPS under win32

  • Loading branch information...
miniupnp committed Jan 1, 2017
1 parent 12647ae commit 56c1ebc5f37a74d7a71dbbe7ba9376fa18d88e0b
@@ -495,6 +495,10 @@
<ExcludedFromBuild>true</ExcludedFromBuild>
<ObjectFileName>$(IntDir)src\video\</ObjectFileName>
</ClCompile>
<ClCompile Include="..\src\video\video_fps.c">
<ObjectFileName>$(IntDir)src\video\</ObjectFileName>
</ClCompile>
<ClInclude Include="..\src\video\video_fps.h" />
<ClCompile Include="..\src\video\video_sdl.c">
<ExcludedFromBuild>true</ExcludedFromBuild>
<ObjectFileName>$(IntDir)src\video\</ObjectFileName>
@@ -576,6 +576,12 @@
<ClCompile Include="..\src\video\video_atari.c">
<Filter>src\video</Filter>
</ClCompile>
<ClCompile Include="..\src\video\video_fps.c">
<Filter>src\video</Filter>
</ClCompile>
<ClInclude Include="..\src\video\video_fps.h">
<Filter>src\video</Filter>
</ClInclude>
<ClCompile Include="..\src\video\video_sdl.c">
<Filter>src\video</Filter>
</ClCompile>
@@ -506,6 +506,10 @@
<ExcludedFromBuild>true</ExcludedFromBuild>
<ObjectFileName>$(IntDir)src\video\</ObjectFileName>
</ClCompile>
<ClCompile Include="..\src\video\video_fps.c">
<ObjectFileName>$(IntDir)src\video\</ObjectFileName>
</ClCompile>
<ClInclude Include="..\src\video\video_fps.h" />
<ClCompile Include="..\src\video\video_sdl.c">
<ExcludedFromBuild>true</ExcludedFromBuild>
<ObjectFileName>$(IntDir)src\video\</ObjectFileName>
@@ -576,6 +576,12 @@
<ClCompile Include="..\src\video\video_atari.c">
<Filter>src\video</Filter>
</ClCompile>
<ClCompile Include="..\src\video\video_fps.c">
<Filter>src\video</Filter>
</ClCompile>
<ClInclude Include="..\src\video\video_fps.h">
<Filter>src\video</Filter>
</ClInclude>
<ClCompile Include="..\src\video\video_sdl.c">
<Filter>src\video</Filter>
</ClCompile>
@@ -506,6 +506,10 @@
<ExcludedFromBuild>true</ExcludedFromBuild>
<ObjectFileName>$(IntDir)src\video\</ObjectFileName>
</ClCompile>
<ClCompile Include="..\src\video\video_fps.c">
<ObjectFileName>$(IntDir)src\video\</ObjectFileName>
</ClCompile>
<ClInclude Include="..\src\video\video_fps.h" />
<ClCompile Include="..\src\video\video_sdl.c">
<ExcludedFromBuild>true</ExcludedFromBuild>
<ObjectFileName>$(IntDir)src\video\</ObjectFileName>
@@ -576,6 +576,12 @@
<ClCompile Include="..\src\video\video_atari.c">
<Filter>src\video</Filter>
</ClCompile>
<ClCompile Include="..\src\video\video_fps.c">
<Filter>src\video</Filter>
</ClCompile>
<ClInclude Include="..\src\video\video_fps.h">
<Filter>src\video</Filter>
</ClInclude>
<ClCompile Include="..\src\video\video_sdl.c">
<Filter>src\video</Filter>
</ClCompile>
@@ -4716,6 +4716,46 @@
/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\video\video_fps.c"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)\src\video\"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)\src\video\"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
>
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)\src\video\"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
>
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)\src\video\"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\video\video_fps.h"
>
</File>
<File
RelativePath="..\src\video\video_sdl.c"
>
View
@@ -10,6 +10,7 @@
#include "../os/error.h"
#include "video.h"
#include "video_fps.h"
#include "../gfx.h"
#include "../opendune.h"
@@ -58,6 +59,8 @@ static uint16 s_mouseMaxX = 0;
static uint16 s_mouseMinY = 0;
static uint16 s_mouseMaxY = 0;
static bool s_showFPS = false;
typedef struct VkMapping {
WPARAM vk;
uint16 scan;
@@ -196,6 +199,9 @@ static LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l
HBITMAP old_bmp;
if (!GetUpdateRect(hwnd, NULL, FALSE)) return 0;
if (s_showFPS) {
Video_ShowFPS(s_screen);
}
if (s_scale_filter == FILTER_SCALE2X) {
scale(s_screen_magnification, s_screen2, s_screen_magnification * SCREEN_WIDTH, s_screen, SCREEN_WIDTH, 1, SCREEN_WIDTH, SCREEN_HEIGHT);
} else if(s_scale_filter == FILTER_HQX) {
@@ -336,6 +342,11 @@ static LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l
case WM_KEYUP: {
uint16 scan;
if(wParam == VK_F8) {
if(keyup) s_showFPS = !s_showFPS;
return 0;
}
scan = MapKey(wParam);
if (scan == 0) {

0 comments on commit 56c1ebc

Please sign in to comment.