예제 #1
0
sge::opengl::target::basic<
Base
>::basic(
    sge::opengl::context::object &_context,
    sge::renderer::target::viewport const &_viewport
)
    :
    Base(),
    sge::opengl::target::base(),
    context_(
       sge::opengl::context::use<
       sge::opengl::target::context
       >(
           _context
       )
    ),
    active_(
       false
    ),
    viewport_(
       _viewport
    ),
    scissor_area_(
       sge::renderer::target::scissor_area(
           _viewport.get()
       )
    )
{
}
예제 #2
0
void
sge::opengl::target::viewport(
	sge::renderer::target::viewport const &_viewport,
	sge::renderer::screen_unit const _height
)
{
	sge::opengl::target::set_flipped_area(
		sge::opengl::get_fun_ref(
			::glViewport
		),
		_viewport.get(),
		_height
	);

	SGE_OPENGL_CHECK_STATE(
		FCPPT_TEXT("glViewport failed"),
		sge::renderer::exception
	)
}
예제 #3
0
D3DVIEWPORT9 const
sge::d3d9::convert::viewport(
    sge::renderer::target::viewport const &_viewport
)
{
    sge::renderer::pixel_rect const rect(
        _viewport.get()
    );

    D3DVIEWPORT9 const ret =
    {
        static_cast<
        DWORD
        >(
            rect.left()
        ),
        static_cast<
        DWORD
        >(
            rect.top()
        ),
        static_cast<
        DWORD
        >(
            rect.size().w()
        ),
        static_cast<
        DWORD
        >(
            rect.size().h()
        ),
        0.f,
        1.f
    };

    return ret;
}