Пример #1
0
void context::reset_clip( const rect &r )
{
    glEnable( GL_SCISSOR_TEST );
    glScissor( static_cast<GLint>( r.x() ),
			   static_cast<GLint>( _last_vp[3] - ( r.y() + r.height() ) ),
			   static_cast<GLsizei>( r.width() ),
			   static_cast<GLsizei>( r.height() ) );
}
 void draw ()
 {
   if (!inverted)
     w->invert_colors ();
   XFillRectangle (w->display, w->win, w->gc, box.ul.x, box.ul.y,
                                              box.width (), box.height ());
   w->default_colors ();
   XDrawRectangle (w->display, w->win, w->gc, box.ul.x, box.ul.y,
                                              box.width (), box.height ());
 }
Пример #3
0
bool window::update_geometry( rect &r )
{
	SetWindowPos( _hwnd, NULL, r.x(), r.y(), r.width(), r.height(),
				  SWP_NOOWNERZORDER | SWP_NOZORDER );
	r = query_geometry();
	return true;
}
Пример #4
0
void OpenGL3RenderState::set_viewport(OpenGL3ContextState& state, const rect<int>& viewport) const
{
    if (state.viewport == viewport)
        return;
    glViewport(viewport.ll().x(), viewport.ll().y(), viewport.width(), viewport.height());
    state.viewport = viewport;
}
Пример #5
0
 inline void initialize(device_context* dc, rect pr)
 {
     dc_       =  dc;
     rect_     =  pr = pr.normalize();
     poffset_  = -pr.left_top();
     prect_    =  pr;
     mask_     =  nullptr;
     canvas_   =  std::make_shared<canvas_type>(pr.width(), pr.height());
 }
Пример #6
0
void dark_style::slider_groove( const std::shared_ptr<draw::canvas> &c, const rect &rect )
{
	construct( c );

	coord rad = slider_size( rect );
	coord h = rect.height() - 7;
	rect tmp( rect );
	tmp.trim( rad, rad, h/2, h/2 );

	_slider_groove->set( c, tmp );
	_slider_groove->draw( *c );
}