Lisp HUG Maillist Archive

CAPI with opengl programmable pipeline

Hi,
I looked at the opengl example in the lispworks examples directory. It uses the fixed programmable pipeline. I have used that as a source and wrote 2-3 opengl based prototype apps. Works fine.

However, I want to move to the opengl programmable pipeline. If anyone has done that, and could share example code/experience in doing so, would be great as a starting point. 

Btw, while coding up a few opengl examples, I wrote a small utility so that animations can be synced with the vsync. I have attached the file. Just pass the start-animation-with-vsync a function that does stuff you want and (re)displays the canvas containing the opengl pane. Ensure that you load this display.lisp after loading the opengl system.

The other patch is for anti aliasing. Replace cocoa.lisp with cocoa.lisp in the opengl code in LW distribution. Please take a backup of your cocoa.lisp! Kindly note that the vsycn and anti aliasing patches are tested only on LW for Mac. Hopefully the patches are useful.

Thanks,
Deepak

--
http://deepaksurti.com
To see a miracle, be the miracle.

Re: CAPI with opengl programmable pipeline

Hi Deepak,

I have written a simple OpenGL 3.2 wrapper and like you, used a DisplayLink to enable vertical sync.
I wanted the wrapper to be short, and manually written so the only the minimal set is required.  Also, I don’t like automatically generated wrappers as the function and contants names are often broken.  I borrowed some ideas from CL-OPENGL, again only what I needed.  CL-OPENGL is too big and does not work that well on LispWorks.

I am pretty sure the wrapper is incomplete, still it is able to compile and load shaders, and do basic things properly. If you are interested, please write to me privately and I will prepare something to share with you.

Remember that a DisplayLink is actually a separate thread, therefore you have to ensure you do not modify code in a unsafe manner.  I have not found a proper way to do that from the REPL at the moment.


Best,
Cam




On 27 Jan 2014, at 16:21, Deepak Surti <dmsurti@gmail.com> wrote:

Hi,
I looked at the opengl example in the lispworks examples directory. It uses the fixed programmable pipeline. I have used that as a source and wrote 2-3 opengl based prototype apps. Works fine.

However, I want to move to the opengl programmable pipeline. If anyone has done that, and could share example code/experience in doing so, would be great as a starting point. 

Btw, while coding up a few opengl examples, I wrote a small utility so that animations can be synced with the vsync. I have attached the file. Just pass the start-animation-with-vsync a function that does stuff you want and (re)displays the canvas containing the opengl pane. Ensure that you load this display.lisp after loading the opengl system.

The other patch is for anti aliasing. Replace cocoa.lisp with cocoa.lisp in the opengl code in LW distribution. Please take a backup of your cocoa.lisp! Kindly note that the vsycn and anti aliasing patches are tested only on LW for Mac. Hopefully the patches are useful.

Thanks,
Deepak

--
http://deepaksurti.com
To see a miracle, be the miracle.
<display.lisp><cocoa.lisp>

Updated at: 2020-12-10 08:34 UTC