12 int main(
int argc,
char * argv[])
try 18 if(ctx.
get_device_count() == 0)
throw std::runtime_error(
"No device detected. Is it plugged in?");
21 std::vector<rs::device *> devices;
28 for(
auto dev : devices)
30 std::cout <<
"Starting " <<
dev->
get_name() <<
"... ";
34 std::cout <<
"done." << std::endl;
42 std::ostringstream ss; ss <<
"CPP Multi-Camera Example";
46 int windowWidth, windowHeight;
50 auto perTextureWidth =
int(windowWidth / devices.size());
51 auto perTextureHeight = 480;
61 glViewport(0, 0, w, h);
62 glClear(GL_COLOR_BUFFER_BIT);
66 glOrtho(0, w, h, 0, -1, +1);
69 for(
auto dev : devices)
71 dev->poll_for_frames();
91 catch(
const std::exception & e)
93 std::cerr << e.what() << std::endl;
void log_to_console(log_severity min_severity)
int main(int argc, char *argv[])
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
virtual void start(rs_source source)=0
virtual const char * get_name() const =0
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.
typedef int(WINAPI *PFNWGLRELEASEPBUFFERDCARBPROC)(HPBUFFERARB hPbuffer
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.
virtual void enable_stream(rs_stream stream, int width, int height, rs_format format, int fps, rs_output_buffer_format output)=0
GLFWAPI GLFWwindow * glfwCreateWindow(int width, int height, const char *title, GLFWmonitor *monitor, GLFWwindow *share)
Creates a window and its associated context.
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
GLint GLint GLint GLint GLint x
GLubyte GLubyte GLubyte GLubyte w
std::vector< texture_buffer > buffers
int get_device_count() const
GLFWAPI int glfwWindowShouldClose(GLFWwindow *window)
Checks the close flag of the specified window.