I would like to clip 2d drawing to rectangular viewports. Here are the problems I have encountered:
- draw2DRectangleOutline & draw2DLine don't have clip paramater like for example draw2DImage. Will this be implemented in future versions?
- IGUIFont::Draw clip paramter doesn't seem to work, but maybe it's just me?
- I don't know how to clip the polygons rendered with draw2DVertexPrimitiveList(). Any ideas?
Help will be very much appreciated.
Clipping 2d rendering
-
- Posts: 109
- Joined: Tue Jan 09, 2007 1:18 pm
Clipping 2d rendering
Crimson Glory full Irrlicht game source code!
What I Do - my blog & dev log
Currently developing Link-Dead
What I Do - my blog & dev log
Currently developing Link-Dead
Re: Clipping 2d rendering
I ran into a similar problem where I wanted to clip some 2-d stuff. The response I got was basically that there is no current clipping implementation in Irrlicht, so you'll have to find your own strategy for how you want to clip these.
To the devs: I think clipping support for 2D lines/rectangles/vertices would help a lot for people developing their own GUI systems. How hard would this be to implement?
To the devs: I think clipping support for 2D lines/rectangles/vertices would help a lot for people developing their own GUI systems. How hard would this be to implement?
-
- Posts: 109
- Joined: Tue Jan 09, 2007 1:18 pm
I used Scissor thanks! It's such a useful function why isn't it implemented? You can use it for a ton of stuff. GUI clipping for viewport, scroll panes, scrolling images etc.
Here's the code I add to COpenGLDriver.cpp
Here's the code I add to COpenGLDriver.cpp
Code: Select all
void COpenGLDriver::setScissor( bool enabled )
{
if (enabled)
{
glEnable(GL_SCISSOR_TEST);
}
else
{
glDisable(GL_SCISSOR_TEST);
}
}
void COpenGLDriver::setScissorRect( s32 x, s32 y, s32 width, s32 height )
{
glScissor( x, y, width, height );
}
Crimson Glory full Irrlicht game source code!
What I Do - my blog & dev log
Currently developing Link-Dead
What I Do - my blog & dev log
Currently developing Link-Dead