21 int main(
int argc,
char * argv[])
try 27 if(ctx.
get_device_count() == 0)
throw std::runtime_error(
"No device detected. Is it plugged in?");
37 std::ostringstream ss; ss <<
"CPP Image Alignment Example (" << dev.
get_name() <<
")";
50 glViewport(0, 0, w, h);
51 glClear(GL_COLOR_BUFFER_BIT);
56 glOrtho(0, w, h, 0, -1, +1);
80 catch(
const std::exception & e)
82 std::cerr << e.what() << std::endl;
void log_to_console(log_severity min_severity)
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.
GLFWAPI void glfwGetWindowSize(GLFWwindow *window, int *width, int *height)
Retrieves the size of the client area of the specified window.
const std::string & get_failed_args() const
Exposes librealsense functionality for C++ compilers.
GLfloat GLfloat GLfloat GLfloat h
struct GLFWwindow GLFWwindow
Opaque window object.
GLFWAPI int glfwInit(void)
Initializes the GLFW library.
void show(float rx, float ry, float rw, float rh) const
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.
GLFWAPI GLFWwindow * glfwCreateWindow(int width, int height, const char *title, GLFWmonitor *monitor, GLFWwindow *share)
Creates a window and its associated context.
int main(int argc, char *argv[])
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.
GLFWAPI void glfwTerminate(void)
Terminates the GLFW library.
GLFWAPI void glfwPollEvents(void)
Processes all pending events.
device * get_device(int index)
const std::string & get_failed_function() const
GLubyte GLubyte GLubyte GLubyte w
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.