renderstack::window Class Reference

native window system window with rendering context

#include <window.hpp>

Public Member Functions

 window ()
 ~window ()
void realize ()
void show ()
void hide ()
void swap_buffers ()
void reshape ()
void make_current ()
rectangleclient_area ()
rectangle const & client_area () const
rectanglewindow_frame ()
rectangle const & window_frame () const
void set_fullscreen (bool i)
void set_hide_mouse (bool i)
void set_red_size (int i)
void set_green_size (int i)
void set_blue_size (int i)
void set_alpha_size (int i)
void set_buffer_size (int i)
void set_depth_size (int i)
void set_stencil_size (int i)
void set_msaa_sample_count (int i)
void set_swap_control (int i)
void set_srgb_capable (bool i)
bool fullscreen () const
bool hide_mouse () const
int red_size () const
int green_size () const
int blue_size () const
int alpha_size () const
int buffer_size () const
int depth_size () const
int stencil_size () const
int msaa_sample_count () const
int swap_control () const
bool srgb_capable () const

Static Public Member Functions

static void fullscreen (int &width, int &height)

Detailed Description

Definition at line 49 of file window.hpp.


Constructor & Destructor Documentation

renderstack::window::window (  ) 

Definition at line 31 of file window.cpp.

00032 {
00033     ::memset(&m_window_low, 0, sizeof(struct ::rs_window));
00034 }

renderstack::window::~window (  ) 

Definition at line 36 of file window.cpp.

00037 {
00038     ::rs_window_destroy(&m_window_low);
00039 }


Member Function Documentation

void renderstack::window::fullscreen ( int &  width,
int &  height 
) [static]

Definition at line 41 of file window.cpp.

00042 {
00043     ::rs_window_fullscreen(&width, &height);
00044 }

void renderstack::window::realize (  ) 

Definition at line 46 of file window.cpp.

00047 {
00048     m_window_low.client_area.x      = m_client_area.x();
00049     m_window_low.client_area.y      = m_client_area.y();
00050     m_window_low.client_area.width  = m_client_area.width();
00051     m_window_low.client_area.height = m_client_area.height();
00052 
00053     m_window_low.window_frame.x      = m_window_frame.x();
00054     m_window_low.window_frame.y      = m_window_frame.y();
00055     m_window_low.window_frame.width  = m_window_frame.width();
00056     m_window_low.window_frame.height = m_window_frame.height();
00057 
00058     int res = ::rs_window_create(&m_window_low);
00059     if(res != 0)
00060     {
00061         throw realize_failed_exception();
00062     }
00063 
00064     m_client_area.set_x     (m_window_low.client_area.x     );
00065     m_client_area.set_y     (m_window_low.client_area.y     );
00066     m_client_area.set_width (m_window_low.client_area.width );
00067     m_client_area.set_height(m_window_low.client_area.height);
00068 
00069     m_window_frame.set_x     (m_window_low.window_frame.x     );
00070     m_window_frame.set_y     (m_window_low.window_frame.y     );
00071     m_window_frame.set_width (m_window_low.window_frame.width );
00072     m_window_frame.set_height(m_window_low.window_frame.height);
00073 }

void renderstack::window::show (  ) 

Definition at line 75 of file window.cpp.

00076 {
00077     ::rs_window_show(&m_window_low);
00078 }

void renderstack::window::hide (  ) 

Definition at line 80 of file window.cpp.

00081 {
00082     ::rs_window_hide(&m_window_low);
00083 }

void renderstack::window::swap_buffers (  ) 

Definition at line 85 of file window.cpp.

00086 {
00087     ::rs_window_swap_buffers(&m_window_low);
00088 }

void renderstack::window::reshape (  ) 

Definition at line 90 of file window.cpp.

00091 {
00092     ::rs_window_reshape(&m_window_low);
00093 }

void renderstack::window::make_current (  ) 

Definition at line 95 of file window.cpp.

00096 {
00097     int res = ::rs_window_make_current(&m_window_low);
00098 
00099     if(res != 1)
00100     {
00101         throw make_current_failed_exception();
00102     }
00103 }

rectangle& renderstack::window::client_area (  )  [inline]

Definition at line 64 of file window.hpp.

00064 { return m_client_area; }

rectangle const& renderstack::window::client_area (  )  const [inline]

Definition at line 65 of file window.hpp.

00065 { return m_client_area; }

