12 #define STB_IMAGE_IMPLEMENTATION 26 std::cerr <<
"GLFW Driver Error: " << description <<
"\n";
41 fprintf(stderr,
"GL CALLBACK: %s type = 0x%x, severity = 0x%x, message = %s\n",
43 type, severity, message);
85 catch (
const std::exception&)
110 bool use_glsl =
false;
196 icon[3].
pixels = icon_256;
233 if (!
ctx)
throw std::runtime_error(
"Could not initialize offscreen context!");
247 throw std::runtime_error(
"OpenGL 3.0 or ARB_vertex_array_object extension required!");
301 throw std::runtime_error(
"Could not open OpenGL window, please check your graphic drivers or use the textual SDK tools");
312 bool legal_position =
false;
318 legal_position =
true;
365 _2d_vis = std::make_shared<visualizer_2d>(std::make_shared<splash_screen_shader>());
377 data->_mouse.cursor = { (float)cx /
data->_scale_factor,
378 (
float)cy /
data->_scale_factor };
389 data->_mouse.mouse_wheel =
static_cast<int>(
yoffset);
390 data->_mouse.ui_wheel +=
static_cast<int>(
yoffset);
397 if (count <= 0)
return;
401 data->on_file_drop(paths[
i]);
483 bool do_200ms = every_200ms;
504 text_color.
w = opacity;
520 ux_window::operator bool()
526 std::stringstream temp_title;
531 temp_title <<
", FPS: " <<
fps;
538 std::this_thread::yield();
543 std::this_thread::sleep_for(std::chrono::milliseconds(10));
563 std::this_thread::sleep_for(std::chrono::seconds(1));
596 auto is_last_msg = (msg == _on_load_message.back());
599 else if (!is_last_msg)
609 std::this_thread::sleep_for(std::chrono::milliseconds(10));
GLAPI int GLAD_GL_APPLE_vertex_array_object
float smoothstep(float x, float min, float max)
static const textual_icon lock
void init_processing(bool use_glsl=true)
IMGUI_API void PushStyleVar(ImGuiStyleVar idx, float val)
static const ImVec4 transparent
GLenum GLuint GLenum GLsizei const GLchar * message
GLuint get_gl_handle() const
static const ImVec4 white
GLFWAPI void glfwFocusWindow(GLFWwindow *window)
Brings the specified window to front and sets input focus.
GLFWAPI void glfwGetWindowSize(GLFWwindow *window, int *width, int *height)
Retrieves the size of the client area of the specified window.
GLenum GLuint GLenum severity
static const char * is_measuring
std::string to_lower(std::string x)
int rs2_get_api_version(rs2_error **error)
GLFWcursor * _hand_cursor
GLFWAPI int glfwGetWindowAttrib(GLFWwindow *window, int attrib)
Returns an attribute of the specified window.
static const char * position_y
GLFWAPI void glfwSetWindowTitle(GLFWwindow *window, const char *title)
Sets the title of the specified window.
GLFWAPI GLFWwindowsizefun glfwSetWindowSizeCallback(GLFWwindow *window, GLFWwindowsizefun cbfun)
Sets the size callback for the specified window.
GLFWAPI GLFWglproc glfwGetProcAddress(const char *procname)
Returns the address of the specified function for the current context.
IMGUI_API void ClearFonts()
bool _hovers_any_input_window
void *(* GLADloadproc)(const char *name)
std::function< bool()> on_load
static uint32_t icon_64_png_size
static const ImVec4 light_grey
static const char * recommend_calibration
static config_file & instance()
#define GL_DEBUG_TYPE_ERROR
constexpr const char * server_versions_db_url
static const char * commands_xml
GLsizei const GLchar *const * path
GLFWAPI const GLFWvidmode * glfwGetVideoMode(GLFWmonitor *monitor)
Returns the current mode of the specified monitor.
GLFWAPI void * glfwGetWindowUserPointer(GLFWwindow *window)
Returns the user pointer of the specified window.
device_list query_devices() const
GLsizei const GLuint * paths
struct GLFWmonitor GLFWmonitor
IMGUI_API void SetNextWindowPos(const ImVec2 &pos, ImGuiSetCond cond=0)
static uint8_t icon_64_png_data[]
void ImGui_ImplGlfw_Shutdown()
static const char * log_to_file
std::string get_folder_path(special_folder f)
GLFWAPI GLFWerrorfun glfwSetErrorCallback(GLFWerrorfun cbfun)
Sets the error callback.
void log(rs2_log_severity severity, const char *message)
static const char * saved_pos
std::mutex _on_load_message_mtx
void imgui_easy_theming(ImFont *&font_14, ImFont *&font_18, ImFont *&monofont)
static uint8_t icon_16_png_data[]
STBIDEF stbi_uc * stbi_load_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp)
rect get_monitor_rect(GLFWmonitor *monitor)
void add_on_load_message(const std::string &msg)
#define GLFW_CROSSHAIR_CURSOR
The crosshair shape.
GLdouble GLdouble GLdouble w
GLsizei const GLchar *const * string
static const char * log_filename
#define glIsVertexArrayAPPLE
GLfloat GLfloat GLfloat GLfloat h
void shutdown_processing()
static const char * hwlogger_xml
#define glGenVertexArraysAPPLE
ux_window(const char *title, context &ctx)
std::shared_ptr< visualizer_2d > _2d_vis
void prepare_config_file()
#define glDeleteVertexArrays
static const char * log_to_console
GLFWAPI int glfwInit(void)
Initializes the GLFW library.
#define glGenVertexArrays
#define GL_SHADING_LANGUAGE_VERSION
GLFWAPI GLFWmonitor ** glfwGetMonitors(int *count)
Returns the currently connected monitors.
GLFWAPI void glfwSetWindowUserPointer(GLFWwindow *window, void *pointer)
Sets the user pointer of the specified window.
static const char * metric_system
IMGUI_API bool Begin(const char *name, bool *p_open=NULL, ImGuiWindowFlags flags=0)
void glfw_error_callback(int error, const char *description)
IMGUI_API void PopStyleVar(int count=1)
static const char * saved_size
#define GL_COLOR_BUFFER_BIT
#define glBindVertexArray
void reset(clock::time_point start_time=clock::now()) const
GLAPI int GLAD_GL_VERSION_3_0
void shutdown_rendering()
GLFWAPI void glfwSwapInterval(int interval)
Sets the swap interval for the current context.
#define GLFW_HAND_CURSOR
The hand shape.
GLFWAPI GLFWwindowposfun glfwSetWindowPosCallback(GLFWwindow *window, GLFWwindowposfun cbfun)
Sets the position callback for the specified window.
#define glDeleteVertexArraysAPPLE
bool ImGui_ImplGlfw_Init(GLFWwindow *window, bool install_callbacks)
std::string get(const char *key, const char *def) const
double get_elapsed_ms() const
std::vector< std::string > _on_load_message
IMGUI_API ImGuiIO & GetIO()
void GLAPIENTRY MessageCallback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, const void *userParam)
GLint GLsizei GLsizei height
static uint8_t icon_256_png_data[]
bool is_gui_aligned(GLFWwindow *win)
static const char * sw_updates_url
IMGUI_API void SetNextWindowSize(const ImVec2 &size, ImGuiSetCond cond=0)
GLFWAPI void glfwSwapBuffers(GLFWwindow *window)
Swaps the front and back buffers of the specified window.
GLFWAPI void glfwMakeContextCurrent(GLFWwindow *window)
Makes the context of the specified window current for the calling thread.
static const char * compression_mode
std::function< void()> on_reload_complete
GLFWAPI void glfwMaximizeWindow(GLFWwindow *window)
Maximizes the specified window.
#define glDebugMessageCallback
static const char * use_normals
IMGUI_API void Text(const char *fmt,...) IM_PRINTFARGS(1)
GLenum GLuint GLenum GLsizei const GLchar const void * userParam
#define RS2_PRODUCT_LINE_ANY_INTEL
void init_rendering(bool use_glsl=true)
static size_t splash_size
GLAPI int gladLoadGLLoader(GLADloadproc)
static uint8_t icon_24_png_data[]
GLFWAPI void glfwSetWindowSize(GLFWwindow *window, int width, int height)
Sets the size of the client area of the specified window.
void show(const rect &r, float alpha, const rect &normalized_zoom=rect{0, 0, 1, 1}) const
static const textual_icon exit
GLFWAPI void glfwSetWindowPos(GLFWwindow *window, int xpos, int ypos)
Sets the position of the client area of the specified window.
IMGUI_API void PushStyleColor(ImGuiCol idx, const ImVec4 &col)
std::atomic< bool > _keep_alive
IMGUI_API void PushFont(ImFont *font)
int pick_scale_factor(GLFWwindow *window)
GLFWAPI GLFWwindow * glfwCreateWindow(int width, int height, const char *title, GLFWmonitor *monitor, GLFWwindow *share)
Creates a window and its associated context.
std::string _dev_stat_message
static uint32_t icon_16_png_size
void ImGui_ImplGlfw_NewFrame(float scale_factor)
static const char * is_fullscreen
void set(const char *key, const char *value)
#define GLFW_MAXIMIZED
Window maximization window hint and attribute.
static const char * log_severity
GLint GLint GLint yoffset
#define glBindVertexArrayAPPLE
GLAPI int GLAD_GL_ARB_vertex_array_object
GLFWAPI GLFWmonitor * glfwGetPrimaryMonitor(void)
Returns the primary monitor.
GLFWAPI void glfwDestroyWindow(GLFWwindow *window)
Destroys the specified window and its context.
GLFWAPI void glfwGetFramebufferSize(GLFWwindow *window, int *width, int *height)
Retrieves the size of the framebuffer of the specified window.
static const char * maximized
GLFWAPI void glfwShowWindow(GLFWwindow *window)
Makes the specified window visible.
static const char * ground_truth_r
STBIDEF void stbi_image_free(void *retval_from_stbi_load)
bool contains(const float2 &p) const
GLFWAPI void glfwTerminate(void)
Terminates the GLFW library.
static uint32_t icon_24_png_size
#define GLFW_VISIBLE
Window visibility window hint and attribute.
static const char * position_x
std::string api_version_to_string(int version)
#define GLFW_SAMPLES
Framebuffer MSAA samples hint.
GLsizei GLsizei GLchar * source
bool starts_with(const std::string &s, const std::string &prefix)
GLFWAPI void glfwPollEvents(void)
Processes all pending events.
static const char * shading_mode
static uint32_t icon_256_png_size
static const char * encoding
GLenum GLuint GLenum GLsizei length
static const char * sw_updates_official_server
void set_default(const char *key, const char *calculate)
static const char * recommend_updates
std::atomic< bool > _app_ready
texture_buffer _splash_tex
static const char * default_path
static const char * height
void upload_image(int w, int h, void *data, int format=GL_RGBA)
struct GLFWwindow GLFWwindow
GLFWAPI void glfwWindowHint(int hint, int value)
Sets the specified window hint to the desired value.
static const char * file_save_mode
GLFWcursor * _cross_cursor
GLFWAPI void glfwSetWindowIcon(GLFWwindow *window, int count, const GLFWimage *images)
Sets the icon for the specified window.
static const char * allow_rc_firmware
utilities::time::stopwatch _splash_timer
static const char * width
IMGUI_API void PopStyleColor(int count=1)
GLFWAPI int glfwWindowShouldClose(GLFWwindow *window)
Checks the close flag of the specified window.
std::string to_string(T value)