Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re^4: Graphics: OpenGL in Perl/Tk ... with GLUT

by haj (Priest)
on Jan 07, 2023 at 11:21 UTC ( #11149404=note: print w/replies, xml ) Need Help??

in reply to Re^3: Graphics: OpenGL in Perl/Tk ... with GLUT
in thread Graphics: OpenGL in Perl/Tk ... with GLUT

Thanks for the clarification regarding the Sandbox tests!

I don't mind a "exactly the same as the C API" approach, but this then needs some explanation of how to deal with interfaces which expect a pointer to a C array like e.g. glSelectBuffer. OpenGL populates this C array, and I need a way to examine the results.

I guess OpenGL::Modern can be used together with OpenGL::Array in the same way as it is used with OpenGL, but I have little motivation to try it.

Also, I should mention that my focus isn't on shaders. While I know that they can provide amazing effects, I am happy with the "basic" stuff which is in plain old OpenGL. What I'm after is interaction with drawn shapes. Tk::Canvas provides this: I can add callbacks to individual polygons and tag them appropriately so that all primitives which make a complex shape have the same tag. Only this approach is getting painfully slow if I have tens of thousands of primitives. OpenGL has a different approach for this: Normal rendering is done without any callbacks. After a mouse click, I can re-render a tiny part part of the scene (e.g. a 5x5 pixel area around the point where the click happened) and OpenGL will tell me what objects were on the way.

Plus, of course, most of the drawing is done by the GPU (which is, btw, the part also done by Tk::Zinc). This gives amazing speed, which is why I don't want to try the two-step approach of interactivity (i.e. redraw a tiny area after a mouse click) in plain Tk.

  • Comment on Re^4: Graphics: OpenGL in Perl/Tk ... with GLUT

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11149404]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2023-03-20 22:07 GMT
Find Nodes?
    Voting Booth?
    Which type of climate do you prefer to live in?

    Results (59 votes). Check out past polls.