Inverting draw mode? |
Re: Inverting draw mode? |
rtrussell
|
I rely on it. The solution I use is to force OpenGL (or GLES 1.0) when it's not the default:
then you can enable the wanted drawing mode using:
Works perfectly for me on Windows, Linux, Mac OS and Android. It's unfortunate that support for glLogicOp was dropped from GLES 2.0 so on platforms which can't run full OpenGL you are forced to use the legacy GLES 1.0. Richard. |
|||||||||||||||||
|
Inverting draw mode? |
Jonny D
|
Does GLSL ES have bitwise operators? I would think you could invert in a shader.
Jonny D On Thu, Dec 8, 2016 at 7:12 AM, rtrussell wrote:
|
|||||||||||||
|
EternalLands
|
Reading from the video memory is always a bad idea.
Why don't you make your own screen buffer, do your drawing in it, then at the end you put it in a texture and render it? |
|||||||||||
|
joymaker
|
EternalLands - that's what I was planning on doing anyway, I just didn't see any primitive operators with which to do it. What I don't want to do if I don't have to is reinvent the rectangle drawing primitive from scratch, just to do this.
Richard – thanks, that sounds like a good plan. So I think you're telling me that setting up the OpenGL LogicOp will modify ALL drawing done through the window, SDL primitives as well as OpenGL primitives. Right? (And is there any significant downside to specifying "opengl" as my driver, instead of the usual default?) Thanks, Ken |
|||||||||||
|
rtrussell
|
Yes, SDL drawing operations such as SDL_RenderDrawPoint, SDL_RenderDrawLine and those in SDL_gfx will be affected by the LogicOp. For safety I would recommend enabling and setting the LogicOp only around such calls rather than leaving it active for longer periods, just in case it interferes with anything else in SDL.
Only in Windows is OpenGL/GLES not the default, I think, and I've not noticed any significant impact from forcing its use. Richard. |
|||||||||||||||
|
rtrussell
|
Here's the SDL_gfx demo modified to use exclusive-or plotting:
|
|||||||||||||
|