OpenGL: how glScissors works?

I’m trying to replace my canvas to an OpenGL based class in my app (mainly because clipping is bugged in canvas). Can anybody post me an example how OpenGL.glScissor should work?
I’ve this piece of code:

if (IsClip) then

[drawing happens here]

if (IsClip) then

Where clipX,clipY,clipWidth,clipHeight are valid coordinates of the clipping region, but with the above code it doesn’t display anything if IsClip is true (otherwise works fine)

What’s buggy about canvas clipping? You can only clip 1 level and accounting for that clipping has worked for me.

Your OpenGL code looks correct. The 2 possibilites I can think of are scissoring can’t be changed inside a begin/end and coordinates are Y-up. This code (which is your code with brute force drawing) should draw a green block in the lower left corner, unless it’s inside a begin/end.

OpenGL.glScissor(10, 10, 200, 100)

OpenGL.glClearColor(0, 1, 0, 0)


Thanks for the help, the Y coordinates were wrong (as for Scissor y=0 means the lower edge).
Nested clips are not working with Xojo (see: <>)