19 printf(
"There are %d connected RealSense devices.\n", ctx.
get_device_count());
24 printf(
"\nUsing device 0, an %s\n", dev->
get_name());
25 printf(
" Serial number: %s\n", dev->
get_serial());
33 catch(...) { printf(
"Device does not provide infrared2 stream.\n"); }
46 glClear(GL_COLOR_BUFFER_BIT);
53 glPixelTransferf(GL_RED_SCALE, 1.0
f);
79 printf(
" %s\n", e.what());
Provides convenience methods relating to devices.
void enable_stream(stream stream, int width, int height, format format, int framerate, output_buffer_format output_buffer_type=output_buffer_format::continous)
Enables specific stream and requests specific properties.
const std::string & get_failed_args() const
const char * get_firmware_version() const
Retrieves version of firmware currently installed on device.
Exposes librealsense functionality for C++ compilers.
const void * get_frame_data(stream stream) const
Retrieves contents of latest frame on a stream.
struct GLFWwindow GLFWwindow
Opaque window object.
GLFWAPI int glfwInit(void)
Initializes the GLFW library.
bool is_stream_enabled(stream stream) const
Determines if specific stream is enabled.
const char * get_name() const
Retrieves human-readable device model string.
void start(rs::source source=rs::source::video)
Begins streaming on all enabled streams for this device.
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.
const char * get_serial() const
Retrieves unique serial number of device.
GLFWAPI GLFWwindow * glfwCreateWindow(int width, int height, const char *title, GLFWmonitor *monitor, GLFWwindow *share)
Creates a window and its associated context.
GLFWAPI void glfwPollEvents(void)
Processes all pending events.
float get_depth_scale() const
Retrieves mapping between units of depth image and meters.
device * get_device(int index)
const std::string & get_failed_function() const
void wait_for_frames()
Blocks until new frames are available.
int get_device_count() const
GLFWAPI int glfwWindowShouldClose(GLFWwindow *window)
Checks the close flag of the specified window.