PDA

View Full Version : thinBasic_GL.inc



ReneMiner
24-11-2012, 16:47
I got that so far ( see other thread http://www.thinbasic.com/community/showthread.php?8295-TBGL-OpenGL-Advanced-User ) - but I open a new one in order to keep other thread on topic. I hope it belongs somehow to TBGL...

It's described there ( http://www.opengl.org/sdk/docs/man2/ ) almost like I tried without any success for a couple of hours now, but I found something missing in the "thinbasic_gl.inc" - there's no glColorLogicOp-Sub declared but a switch to glEnable(%GL_COLOR_LOGIC_OP) exists, so I cannot set glColorLogicOp(%GL_XOR). Just glLogicOp(%GL_XOR or whatever) does not affect the drawing result. What now?
:confused:

matthew
24-11-2012, 22:07
Back in 2007 I wrote a program in Basic4GL which used GL_XOR and GL_LOGIC_OP. I've uploaded the program here (http://comp-storage.wikispaces.com/file/view/rubber.band.gb/385566428/rubber.band.gb) if you want to take a look at it. I commented it at the time I wrote it so it should make sense.

ReneMiner
24-11-2012, 23:14
thanx matthew. glFlush() was the golden move! but works different using tb. needs to draw just once here :)

Mousepointer-Haircross:


glEnable(%GL_COLOR_LOGIC_OP)
glLogicOp(%GL_XOR)

TBGL_Color( 255, 255, 255)

TBGL_Line(TBGL_MouseGetPosX-10,TBGL_MouseGetPosY,TBGL_MouseGetPosX + 10, TBGL_MouseGetPosY)
TBGL_Line(TBGL_MouseGetPosX,TBGL_MouseGetPosY -10,TBGL_MouseGetPosX, TBGL_MouseGetPosY+10)
glFlush()

glLogicOP(%GL_COPY)
glDisable(%GL_COLOR_LOGIC_OP)

:yahoo: :dance1: :party: :yahoo: :dance1: :drink:
Edit: found also out that %GL_NAND and some other color than white is even better. XOR on medium gray gets invisible...

Petr Schreiber
25-11-2012, 11:20
Hi Rene,

glColorLogicOp is not defined because it is not part of desktop OpenGL. It is present only in OpenGL ES, which is similar beast targeted for mobile devices (tablets/smartphones/...)


Petr