Author Topic: Why visuallisp do not contain opengl32.dll or web-gl?  (Read 881 times)

0 Members and 1 Guest are viewing this topic.

d2010

  • Bull Frog
  • Posts: 323
Why visuallisp do not contain opengl32.dll or web-gl?
« on: October 11, 2021, 05:26:25 AM »
I known, the VLisp (real name Visual Lisp, is Slow).
Why? the slower VLisp, must be connected directly with Opengl-assembler.
Already I saw, OpenGL are very faster/s assembler-instructions.

 :gum:
https://www.quora.com/Can-Lisp-or-some-other-programming-languages-be-faster-than-C-on-some-microprocessors
 :smitten:

So. Vlisp+Opengl=very good upgrade.vlx
« Last Edit: November 21, 2021, 01:49:37 PM by d2010 »

MickD

  • King Gator
  • Posts: 3619
  • (x-in)->[process]->(y-out) ... simples!
Re: Why visuallisp do not contain opengl32.dll or web-gl?
« Reply #1 on: October 11, 2021, 04:41:16 PM »
AutoLisp is an embedded 'scripting' language built and targeted directly inside the AutoCAD API, it's not a 'general purpose' language like C++ say so there are no constructs/API's or libraries that give access to OpenGL or any other lower level drivers or API's other than AutoCAD. You can not use it outside of AutoCAD.

OpenGL is a low level graphics library, basically you feed it lists of vertices and triangle indexes of these vertices with some shader language for colours etc and it does the number crunching to draw the pixels on the screen, it has no idea of your CAD system or anything else. Basically the only speed benefits of OpenGL is to draw graphics primitives.

WebGL is similar to OpenGL but for web browsers only and is typically written in JavaScript although there is more and more capability coming out to compile to Web Assembly from other languages every day. Again though, AutoLisp is not usable here.

Even AutoCAD abstracts away the graphics drivers (OpenGL/DirectX), while technically you could get to them (the graphics context) via C/C++ there's really no point as you would be bypassing all the drawing database and functionality.
The graphics context is the last piece in the chain but you need the whole chain to know what to draw:
Drawing Database -> Database Objects -> Object's drawable primitives -> Graphics library/context draws pixels on screen.

Something like Common Lisp on the other hand is more than capable of using OpenGL but you then need to create the UI window/s, graphics context and database etc yourself from scratch.
hth
"Short cuts make long delays,' argued Pippin.”
J.R.R. Tolkien