Scissor Rectangle

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
stefany
Posts: 58
Joined: Wed Dec 07, 2011 10:50 am

Scissor Rectangle

Post by stefany »

Hi! I have a draw call like this:

Code: Select all

 
// Drawing with orthogonal projection... this is a GUI drawing call
driver->drawVertexPrimitiveList(vertices,vtxBufferSize,
                      currentIndex,cmd->ElemCount/3,
                      video::EVT_STANDARD,
                      scene::EPT_TRIANGLES,
                      video::EIT_16BIT);
 
I have a irr::core::rectf that i want to use like a scissor rectangle or clip rectangle. How can use that rectf as a scissor rectangle?

I tried with cliping planes... but i can't get it working.
Thanks!
REDDemon
Developer
Posts: 1044
Joined: Tue Aug 31, 2010 8:06 pm
Location: Genova (Italy)

Re: Scissor Rectangle

Post by REDDemon »

if projection is orthogonal then you can use viewport as a scissor (won't work for perspective projection).
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
stefany
Posts: 58
Joined: Wed Dec 07, 2011 10:50 am

Re: Scissor Rectangle

Post by stefany »

REDDemon wrote:if projection is orthogonal then you can use viewport as a scissor (won't work for perspective projection).
I tested it, and doesn't work correctly...

maybe... i have to set as render target a texture with the size of my scissor rectangle, and then render the texture, but that sounds as so much overhead.

EDIT: The texture have to be power of two, grrr... so it isn't solved.
stefany
Posts: 58
Joined: Wed Dec 07, 2011 10:50 am

Re: Scissor Rectangle

Post by stefany »

mmm... i just have to make darkmagic api specific...

Code: Select all

#ifdef _IRR_COMPILE_WITH_OPENGL_
    if(driverType==video::EDT_OPENGL)
    {
      glEnable(GL_SCISSOR_TEST);
      glScissor(...
...
Post Reply