rectangle& renderstack::window::window_frame (  )  [inline]

Definition at line 66 of file window.hpp.

00066 { return m_window_frame; }

rectangle const& renderstack::window::window_frame (  )  const [inline]

Definition at line 67 of file window.hpp.

00067 { return m_window_frame; }

void renderstack::window::set_fullscreen ( bool  i  )  [inline]

Definition at line 69 of file window.hpp.

00069 { m_window_low.fullscreen        = i ? 1 : 0; }

void renderstack::window::set_hide_mouse ( bool  i  )  [inline]

Definition at line 70 of file window.hpp.

00070 { m_window_low.hide_mouse        = i ? 1 : 0; }

void renderstack::window::set_red_size ( int  i  )  [inline]

Definition at line 71 of file window.hpp.

00071 { m_window_low.red_size          = i; }

void renderstack::window::set_green_size ( int  i  )  [inline]

Definition at line 72 of file window.hpp.

00072 { m_window_low.green_size        = i; }

void renderstack::window::set_blue_size ( int  i  )  [inline]

Definition at line 73 of file window.hpp.

00073 { m_window_low.blue_size         = i; }

void renderstack::window::set_alpha_size ( int  i  )  [inline]

Definition at line 74 of file window.hpp.

00074 { m_window_low.alpha_size        = i; }

void renderstack::window::set_buffer_size ( int  i  )  [inline]

Definition at line 75 of file window.hpp.

00075 { m_window_low.buffer_size       = i; }

void renderstack::window::set_depth_size ( int  i  )  [inline]

Definition at line 76 of file window.hpp.

00076 { m_window_low.depth_size        = i; }

void renderstack::window::set_stencil_size ( int  i  )  [inline]

Definition at line 77 of file window.hpp.

00077 { m_window_low.stencil_size      = i; }

void renderstack::window::set_msaa_sample_count ( int  i  )  [inline]

Definition at line 78 of file window.hpp.

00078 { m_window_low.msaa_sample_count = i; }

void renderstack::window::set_swap_control ( int  i  )  [inline]

Definition at line 79 of file window.hpp.

00079 { m_window_low.swap_control      = i; }

void renderstack::window::set_srgb_capable ( bool  i  )  [inline]

Definition at line 80 of file window.hpp.

00080 { m_window_low.srgb_capable      = i ? 1 : 0; }

bool renderstack::window::fullscreen (  )  const [inline]

Definition at line 82 of file window.hpp.

00082 { return m_window_low.fullscreen != 0   ; }

bool renderstack::window::hide_mouse (  )  const [inline]

Definition at line 83 of file window.hpp.

00083 { return m_window_low.hide_mouse != 0   ; }

int renderstack::window::red_size (  )  const [inline]

Definition at line 84 of file window.hpp.

00084 { return m_window_low.red_size          ; }

int renderstack::window::green_size (  )  const [inline]

Definition at line 85 of file window.hpp.

00085 { return m_window_low.green_size        ; }

int renderstack::window::blue_size (  )  const [inline]

Definition at line 86 of file window.hpp.

00086 { return m_window_low.blue_size         ; }

int renderstack::window::alpha_size (  )  const [inline]

Definition at line 87 of file window.hpp.

00087 { return m_window_low.alpha_size        ; }

int renderstack::window::buffer_size (  )  const [inline]

Definition at line 88 of file window.hpp.

00088 { return m_window_low.buffer_size       ; }

int renderstack::window::depth_size (  )  const [inline]

Definition at line 89 of file window.hpp.

00089 { return m_window_low.depth_size        ; }

int renderstack::window::stencil_size (  )  const [inline]

Definition at line 90 of file window.hpp.

00090 { return m_window_low.stencil_size      ; }

int renderstack::window::msaa_sample_count (  )  const [inline]

Definition at line 91 of file window.hpp.

00091 { return m_window_low.msaa_sample_count ; }

int renderstack::window::swap_control (  )  const [inline]

Definition at line 92 of file window.hpp.

00092 { return m_window_low.swap_control      ; }

bool renderstack::window::srgb_capable (  )  const [inline]

Definition at line 93 of file window.hpp.

00093 { return m_window_low.srgb_capable != 0 ; }


The documentation for this class was generated from the following files:
Generated on Sun Apr 11 12:23:12 2010 for RenderStack by  doxygen 1.6.3