Updated screenshots.
|
@ -104,12 +104,18 @@ Use a single distance field font to render text of various size.
|
||||||
### 12-lod
|
### 12-lod
|
||||||
Mesh LOD transitions.
|
Mesh LOD transitions.
|
||||||
|
|
||||||
|
![example-12-lod](https://github.com/bkaradzic/bgfx/raw/master/examples/12-lod/screenshot.png)
|
||||||
|
|
||||||
### 13-stencil
|
### 13-stencil
|
||||||
Stencil reflections and shadows.
|
Stencil reflections and shadows.
|
||||||
|
|
||||||
|
![example-13-stencil](https://github.com/bkaradzic/bgfx/raw/master/examples/13-stencil/screenshot.png)
|
||||||
|
|
||||||
### 14-shadowvolumes
|
### 14-shadowvolumes
|
||||||
Shadow volumes.
|
Shadow volumes.
|
||||||
|
|
||||||
|
![example-14-shadowvolumes](https://github.com/bkaradzic/bgfx/raw/master/examples/14-shadowvolumes/screenshot.png)
|
||||||
|
|
||||||
Dependencies
|
Dependencies
|
||||||
------------
|
------------
|
||||||
|
|
||||||
|
|
Before Width: | Height: | Size: 110 KiB After Width: | Height: | Size: 156 KiB |
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 48 KiB |
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 66 KiB After Width: | Height: | Size: 62 KiB |
Before Width: | Height: | Size: 98 KiB After Width: | Height: | Size: 122 KiB |
Before Width: | Height: | Size: 222 KiB After Width: | Height: | Size: 229 KiB |
Before Width: | Height: | Size: 283 KiB After Width: | Height: | Size: 310 KiB |
Before Width: | Height: | Size: 163 KiB After Width: | Height: | Size: 97 KiB |
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 254 KiB |
BIN
examples/12-lod/screenshot.png
Normal file
After Width: | Height: | Size: 52 KiB |
BIN
examples/13-stencil/screenshot.png
Normal file
After Width: | Height: | Size: 151 KiB |
BIN
examples/14-shadowvolumes/screenshot.png
Normal file
After Width: | Height: | Size: 247 KiB |
|
@ -6,6 +6,8 @@
|
||||||
#include <bgfx.h>
|
#include <bgfx.h>
|
||||||
#include <bx/string.h>
|
#include <bx/string.h>
|
||||||
|
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
#include "entry_p.h"
|
#include "entry_p.h"
|
||||||
#include "cmd.h"
|
#include "cmd.h"
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
|
@ -72,6 +74,24 @@ namespace entry
|
||||||
bgfx::setDebug(s_debug);
|
bgfx::setDebug(s_debug);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
else if (0 == strcmp(_argv[1], "screenshot") )
|
||||||
|
{
|
||||||
|
if (_argc > 2)
|
||||||
|
{
|
||||||
|
bgfx::saveScreenShot(_argv[2]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
time_t tt;
|
||||||
|
time(&tt);
|
||||||
|
|
||||||
|
char filePath[256];
|
||||||
|
bx::snprintf(filePath, sizeof(filePath), "temp/screenshot-%d", tt);
|
||||||
|
bgfx::saveScreenShot(filePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -85,12 +105,13 @@ namespace entry
|
||||||
|
|
||||||
static const InputBinding s_bindings[] =
|
static const InputBinding s_bindings[] =
|
||||||
{
|
{
|
||||||
{ entry::Key::KeyQ, entry::Modifier::LeftCtrl, 1, cmd, "exit" },
|
{ entry::Key::KeyQ, entry::Modifier::LeftCtrl, 1, cmd, "exit" },
|
||||||
{ entry::Key::F1, entry::Modifier::None, 1, cmd, "graphics stats" },
|
{ entry::Key::F1, entry::Modifier::None, 1, cmd, "graphics stats" },
|
||||||
{ entry::Key::F1, entry::Modifier::LeftShift, 1, cmd, "graphics stats 0\ngraphics text 0" },
|
{ entry::Key::F1, entry::Modifier::LeftShift, 1, cmd, "graphics stats 0\ngraphics text 0" },
|
||||||
{ entry::Key::F3, entry::Modifier::None, 1, cmd, "graphics wireframe" },
|
{ entry::Key::F3, entry::Modifier::None, 1, cmd, "graphics wireframe" },
|
||||||
{ entry::Key::F7, entry::Modifier::None, 1, cmd, "graphics vsync" },
|
{ entry::Key::F7, entry::Modifier::None, 1, cmd, "graphics vsync" },
|
||||||
{ entry::Key::F8, entry::Modifier::None, 1, cmd, "graphics msaa" },
|
{ entry::Key::F8, entry::Modifier::None, 1, cmd, "graphics msaa" },
|
||||||
|
{ entry::Key::Print, entry::Modifier::None, 1, cmd, "graphics screenshot" },
|
||||||
|
|
||||||
INPUT_BINDING_END
|
INPUT_BINDING_END
|
||||||
};
|
};
|
||||||
|
@ -176,9 +197,10 @@ namespace entry
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} while (NULL != ev);
|
|
||||||
|
|
||||||
inputProcess();
|
inputProcess();
|
||||||
|
|
||||||
|
} while (NULL != ev);
|
||||||
|
|
||||||
if (_reset != s_reset)
|
if (_reset != s_reset)
|
||||||
{
|
{
|
||||||
|
|
|
@ -415,6 +415,17 @@ namespace entry
|
||||||
{
|
{
|
||||||
uint8_t modifiers = translateKeyModifiers();
|
uint8_t modifiers = translateKeyModifiers();
|
||||||
Key::Enum key = translateKey(_wparam);
|
Key::Enum key = translateKey(_wparam);
|
||||||
|
|
||||||
|
if (Key::Print == key
|
||||||
|
&& 0x3 == (_lparam>>30) )
|
||||||
|
{
|
||||||
|
// VK_SNAPSHOT doesn't generate keydown event. Fire on down event when previous
|
||||||
|
// key state bit is set to 1 and transition state bit is set to 1.
|
||||||
|
//
|
||||||
|
// http://msdn.microsoft.com/en-us/library/windows/desktop/ms646280%28v=vs.85%29.aspx
|
||||||
|
m_eventQueue.postKeyEvent(key, modifiers, true);
|
||||||
|
}
|
||||||
|
|
||||||
m_eventQueue.postKeyEvent(key, modifiers, _id == WM_KEYDOWN || _id == WM_SYSKEYDOWN);
|
m_eventQueue.postKeyEvent(key, modifiers, _id == WM_KEYDOWN || _id == WM_SYSKEYDOWN);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|