mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-11-02 06:05:31 +00:00
30-picking: Show error when blit is not supported.
This commit is contained in:
@@ -7,8 +7,11 @@
|
||||
#include "entry/entry.h"
|
||||
#include "entry/cmd.h"
|
||||
#include <bx/string.h>
|
||||
#include <bx/timer.h>
|
||||
|
||||
void showExampleDialog(entry::AppI* _app)
|
||||
#include <stdio.h>
|
||||
|
||||
void showExampleDialog(entry::AppI* _app, const char* _errorText)
|
||||
{
|
||||
char temp[1024];
|
||||
bx::snprintf(temp, BX_COUNTOF(temp), "Example: %s", _app->getName() );
|
||||
@@ -26,6 +29,24 @@ void showExampleDialog(entry::AppI* _app)
|
||||
ImGui::TextWrapped("%s", _app->getDescription() );
|
||||
ImGui::Separator();
|
||||
|
||||
if (NULL != _errorText)
|
||||
{
|
||||
const int64_t now = bx::getHPCounter();
|
||||
const int64_t freq = bx::getHPFrequency();
|
||||
const float time = float(now%freq)/float(freq);
|
||||
|
||||
bool blink = time > 0.5f;
|
||||
|
||||
ImGui::PushStyleColor(ImGuiCol_Text
|
||||
, blink
|
||||
? ImVec4(1.0, 0.0, 0.0, 1.0)
|
||||
: ImVec4(1.0, 1.0, 1.0, 1.0)
|
||||
);
|
||||
ImGui::TextWrapped("%s", _errorText);
|
||||
ImGui::Separator();
|
||||
ImGui::PopStyleColor();
|
||||
}
|
||||
|
||||
{
|
||||
uint32_t num = entry::getNumApps();
|
||||
const char** items = (const char**)alloca(num*sizeof(void*) );
|
||||
|
||||
Reference in New Issue
Block a user